dejanrizvan / node-red-contrib-python3-function

MIT License
9 stars 6 forks source link

Crashes Node-red #13

Open noafterglow opened 1 year ago

noafterglow commented 1 year ago

This is probably a setup issue, but I suspect that there needs to be some better error recovery.

Ubuntu 22.04.3 LTS node-red V3.1.0

Adding the default node, which just passes the message through crashes node red with the following output:


20 Oct 12:11:47 - [info] Updated flows
20 Oct 12:11:47 - [info] Starting flows
20 Oct 12:11:47 - [info] [python3-function:6f783327e114aa5d] Python function '' running on PID undefined
20 Oct 12:11:47 - [info] Started flows
20 Oct 12:11:47 - [red] Uncaught Exception:
20 Oct 12:11:47 - [error] Error: spawn python ENOENT
    at ChildProcess._handle.onexit (node:internal/child_process:286:19)
    at onErrorNT (node:internal/child_process:484:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
noafterglow commented 1 year ago

This is caused by the code looking for "python" and not "python3". HOWEVER. It is also a bug, as the exception is not caught and not properly reported.

I was able to fix it by installing

sudo apt install python-is-python3

This is NOT the preferred method of fixing this issue however, and it should be fixed in the code.