pyflink 1.11.1 调用包含第三方依赖库的udf时报错

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

pyflink 1.11.1 调用包含第三方依赖库的udf时报错

fengmuqiang@ruqimobility.com
hi.
pyflink 1.11.1 调用包含第三方依赖库的udf时报错 :

运行环境:
windows10
python==3.7.9
apache-flink==1.11.1
apache-beam==2.19.0

udf 依赖第三方库:
h3==3.7.0

pytest 通过。

运行时报错,报错信息如下
2020-11-23 14:20:51,656 WARN  org.apache.flink.runtime.taskmanager.Task                    [] - Source: TableSourceScan(table=[[default_catalog, default_database, order_info]], fields=[source, order_id, user_id, car_id, driver_name, driver_id, time_dispatch_done, time_start, time_cancel, status, start_city, end_city, start_ad_code, end_ad_code, cancel_reason_id, realStartLatitude, realStartLongitude]) -> StreamExecPythonCalc -> Sink: Sink(table=[default_catalog.default_database.print_table], fields=[hash_h3]) (3/8) (056a0a0cdf3838794f4023e61d04a690) switched from RUNNING to FAILED.
java.lang.RuntimeException: Failed to create stage bundle factory!
   at org.apache.flink.python.AbstractPythonFunctionRunner.createStageBundleFactory(AbstractPythonFunctionRunner.java:197) ~[flink-python_2.11-1.11.1.jar:1.11.1]
   at org.apache.flink.python.AbstractPythonFunctionRunner.open(AbstractPythonFunctionRunner.java:164) ~[flink-python_2.11-1.11.1.jar:1.11.1]
   at org.apache.flink.table.runtime.runners.python.scalar.AbstractGeneralPythonScalarFunctionRunner.open(AbstractGeneralPythonScalarFunctionRunner.java:65) ~[flink-python_2.11-1.11.1.jar:1.11.1]
   at org.apache.flink.table.runtime.operators.python.AbstractStatelessFunctionOperator$ProjectUdfInputPythonScalarFunctionRunner.open(AbstractStatelessFunctionOperator.java:186) ~[flink-python_2.11-1.11.1.jar:1.11.1]
   at org.apache.flink.streaming.api.operators.python.AbstractPythonFunctionOperator.open(AbstractPythonFunctionOperator.java:143) ~[flink-python_2.11-1.11.1.jar:1.11.1]
   at org.apache.flink.table.runtime.operators.python.AbstractStatelessFunctionOperator.open(AbstractStatelessFunctionOperator.java:131) ~[flink-python_2.11-1.11.1.jar:1.11.1]
   at org.apache.flink.table.runtime.operators.python.scalar.AbstractPythonScalarFunctionOperator.open(AbstractPythonScalarFunctionOperator.java:88) ~[flink-python_2.11-1.11.1.jar:1.11.1]
   at org.apache.flink.table.runtime.operators.python.scalar.AbstractRowDataPythonScalarFunctionOperator.open(AbstractRowDataPythonScalarFunctionOperator.java:80) ~[flink-python_2.11-1.11.1.jar:1.11.1]
   at org.apache.flink.table.runtime.operators.python.scalar.RowDataPythonScalarFunctionOperator.open(RowDataPythonScalarFunctionOperator.java:64) ~[flink-python_2.11-1.11.1.jar:1.11.1]
   at org.apache.flink.streaming.runtime.tasks.OperatorChain.initializeStateAndOpenOperators(OperatorChain.java:291) ~[flink-dist_2.11-1.11.1.jar:1.11.1]
   at org.apache.flink.streaming.runtime.tasks.StreamTask.lambda$beforeInvoke$0(StreamTask.java:473) ~[flink-dist_2.11-1.11.1.jar:1.11.1]
   at org.apache.flink.streaming.runtime.tasks.StreamTaskActionExecutor$SynchronizedStreamTaskActionExecutor.runThrowing(StreamTaskActionExecutor.java:92) ~[flink-dist_2.11-1.11.1.jar:1.11.1]
   at org.apache.flink.streaming.runtime.tasks.StreamTask.beforeInvoke(StreamTask.java:469) ~[flink-dist_2.11-1.11.1.jar:1.11.1]
   at org.apache.flink.streaming.runtime.tasks.StreamTask.invoke(StreamTask.java:522) ~[flink-dist_2.11-1.11.1.jar:1.11.1]
   at org.apache.flink.runtime.taskmanager.Task.doRun(Task.java:721) [flink-dist_2.11-1.11.1.jar:1.11.1]
   at org.apache.flink.runtime.taskmanager.Task.run(Task.java:546) [flink-dist_2.11-1.11.1.jar:1.11.1]
   at java.lang.Thread.run(Thread.java:748) [?:1.8.0_221]
Caused by: org.apache.beam.vendor.guava.v26_0_jre.com.google.common.util.concurrent.UncheckedExecutionException: java.lang.IllegalStateException: Process died with exit code 0
   at org.apache.beam.vendor.guava.v26_0_jre.com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2050) ~[flink-python_2.11-1.11.1.jar:1.11.1]
   at org.apache.beam.vendor.guava.v26_0_jre.com.google.common.cache.LocalCache.get(LocalCache.java:3952) ~[flink-python_2.11-1.11.1.jar:1.11.1]
   at org.apache.beam.vendor.guava.v26_0_jre.com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3974) ~[flink-python_2.11-1.11.1.jar:1.11.1]
   at org.apache.beam.vendor.guava.v26_0_jre.com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4958) ~[flink-python_2.11-1.11.1.jar:1.11.1]
   at org.apache.beam.vendor.guava.v26_0_jre.com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4964) ~[flink-python_2.11-1.11.1.jar:1.11.1]
   at org.apache.beam.runners.fnexecution.control.DefaultJobBundleFactory$SimpleStageBundleFactory.<init>(DefaultJobBundleFactory.java:331) ~[flink-python_2.11-1.11.1.jar:1.11.1]
   at org.apache.beam.runners.fnexecution.control.DefaultJobBundleFactory$SimpleStageBundleFactory.<init>(DefaultJobBundleFactory.java:320) ~[flink-python_2.11-1.11.1.jar:1.11.1]
   at org.apache.beam.runners.fnexecution.control.DefaultJobBundleFactory.forStage(DefaultJobBundleFactory.java:250) ~[flink-python_2.11-1.11.1.jar:1.11.1]
   at org.apache.flink.python.AbstractPythonFunctionRunner.createStageBundleFactory(AbstractPythonFunctionRunner.java:195) ~[flink-python_2.11-1.11.1.jar:1.11.1]
   ... 16 more
Caused by: java.lang.IllegalStateException: Process died with exit code 0
   at org.apache.beam.runners.fnexecution.environment.ProcessManager$RunningProcess.isAliveOrThrow(ProcessManager.java:72) ~[flink-python_2.11-1.11.1.jar:1.11.1]
   at org.apache.beam.runners.fnexecution.environment.ProcessEnvironmentFactory.createEnvironment(ProcessEnvironmentFactory.java:137) ~[flink-python_2.11-1.11.1.jar:1.11.1]
   at org.apache.beam.runners.fnexecution.control.DefaultJobBundleFactory$1.load(DefaultJobBundleFactory.java:200) ~[flink-python_2.11-1.11.1.jar:1.11.1]
   at org.apache.beam.runners.fnexecution.control.DefaultJobBundleFactory$1.load(DefaultJobBundleFactory.java:184) ~[flink-python_2.11-1.11.1.jar:1.11.1]
   at org.apache.beam.vendor.guava.v26_0_jre.com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3528) ~[flink-python_2.11-1.11.1.jar:1.11.1]
   at org.apache.beam.vendor.guava.v26_0_jre.com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2277) ~[flink-python_2.11-1.11.1.jar:1.11.1]
   at org.apache.beam.vendor.guava.v26_0_jre.com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2154) ~[flink-python_2.11-1.11.1.jar:1.11.1]
   at org.apache.beam.vendor.guava.v26_0_jre.com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2044) ~[flink-python_2.11-1.11.1.jar:1.11.1]
   at org.apache.beam.vendor.guava.v26_0_jre.com.google.common.cache.LocalCache.get(LocalCache.java:3952) ~[flink-python_2.11-1.11.1.jar:1.11.1]
   at org.apache.beam.vendor.guava.v26_0_jre.com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3974) ~[flink-python_2.11-1.11.1.jar:1.11.1]
   at org.apache.beam.vendor.guava.v26_0_jre.com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4958) ~[flink-python_2.11-1.11.1.jar:1.11.1]
   at org.apache.beam.vendor.guava.v26_0_jre.com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4964) ~[flink-python_2.11-1.11.1.jar:1.11.1]
   at org.apache.beam.runners.fnexecution.control.DefaultJobBundleFactory$SimpleStageBundleFactory.<init>(DefaultJobBundleFactory.java:331) ~[flink-python_2.11-1.11.1.jar:1.11.1]
   at org.apache.beam.runners.fnexecution.control.DefaultJobBundleFactory$SimpleStageBundleFactory.<init>(DefaultJobBundleFactory.java:320) ~[flink-python_2.11-1.11.1.jar:1.11.1]
   at org.apache.beam.runners.fnexecution.control.DefaultJobBundleFactory.forStage(DefaultJobBundleFactory.java:250) ~[flink-python_2.11-1.11.1.jar:1.11.1]
   at org.apache.flink.python.AbstractPythonFunctionRunner.createStageBundleFactory(AbstractPythonFunctionRunner.java:195) ~[flink-python_2.11-1.11.1.jar:1.11.1]
   ... 16 more




[hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: pyflink 1.11.1 调用包含第三方依赖库的udf时报错

Xingbo Huang
Hi,

你可以帖下taskmanager的日志吗,这个日志只能看到启动Python进程的时候挂掉了,其他信息看不到。

Best,
Xingbo

[hidden email] <[hidden email]> 于2020年11月23日周一
下午4:11写道:

> hi.
> pyflink 1.11.1 调用包含第三方依赖库的udf时报错 :
>
> 运行环境:
> windows10
> python==3.7.9
> apache-flink==1.11.1
> apache-beam==2.19.0
>
> udf 依赖第三方库:
> h3==3.7.0
>
> pytest 通过。
>
> 运行时报错,报错信息如下
> 2020-11-23 14:20:51,656 WARN  org.apache.flink.runtime.taskmanager.Task
>                 [] - Source: TableSourceScan(table=[[default_catalog,
> default_database, order_info]], fields=[source, order_id, user_id, car_id,
> driver_name, driver_id, time_dispatch_done, time_start, time_cancel,
> status, start_city, end_city, start_ad_code, end_ad_code, cancel_reason_id,
> realStartLatitude, realStartLongitude]) -> StreamExecPythonCalc -> Sink:
> Sink(table=[default_catalog.default_database.print_table],
> fields=[hash_h3]) (3/8) (056a0a0cdf3838794f4023e61d04a690) switched from
> RUNNING to FAILED.
> java.lang.RuntimeException: Failed to create stage bundle factory!
>    at
> org.apache.flink.python.AbstractPythonFunctionRunner.createStageBundleFactory(AbstractPythonFunctionRunner.java:197)
> ~[flink-python_2.11-1.11.1.jar:1.11.1]
>    at
> org.apache.flink.python.AbstractPythonFunctionRunner.open(AbstractPythonFunctionRunner.java:164)
> ~[flink-python_2.11-1.11.1.jar:1.11.1]
>    at
> org.apache.flink.table.runtime.runners.python.scalar.AbstractGeneralPythonScalarFunctionRunner.open(AbstractGeneralPythonScalarFunctionRunner.java:65)
> ~[flink-python_2.11-1.11.1.jar:1.11.1]
>    at
> org.apache.flink.table.runtime.operators.python.AbstractStatelessFunctionOperator$ProjectUdfInputPythonScalarFunctionRunner.open(AbstractStatelessFunctionOperator.java:186)
> ~[flink-python_2.11-1.11.1.jar:1.11.1]
>    at
> org.apache.flink.streaming.api.operators.python.AbstractPythonFunctionOperator.open(AbstractPythonFunctionOperator.java:143)
> ~[flink-python_2.11-1.11.1.jar:1.11.1]
>    at
> org.apache.flink.table.runtime.operators.python.AbstractStatelessFunctionOperator.open(AbstractStatelessFunctionOperator.java:131)
> ~[flink-python_2.11-1.11.1.jar:1.11.1]
>    at
> org.apache.flink.table.runtime.operators.python.scalar.AbstractPythonScalarFunctionOperator.open(AbstractPythonScalarFunctionOperator.java:88)
> ~[flink-python_2.11-1.11.1.jar:1.11.1]
>    at
> org.apache.flink.table.runtime.operators.python.scalar.AbstractRowDataPythonScalarFunctionOperator.open(AbstractRowDataPythonScalarFunctionOperator.java:80)
> ~[flink-python_2.11-1.11.1.jar:1.11.1]
>    at
> org.apache.flink.table.runtime.operators.python.scalar.RowDataPythonScalarFunctionOperator.open(RowDataPythonScalarFunctionOperator.java:64)
> ~[flink-python_2.11-1.11.1.jar:1.11.1]
>    at
> org.apache.flink.streaming.runtime.tasks.OperatorChain.initializeStateAndOpenOperators(OperatorChain.java:291)
> ~[flink-dist_2.11-1.11.1.jar:1.11.1]
>    at
> org.apache.flink.streaming.runtime.tasks.StreamTask.lambda$beforeInvoke$0(StreamTask.java:473)
> ~[flink-dist_2.11-1.11.1.jar:1.11.1]
>    at
> org.apache.flink.streaming.runtime.tasks.StreamTaskActionExecutor$SynchronizedStreamTaskActionExecutor.runThrowing(StreamTaskActionExecutor.java:92)
> ~[flink-dist_2.11-1.11.1.jar:1.11.1]
>    at
> org.apache.flink.streaming.runtime.tasks.StreamTask.beforeInvoke(StreamTask.java:469)
> ~[flink-dist_2.11-1.11.1.jar:1.11.1]
>    at
> org.apache.flink.streaming.runtime.tasks.StreamTask.invoke(StreamTask.java:522)
> ~[flink-dist_2.11-1.11.1.jar:1.11.1]
>    at org.apache.flink.runtime.taskmanager.Task.doRun(Task.java:721)
> [flink-dist_2.11-1.11.1.jar:1.11.1]
>    at org.apache.flink.runtime.taskmanager.Task.run(Task.java:546)
> [flink-dist_2.11-1.11.1.jar:1.11.1]
>    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_221]
> Caused by:
> org.apache.beam.vendor.guava.v26_0_jre.com.google.common.util.concurrent.UncheckedExecutionException:
> java.lang.IllegalStateException: Process died with exit code 0
>    at
> org.apache.beam.vendor.guava.v26_0_jre.com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2050)
> ~[flink-python_2.11-1.11.1.jar:1.11.1]
>    at
> org.apache.beam.vendor.guava.v26_0_jre.com.google.common.cache.LocalCache.get(LocalCache.java:3952)
> ~[flink-python_2.11-1.11.1.jar:1.11.1]
>    at
> org.apache.beam.vendor.guava.v26_0_jre.com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3974)
> ~[flink-python_2.11-1.11.1.jar:1.11.1]
>    at
> org.apache.beam.vendor.guava.v26_0_jre.com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4958)
> ~[flink-python_2.11-1.11.1.jar:1.11.1]
>    at
> org.apache.beam.vendor.guava.v26_0_jre.com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4964)
> ~[flink-python_2.11-1.11.1.jar:1.11.1]
>    at
> org.apache.beam.runners.fnexecution.control.DefaultJobBundleFactory$SimpleStageBundleFactory.<init>(DefaultJobBundleFactory.java:331)
> ~[flink-python_2.11-1.11.1.jar:1.11.1]
>    at
> org.apache.beam.runners.fnexecution.control.DefaultJobBundleFactory$SimpleStageBundleFactory.<init>(DefaultJobBundleFactory.java:320)
> ~[flink-python_2.11-1.11.1.jar:1.11.1]
>    at
> org.apache.beam.runners.fnexecution.control.DefaultJobBundleFactory.forStage(DefaultJobBundleFactory.java:250)
> ~[flink-python_2.11-1.11.1.jar:1.11.1]
>    at
> org.apache.flink.python.AbstractPythonFunctionRunner.createStageBundleFactory(AbstractPythonFunctionRunner.java:195)
> ~[flink-python_2.11-1.11.1.jar:1.11.1]
>    ... 16 more
> Caused by: java.lang.IllegalStateException: Process died with exit code 0
>    at
> org.apache.beam.runners.fnexecution.environment.ProcessManager$RunningProcess.isAliveOrThrow(ProcessManager.java:72)
> ~[flink-python_2.11-1.11.1.jar:1.11.1]
>    at
> org.apache.beam.runners.fnexecution.environment.ProcessEnvironmentFactory.createEnvironment(ProcessEnvironmentFactory.java:137)
> ~[flink-python_2.11-1.11.1.jar:1.11.1]
>    at
> org.apache.beam.runners.fnexecution.control.DefaultJobBundleFactory$1.load(DefaultJobBundleFactory.java:200)
> ~[flink-python_2.11-1.11.1.jar:1.11.1]
>    at
> org.apache.beam.runners.fnexecution.control.DefaultJobBundleFactory$1.load(DefaultJobBundleFactory.java:184)
> ~[flink-python_2.11-1.11.1.jar:1.11.1]
>    at
> org.apache.beam.vendor.guava.v26_0_jre.com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3528)
> ~[flink-python_2.11-1.11.1.jar:1.11.1]
>    at
> org.apache.beam.vendor.guava.v26_0_jre.com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2277)
> ~[flink-python_2.11-1.11.1.jar:1.11.1]
>    at
> org.apache.beam.vendor.guava.v26_0_jre.com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2154)
> ~[flink-python_2.11-1.11.1.jar:1.11.1]
>    at
> org.apache.beam.vendor.guava.v26_0_jre.com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2044)
> ~[flink-python_2.11-1.11.1.jar:1.11.1]
>    at
> org.apache.beam.vendor.guava.v26_0_jre.com.google.common.cache.LocalCache.get(LocalCache.java:3952)
> ~[flink-python_2.11-1.11.1.jar:1.11.1]
>    at
> org.apache.beam.vendor.guava.v26_0_jre.com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3974)
> ~[flink-python_2.11-1.11.1.jar:1.11.1]
>    at
> org.apache.beam.vendor.guava.v26_0_jre.com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4958)
> ~[flink-python_2.11-1.11.1.jar:1.11.1]
>    at
> org.apache.beam.vendor.guava.v26_0_jre.com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4964)
> ~[flink-python_2.11-1.11.1.jar:1.11.1]
>    at
> org.apache.beam.runners.fnexecution.control.DefaultJobBundleFactory$SimpleStageBundleFactory.<init>(DefaultJobBundleFactory.java:331)
> ~[flink-python_2.11-1.11.1.jar:1.11.1]
>    at
> org.apache.beam.runners.fnexecution.control.DefaultJobBundleFactory$SimpleStageBundleFactory.<init>(DefaultJobBundleFactory.java:320)
> ~[flink-python_2.11-1.11.1.jar:1.11.1]
>    at
> org.apache.beam.runners.fnexecution.control.DefaultJobBundleFactory.forStage(DefaultJobBundleFactory.java:250)
> ~[flink-python_2.11-1.11.1.jar:1.11.1]
>    at
> org.apache.flink.python.AbstractPythonFunctionRunner.createStageBundleFactory(AbstractPythonFunctionRunner.java:195)
> ~[flink-python_2.11-1.11.1.jar:1.11.1]
>    ... 16 more
>
>
>
>
> [hidden email]
>