New to Node-Red and Ubuntu but I was moving fine ... until i crashed! Hope that you can help me clarify an issue that has been torturing me for a couple of days:
The Intended Flow that is not working: [Inject node] sends “hello…” string → [Exec node] calls Python3 script and passes the payload as parameter - This returns a JSON string → [Debug node] shows the JSON string returned from Exec node.
The issue - Exec node returns permission error:
Command failed: python3 /home/alex/ac_work/python3/p3_test_1.py "Parameter-1"
python3: can't open file '/home/alex/ac_work/python3/p3_test_1.py': [Errno 13] Permission denied
1 - If I go to Terminal and type the command used in the “exec” node, the script runs properly. It takes the parameter and returns the JSON string. No issues.
2 - The directory where the python3 script is at has the following permissions:
alex@alex-FX6860:~/ac_work/python3$ ls -l
-rw-r--r-- 1 root root 14 Jun 8 20:10 nodered_created_file2.txt
-rwxrwxrw- 1 alex ac_nodered 422 Jun 8 16:15 p3_test_1.py
3 - I created a simple output to file using the [File node], and the “nodered_created_file2.txt” got created. Notice that it has “root” as both owner and group.
4 - Created a Group called ac_nodered (users alex and root), and this is the Gropu in the directory where the python script resides.
5 - Environment: Node-Red 1.0.6 running on Ubuntu 18.04.4 LTS, and started from the browser as URL http://127.0.0.1:1880/
Why is that this happens when, it appears that Node-RED is executing as root (all the reach of root), and also, root is one of the users in the group ac_nodered that has "rwx" in that directory?
Any help will be greatly appreciated. Rgds,Alex