Issue running Python Executor Step Pentaho

107 views Asked by At

1

I'm having trouble trying to run a python script using Pentaho, using the Python executor step. I have a test script that runs a simple "Hello World", just to test if I could use the step. I have installed all the relevant libraries. I have never used this step before so I am not sure if Im missing anything or doing anything wrong. I noticed the *"Caused by: java.net.SocketException: Connection reset" * but I have no idea how to fix it .This is the error it throws when I run the transformation.

2023/12/18 17:55:24 - Python Executor.0 - ERROR (version 9.3.0.0-428, build 9.3.0.0-428 from 2022-04-12 04.56.25 by buildguy) : Unexpected error
2023/12/18 17:55:24 - Python Executor.0 - ERROR (version 9.3.0.0-428, build 9.3.0.0-428 from 2022-04-12 04.56.25 by buildguy) : java.lang.IllegalStateException: py4j.Py4JException: Error while sending a command.
2023/12/18 17:55:24 - Python Executor.0 -   at com.pentaho.di.trans.steps.pythonexecutor.PythonExecutor.executeScript(PythonExecutor.java:439)
2023/12/18 17:55:24 - Python Executor.0 -   at com.pentaho.di.trans.steps.pythonexecutor.PythonExecutor.handleRowAndHasNext(PythonExecutor.java:295)
2023/12/18 17:55:24 - Python Executor.0 -   at com.pentaho.di.trans.steps.pythonexecutor.PythonExecutor.processRow(PythonExecutor.java:266)
2023/12/18 17:55:24 - Python Executor.0 -   at org.pentaho.di.trans.step.RunThread.run(RunThread.java:62)
2023/12/18 17:55:24 - Python Executor.0 -   at java.base/java.lang.Thread.run(Thread.java:829)
2023/12/18 17:55:24 - Python Executor.0 - Caused by: py4j.Py4JException: Error while sending a command.
2023/12/18 17:55:24 - Python Executor.0 -   at py4j.CallbackClient.sendCommand(CallbackClient.java:397)
2023/12/18 17:55:24 - Python Executor.0 -   at py4j.CallbackClient.sendCommand(CallbackClient.java:356)
2023/12/18 17:55:24 - Python Executor.0 -   at py4j.reflection.PythonProxyHandler.invoke(PythonProxyHandler.java:106)
2023/12/18 17:55:24 - Python Executor.0 -   at com.sun.proxy.$Proxy117.runScript(Unknown Source)
2023/12/18 17:55:24 - Python Executor.0 -   at com.pentaho.python.PythonGateway.runScript(PythonGateway.java:120)
2023/12/18 17:55:24 - Python Executor.0 -   at com.pentaho.python.GatewayCommand.runScript(GatewayCommand.java:126)
2023/12/18 17:55:24 - Python Executor.0 -   at com.pentaho.di.trans.steps.pythonexecutor.PythonExecutor.executeScript(PythonExecutor.java:429)
2023/12/18 17:55:24 - Python Executor.0 -   ... 4 more
2023/12/18 17:55:24 - Python Executor.0 - Caused by: py4j.Py4JNetworkException: Error while sending a command: c
t
runScript
ao2
ao3
ao4
snone
ao5
svar
bfalse
s\r\nprint("Hello, World!")
lo6
bfalse
sC:\\Users\\mohlm012\\AppData\\Local\\Temp\\python_executor13348245052999835220
e

2023/12/18 17:55:24 - Python Executor.0 -   at py4j.CallbackConnection.sendCommand(CallbackConnection.java:153)
2023/12/18 17:55:24 - Python Executor.0 -   at py4j.CallbackClient.sendCommand(CallbackClient.java:384)
2023/12/18 17:55:24 - Python Executor.0 -   ... 10 more
2023/12/18 17:55:24 - Python Executor.0 - Caused by: java.net.SocketException: Connection reset
2023/12/18 17:55:24 - Python Executor.0 -   at java.base/java.net.SocketInputStream.read(SocketInputStream.java:186)
2023/12/18 17:55:24 - Python Executor.0 -   at java.base/java.net.SocketInputStream.read(SocketInputStream.java:140)
2023/12/18 17:55:24 - Python Executor.0 -   at java.base/sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:284)
2023/12/18 17:55:24 - Python Executor.0 -   at java.base/sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326)
2023/12/18 17:55:24 - Python Executor.0 -   at java.base/sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)
2023/12/18 17:55:24 - Python Executor.0 -   at java.base/java.io.InputStreamReader.read(InputStreamReader.java:181)
2023/12/18 17:55:24 - Python Executor.0 -   at java.base/java.io.BufferedReader.fill(BufferedReader.java:161)
2023/12/18 17:55:24 - Python Executor.0 -   at java.base/java.io.BufferedReader.readLine(BufferedReader.java:326)
2023/12/18 17:55:24 - Python Executor.0 -   at java.base/java.io.BufferedReader.readLine(BufferedReader.java:392)
2023/12/18 17:55:24 - Python Executor.0 -   at py4j.CallbackConnection.readBlockingResponse(CallbackConnection.java:169)
2023/12/18 17:55:24 - Python Executor.0 -   at py4j.CallbackConnection.sendCommand(CallbackConnection.java:148)
2023/12/18 17:55:24 - Python Executor.0 -   ... 11 more

I tried using a python virtual environment with no success. I want the step to produce output in this case "Hello World"

0

There are 0 answers