While running a workflow on a distant server, an error occured :
raise Py4JError(
py4j.protocol.Py4JError: An error occurred while calling GATEWAY_SERVER.getCallbackClient. Trace:
Object ID unknown
ERROR KNIME-Worker-10-Python Script 3:1256 Node Execute failed: An exception occured while running the Python kernel. See log for details.
org.knime.python2.kernel.PythonIOException: An exception occured while running the Python kernel. See log for details.
at org.knime.python2.kernel.PythonKernelQueue$KeyedPooledPythonKernelFactory.createKernel(PythonKernelQueue.java:411)
at org.knime.python2.kernel.PythonKernelQueue$KeyedPooledPythonKernelFactory.populateHolder(PythonKernelQueue.java:396)
at org.knime.python2.kernel.PythonKernelQueue$KeyedPooledPythonKernelFactory.passivateObject(PythonKernelQueue.java:390)
at org.knime.python2.kernel.PythonKernelQueue$KeyedPooledPythonKernelFactory.passivateObject(PythonKernelQueue.java:1)
at org.apache.commons.pool2.impl.GenericKeyedObjectPool.returnObject(GenericKeyedObjectPool.java:483)
at org.knime.python2.kernel.PythonKernelQueue.lambda$1(PythonKernelQueue.java:318)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.net.ConnectException: Could not connect to the Python process.
at org.knime.python3.DefaultPythonGateway.waitForConnection(DefaultPythonGateway.java:261)
at org.knime.python3.DefaultPythonGateway.(DefaultPythonGateway.java:192)
at org.knime.python3.DefaultPythonGateway.create(DefaultPythonGateway.java:144)
at org.knime.python3.scripting.Python3KernelBackend.(Python3KernelBackend.java:291)
at org.knime.python3.scripting.Python3KernelBackend.(Python3KernelBackend.java:240)
at org.knime.python3.scripting.Python3KernelBackendFactory.createBackend(Python3KernelBackendFactory.java:70)
at org.knime.python2.kernel.PythonKernelQueue$KeyedPooledPythonKernelFactory.createKernel(PythonKernelQueue.java:407)
⌠6 more
May 12, 2023 4:07:31 PM org.apache.cxf.bus.osgi.CXFExtensionBundleListener unregister
I am not sure how to solve this with KNIME. I was thinking to assign more RAM, but I do not know if it could solve the problem. However, it does not seem that my workflow has a problem about python code I am using and so on. I am doing some parameters optimization with this workflow, so it takes a long time to complete the execution. I never saw this kind of error when it runs on my own laptop.
Could you please say the version of the KNIME AP you are using and confirm if you are using the most recent version of the Python Script node? Also, can you share the KNIME log file and either the script or a sample workflow? This will help us further investigate the issue.
I forgot to tell that I get this error when I execute it with command line. However, it do not seem that I get this error when I execute the wokflow with the graphical interface. But I have to do it by command line.
The error do not occur directly after executing workflows. The error do not seem to appear at a specific moment. It can takes few minutes like 1 hour before the error occur. It seem to be random.
I think the error seem to appear at âpython scriptâ nodes.
Since I do not have access to the input files, I am not able to investigate further, can you share a dummy workflow with some data which is not sensitive? Also, can you share the KNIME log file at the time of the error?
This is a sample of my workflow with a small amount of data. This workflow only contains the âoptimizationâ section, it should be enough. I can add more data otherwise if needed.
Youâll need to add extra libraries in order to run it :
umap-learn 0.5.3
scikit-learn-extra 0.3.0
pytwed 1.0.9
yellowbrick 1.5
I think I listed them all. Tell me if there are any errors not related to what I sent you previously.
The error seem to be related to port availability when python nodes are executed. I didnât seen theses errors on my own laptop for now, only on the distant server. Thanks a lot.
I noticed you are using the brute force strategy for optimization, I tried running the workflow in âbayesian optimizationâ strategy, there was no issue until one of the python scripts (embed = nbook.get_umap_dimensions(df, nu, lmbda, y_axis_type)) failed with the below issue :
TypeError: Cannot use scipy.linalg.eigh for sparse A with k >= N. Use scipy.linalg.eigh(A.toarray()) or reduce k.