# Node-red version 4.09 no file access to my revolution pi directories

**URL:** <https://discourse.nodered.org/t/node-red-version-4-09-no-file-access-to-my-revolution-pi-directories/96971>\
**Category:** General\
**Created:** [8 May 2025 14:39 UTC](https://discourse.nodered.org/t/node-red-version-4-09-no-file-access-to-my-revolution-pi-directories/96971 "2025-05-08T14:39:08Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![tim26](https://avatars.discourse-cdn.com/v4/letter/t/e0b2c6/32.png) [@tim26](https://discourse.nodered.org/u/tim26)\
**Post date:** [8 May 2025 14:39 UTC](https://discourse.nodered.org/t/node-red-version-4-09-no-file-access-to-my-revolution-pi-directories/96971/1 "2025-05-08T14:39:08Z")

</div>

Hi,  
I installed an existing and working node-red flow on a new revolution pi with node-red 4.09.  
The node-red creates using a pdfmake node a file on the pi. Now I allways get errors because node-red has no access to my directories. I proofed everything with the bash commands and in debian everything is ok. I can read and write all directories with the pi user.  
Node-red runs also under pi user but says "no permission".  
What can I do?  
It seems node-red overrides the debian pemissions or changes my path???

Thanks in advance for your help

Tim

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [8 May 2025 14:43 UTC](https://discourse.nodered.org/t/node-red-version-4-09-no-file-access-to-my-revolution-pi-directories/96971/2 "2025-05-08T14:43:49Z")

</div>

Are you using Docker?

---

<div class="post-metadata">

**Author:** ![lukjasin](https://avatars.discourse-cdn.com/v4/letter/l/90db22/32.png) [@lukjasin](https://discourse.nodered.org/u/lukjasin)\
**Post date:** [8 May 2025 21:47 UTC](https://discourse.nodered.org/t/node-red-version-4-09-no-file-access-to-my-revolution-pi-directories/96971/3 "2025-05-08T21:47:05Z")

</div>

Hey,

This might be a problem with the working directory that node-red is using. Even if it runs as the pi user, when it’s started by systemd, it can run from a different folder like /var/lib/node-red instead of /home/pi.

Try checking what folder node-red is actually working in, for example, by using a function or exec node to run pwd.

Also, try using a full path when saving the file, like:  
/home/pi/Documents/output.pdf  
instead of just output.pdf because node-red might be trying to save it in a place where it doesn’t have permission.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [9 May 2025 09:04 UTC](https://discourse.nodered.org/t/node-red-version-4-09-no-file-access-to-my-revolution-pi-directories/96971/4 "2025-05-09T09:04:48Z")

</div>

Did you install via Dave's Pi/Debian installer script? If so, you will be running Node-RED using systemd. What permissions and path Node-RED will get come from the systemd startup script.

Typically, I believe the script creates a separate user for Node-RED? Can't remember as I don't use it myself. But the path environment variable will not be the same as when you log into the Pi user since interactive logins get their path from shell/bash startup scripts.

Path should not impact access to folders however.

Depending on what you want to do with the PDF once you've created it, you could try using the `/tmp` folder which should be writable by all users (obviously check that it exists first).

---

<div class="post-metadata">

**Author:** ![tim26](https://avatars.discourse-cdn.com/v4/letter/t/e0b2c6/32.png) [@tim26](https://discourse.nodered.org/u/tim26)\
**Post date:** [10 May 2025 11:41 UTC](https://discourse.nodered.org/t/node-red-version-4-09-no-file-access-to-my-revolution-pi-directories/96971/5 "2025-05-10T11:41:32Z")

</div>

Hi everybody,

thank you for your answers.

I made an exec node and put 'pwd' in and now i know the working directory is '/var/lib/revpi-nodered'. Thanks to lukjasin! This directory is open to read and write.

But when i try to do this in '/home/pi' I have no permission in node-red. In bash on debian I have permission.

When I put a sudo in front e.g. 'sudo mkdir /home/test' I get a failure: the switch new privileges is set to on you can not act as root  
it seems node-red is runnimg in a container

now where can I change this switch and how can I do this? It is no docker container.

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [10 May 2025 11:57 UTC](https://discourse.nodered.org/t/node-red-version-4-09-no-file-access-to-my-revolution-pi-directories/96971/6 "2025-05-10T11:57:21Z")

</div>

> [@tim26](#):
>
> it seems node-red is runnimg in a container

Are you stating this as a fact or is it your guess at the cause of the problem (which might be correct) ?

> [@tim26](#):
>
> It is no docker container.

Sorry but are you affirming that you are not running docker?  
What sort of container might it be?

> [@tim26](#):
>
> I made an exec node and put 'pwd' in and now i know the working directory is '/var/lib/revpi-nodered'

This looks very wrong to me.  
How did you install Node-red?  
What user account did you use to install it?

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [10 May 2025 12:15 UTC](https://discourse.nodered.org/t/node-red-version-4-09-no-file-access-to-my-revolution-pi-directories/96971/7 "2025-05-10T12:15:26Z")

</div>

> [@tim26](#):
>
> the working directory is '/var/lib/revpi-nodered'.

This is an odd, non-standard location and would have required root/sudo to install there I think. `/var/lib` sub-folders should not, I think, be used as live folders, they are system folders AFAIK.

Actually, thinking about it and having tested my own install, I think that having the working directory as the Node-RED installation folder should be considered a BUG. I'll raise a separate thread to have it discussed.

Anyway, the location is non-standard but does not look like a container folder and does not look like a standard `npm` or Dave's script install either. So to sort this out, as jbudd has asked, we need to know how Node-RED is installed. Without that information, I doubt we can help much more.

---

<div class="post-metadata">

**Author:** ![tim26](https://avatars.discourse-cdn.com/v4/letter/t/e0b2c6/32.png) [@tim26](https://discourse.nodered.org/u/tim26)\
**Post date:** [10 May 2025 14:07 UTC](https://discourse.nodered.org/t/node-red-version-4-09-no-file-access-to-my-revolution-pi-directories/96971/8 "2025-05-10T14:07:05Z")

</div>

Hi everybody,  
it is an industry automation system based on raspberry pi 4 debian 12 bookworm with a preinstalled node-red 4.09.  
Thats the reason I don't know how it was installed.

Maybe I'll try in the kunbus forum, they'll know how it was istalled.

thanks for your help!

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [10 May 2025 14:18 UTC](https://discourse.nodered.org/t/node-red-version-4-09-no-file-access-to-my-revolution-pi-directories/96971/9 "2025-05-10T14:18:20Z")

</div>

If you have access to the settings.js file, you should be able to reset the working folder to something more sensible as Node-RED starts up.

But overall, I would suggest raising a bug with the vendor of the system.

I've also raised a suggestion for Node-RED itself to take better control - we will see if that gets any traction with the core devs.

---

<div class="post-metadata">

**Author:** ![lukjasin](https://avatars.discourse-cdn.com/v4/letter/l/90db22/32.png) [@lukjasin](https://discourse.nodered.org/u/lukjasin)\
**Post date:** [12 May 2025 08:34 UTC](https://discourse.nodered.org/t/node-red-version-4-09-no-file-access-to-my-revolution-pi-directories/96971/10 "2025-05-12T08:34:58Z")

</div>

> [@tim26](#):
>
> I made an exec node and put 'pwd' in and now i know the working directory is '/var/lib/revpi-nodered'. Thanks to lukjasin! This directory is open to read and write.
> 
> But when i try to do this in '/home/pi' I have no permission in node-red. In bash on debian I have permission.

It’s possible that Node-RED is running under a different user than pi, depending on how the systemd service was configured. That could explain why it doesn’t have permission to write to /home/pi, even though everything works fine from the terminal.

Here’s a simple way to check and fix that. Find which process (with "red" in the name) is running Node-RED and under which user:

```auto
ps aux | grep -i red | grep -v grep

```

Look at the first column, that’s the user actually running Node-RED. If it’s not pi, that’s likely the issue.

Find the service file used to start Node-RED.Check the folder:

```auto
ls /etc/systemd/system

```

Look for something like nodered.service or revpi-nodered.service.

Edit the service file (replace the filename if it’s different):

```auto
sudo nano /etc/systemd/system/nodered.service

```

At the top (under Service), make sure it contains:

```auto
[Service]
User=pi
Group=pi
WorkingDirectory=/home/pi

```

Reload systemd and restart the service:

```auto
sudo systemctl daemon-reexec
sudo systemctl restart nodered

```

After that, Node-RED should be running as pi and have full access to /home/pi.

I’m assuming your system uses systemd to manage services. To confirm that, you can run:

```auto
ps -p 1 -o comm=

```

If the output is systemd, you’re good to go. If it’s something else, let us know and we’ll find another way to get it working.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [10 August 2025 08:35 UTC](https://discourse.nodered.org/t/node-red-version-4-09-no-file-access-to-my-revolution-pi-directories/96971/11 "2025-08-10T08:35:54Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
