I would like to start a python script with Node-red. A PDF should be generated and saved. I installed the "node-red-contrib-pythonshell" adapter and installed a corresponding Virtual Environment Path so that there is no problem with the Python libraries.
The problem.
I installed the Node-Red on my Ubuntu Touch Panel via the software manager. Everything worked except starting a Python script. There was always a "permission error".
Then i uninstalled Node-Red and reinstalled it via the terminal. It then worked perfectly.
Now I needed a connection to the ioBroker and I was missing the corresponding nodes/palettes. Then i uninstalled the Node-Red again and reinstalled it via ioBroker. Now I can also work with data points from the ioBroker.
I can run a simple python script that returns "Hello World". But as soon as I want to start the PDF Python script, a "Permission Error" comes up again (see image). If i run the Script local in PyCharm it works correctly (with the same virtual environment path).
So "user" is the user account name.
Does Node-red run as this user too?
Does it make a difference if you change your PDF output file to /tmp/nunfunktionertes.pdf?
Actually i don't know how to check, which user Node-Red is working with.
As i said, i installed Node-Red with ioBroker. Can you tell me, how i can chance the user? Is there a difference between "Terminal Install" and "ioBroker Install"?
So ls -l /tmp/nunfuntioniertes.pdf will show the user name that Node-red runs as.
I don't use ioBroker, or indeed Ubuntu so I can't answer your questions about those.
A Linux user would not generally have permission to write to another user's home directory.
I suspect that's what the problem is here, unless /tmp/nunfuntioniertes.pdf turns out to be owned by user:user, in which case I will be out of ideas.
I think you need to write the file[s] to a directory that iobroker has write permission for.
If iobroker has a home directory, can you use that?
Otherwise iobroker and user should both be members of the 'user' group. You may still need to chmod -R g+w /home/user/Schreibtisch, possibly chmod -R g+w /home/user
Maybe someone with more up to date Linux admin knowledge can confirm this?