PermissionError: [Errno 13] Permission denied: '/home/user/ - PythonScript

Hello Node-Red Community

I am a beginner.

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).

I've also tried chmod 777 /home/user

And this command: ls -ld /home/user
Get:
drwxrwxrwx 29 user user 4096 Mai 28 12:48 /home/user

Can you Help me?

P.S Sorry for my bad Englisch..

Kind regards
Cyrill

What do ls -l /home/user/Schreibtisch and ls -l /home/user/Schreibtisch/test show?

hi jbudd

thanks for your answer.

these are the result ..

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"?

These are the Settings in ioBroker for Node-Red.

In fact /tmp/nunfuntioniertes.pdf works!!

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.

thanks a lot!

actually by installing iobroker, there was possibly created a user iobroker.

now i have to add the permissions for the user: iobroker, right?

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?

Hello jbudd

Thanks for your support. Now i know the Problem, but it's allready not solved. I will inquire in a linux forum.

Cheers