Xuannan Su created FLINK-26171:
----------------------------------

             Summary: pyFlink -py options has issue with path that starts with 
//
                 Key: FLINK-26171
                 URL: https://issues.apache.org/jira/browse/FLINK-26171
             Project: Flink
          Issue Type: Bug
          Components: API / Python
    Affects Versions: 1.14.3
            Reporter: Xuannan Su


It seems that when submitting a pyFlink job with the `flink run` command, the 
-py option has issues with a path that start with double slash "//". 

You can reproduce the problem with the wordcount python example.


{code:bash}
# Job successfully submitted
./bin/flink run -py "${PWD}"/examples/python/datastream/word_count.py
Job has been submitted with JobID 54ab79a32b4e441ee80bda92be7cb547

# Fail to submit the job if the path start with double slash
./bin/flink run -py /"${PWD}"/examples/python/datastream/word_count.py
org.apache.flink.client.program.ProgramAbortException: 
java.nio.file.NoSuchFileException: 
/var/folders/j4/td7bvghd1tg4tb7ty_7lk6z00000gp/T/pyflink/1bba3878-9ed4-4d4e-a5ed-1208c1ee9425/c9ece3de-8ff2-40dc-8436-e3377e540baf/word_count.py
        at 
org.apache.flink.client.python.PythonDriver.main(PythonDriver.java:140)
        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:355)
        at 
org.apache.flink.client.program.PackagedProgram.invokeInteractiveModeForExecution(PackagedProgram.java:222)
        at 
org.apache.flink.client.ClientUtils.executeProgram(ClientUtils.java:114)
        at 
org.apache.flink.client.cli.CliFrontend.executeProgram(CliFrontend.java:812)
        at org.apache.flink.client.cli.CliFrontend.run(CliFrontend.java:246)
        at 
org.apache.flink.client.cli.CliFrontend.parseAndRun(CliFrontend.java:1054)
        at 
org.apache.flink.client.cli.CliFrontend.lambda$main$10(CliFrontend.java:1132)
        at 
org.apache.flink.runtime.security.contexts.NoOpSecurityContext.runSecured(NoOpSecurityContext.java:28)
        at org.apache.flink.client.cli.CliFrontend.main(CliFrontend.java:1132)
Caused by: java.nio.file.NoSuchFileException: 
/var/folders/j4/td7bvghd1tg4tb7ty_7lk6z00000gp/T/pyflink/1bba3878-9ed4-4d4e-a5ed-1208c1ee9425/c9ece3de-8ff2-40dc-8436-e3377e540baf/word_count.py
        at 
sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)
        at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
        at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
        at sun.nio.fs.UnixPath.toRealPath(UnixPath.java:837)
        at 
org.apache.flink.client.python.PythonEnvUtils.addToPythonPath(PythonEnvUtils.java:278)
        at 
org.apache.flink.client.python.PythonEnvUtils.preparePythonEnvironment(PythonEnvUtils.java:195)
        at 
org.apache.flink.client.python.PythonEnvUtils.launchPy4jPythonClient(PythonEnvUtils.java:456)
        at 
org.apache.flink.client.python.PythonDriver.main(PythonDriver.java:92)
        ... 13 more

# Job successfully submitted if path starts with three slash
./bin/flink run -py //"${PWD}"/examples/python/datastream/word_count.py
Job has been submitted with JobID 270d07407b297b566c6903c451a834cb
{code}




--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to