You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Chesnay Schepler (JIRA)" <ji...@apache.org> on 2018/11/19 10:20:00 UTC

[jira] [Closed] (FLINK-10925) NPE in PythonPlanStreamer

     [ https://issues.apache.org/jira/browse/FLINK-10925?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chesnay Schepler closed FLINK-10925.
------------------------------------
       Resolution: Fixed
    Fix Version/s: 1.7.0
                   1.6.3
                   1.5.6

master: de9a5697c42c34de4d3d7594fea50a4c5c7aba7c
1.7: 96e790a48ab2c9feba3a440fbb44862bc220ca89
1.6: 58d00310f23f253f0fceb8d91378aad78ca022da
1.5: ff9e06b56edc35f8d4db2af760336df4a7d317d5

> NPE in PythonPlanStreamer
> -------------------------
>
>                 Key: FLINK-10925
>                 URL: https://issues.apache.org/jira/browse/FLINK-10925
>             Project: Flink
>          Issue Type: Bug
>          Components: Python API
>    Affects Versions: 1.5.5, 1.6.2, 1.7.0
>            Reporter: Karel Kolman
>            Assignee: Karel Kolman
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.5.6, 1.6.3, 1.7.0
>
>
> Encountered the following issue while testing Python Batch API:
> {noformat}
> root@a0810aa4b51b:/opt/flink# ./bin/pyflink.sh examples/python/batch/WordCount.py  -
> Starting execution of program
> Failed to run plan: null
> The program didn't contain a Flink job. Perhaps you forgot to call execute() on the execution environment.
> {noformat}
> with logs containing the following stacktrace:
> {noformat}
> 2018-11-19 09:11:51,036 ERROR org.apache.flink.python.api.PythonPlanBinder                  - Failed to run plan.
> java.lang.NullPointerException
>         at org.apache.flink.python.api.streaming.plan.PythonPlanStreamer.close(PythonPlanStreamer.java:129)
>         at org.apache.flink.python.api.PythonPlanBinder.runPlan(PythonPlanBinder.java:201)
>         at org.apache.flink.python.api.PythonPlanBinder.main(PythonPlanBinder.java:98)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:498)
>         at org.apache.flink.client.program.PackagedProgram.callMainMethod(PackagedProgram.java:529)
>         at org.apache.flink.client.program.PackagedProgram.invokeInteractiveModeForExecution(PackagedProgram.java:421)
>         at org.apache.flink.client.program.ClusterClient.run(ClusterClient.java:426){noformat}
> My root cause was not having Python installed on the docker image being used.
> Patching Flink with 
> {noformat}
> diff --git a/flink-libraries/flink-python/src/main/java/org/apache/flink/python/api/streaming/plan/PythonPlanStreamer.java b/flink-libraries/flink-python/src/main/java/org/apache/flink/python/api/streaming/plan/PythonPlanStreamer.java
> index d25f3d51ff..3e6a068d8a 100644
> --- a/flink-libraries/flink-python/src/main/java/org/apache/flink/python/api/streaming/plan/PythonPlanStreamer.java
> +++ b/flink-libraries/flink-python/src/main/java/org/apache/flink/python/api/streaming/plan/PythonPlanStreamer.java
> @@ -126,7 +126,9 @@ public class PythonPlanStreamer {
>                         process.destroy();
>                 } finally {
>                         try {
> -                               server.close();
> +                               if (server != null) {
> +                                       server.close();
> +                               }
>                         } catch (IOException e) {
>                                 LOG.error("Failed to close socket.", e);
>                         }
> {noformat}
> an attempt to run Python Batch API example will fail with
> {noformat}
> root@33837d1efa28:/opt/flink# ./bin/pyflink.sh examples/python/batch/WordCount.py -
> Starting execution of program
> Failed to run plan: python does not point to a valid python binary.
> The program didn't contain a Flink job. Perhaps you forgot to call execute() on the execution environment
> {noformat}
> which correctly identifes the problem i was facing - missing python (or incorrect python bin path).



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)