# Node-RED Deploy failed with EACCES:permission denied

**URL:** <https://discourse.nodered.org/t/node-red-deploy-failed-with-eacces-permission-denied/749>\
**Category:** General\
**Created:** [11 June 2018 22:35 UTC](https://discourse.nodered.org/t/node-red-deploy-failed-with-eacces-permission-denied/749 "2018-06-11T22:35:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![IoTPlay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/iotplay/32/40_2.png) [@IoTPlay](https://discourse.nodered.org/u/IoTPlay)\
**Post date:** [11 June 2018 22:35 UTC](https://discourse.nodered.org/t/node-red-deploy-failed-with-eacces-permission-denied/749/1 "2018-06-11T22:35:52Z")

</div>

Hi, have a new problem that creaped up with Projects, after deploying the project, and on Deploying a change, I get:

```auto
Node-RED Deploy failed: 
{"error";"EACCES","message", "EACCES:permission denied,   
rename '/data/projects/master/flows.json' ->   
 '/data/projects/master/flows.json.backup'"}

```

And here is the server logfile:

```auto
11 Jun 22:39:14 - [warn] Error saving flows: EACCES: permission denied, rename '/data/projects/master/flows.json' -> '/data/projects/master/.flows.json.backup'
11 Jun 22:39:14 - [warn] Error: EACCES: permission denied, rename '/data/projects/master/flows.json' -> '/data/projects/master/.flows.json.backup'
    at Object.fs.renameSync (fs.js:714:3)
    at Object.writeFile (/usr/src/iotp/node_modules/node-red/red/runtime/storage/localfilesystem/util.js:84:20)
    at Object.saveFlows (/usr/src/iotp/node_modules/node-red/red/runtime/storage/localfilesystem/projects/index.js:558:17)
    at /usr/src/iotp/node_modules/node-red/red/runtime/storage/index.js:95:38
    at tryCatchReject (/usr/src/iotp/node_modules/when/lib/makePromise.js:845:30)
    at runContinuation1 (/usr/src/iotp/node_modules/when/lib/makePromise.js:804:4)
    at Fulfilled.when (/usr/src/iotp/node_modules/when/lib/makePromise.js:592:4)
    at ContinuationTask.run (/usr/src/iotp/node_modules/when/lib/makePromise.js:702:24)
    at Scheduler._drain (/usr/src/iotp/node_modules/when/lib/Scheduler.js:62:19)
    at Scheduler.drain (/usr/src/iotp/node_modules/when/lib/Scheduler.js:27:9)
    at process._tickCallback (internal/process/next_tick.js:61:11)

```

I assume the Node-RED server does not think it has access to that folder, but it seams it has. Any ideas where to look?

Btw, the Node-Red server is a Docker instance, my own creation.  
The Docker instance runs the code in `/usr/src/iotp` this is mapped in volumes.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [12 June 2018 19:22 UTC](https://discourse.nodered.org/t/node-red-deploy-failed-with-eacces-permission-denied/749/2 "2018-06-12T19:22:43Z")

</div>

> [@IoTPlay](#):
>
> I assume the Node-RED server does not think it has access to that folder, but it seams it has. Any ideas where to look?

I imagine it is not so much that the server thinks it does not have access, but that it actually does not have access. Are you sure the user running node-red has write access to that folder and file?

---

<div class="post-metadata">

**Author:** ![IoTPlay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/iotplay/32/40_2.png) [@IoTPlay](https://discourse.nodered.org/u/IoTPlay)\
**Post date:** [1 July 2018 16:48 UTC](https://discourse.nodered.org/t/node-red-deploy-failed-with-eacces-permission-denied/749/4 "2018-07-01T16:48:13Z")

</div>

Thank you Colin, yes, you are correct, I create my RPi with Ansible, created a new host, and forgot to bring the user details accross which my templates use to create the user, as consequence the user did not have the right permissions. Apologies !

---

<div class="post-metadata">

**Author:** ![karlwooster](https://avatars.discourse-cdn.com/v4/letter/k/9de053/32.png) [@karlwooster](https://discourse.nodered.org/u/karlwooster)\
**Post date:** [27 September 2018 06:15 UTC](https://discourse.nodered.org/t/node-red-deploy-failed-with-eacces-permission-denied/749/5 "2018-09-27T06:15:25Z")

</div>

I may be being obtuse, but how in the world would I even go about checking this? I'm trying to bind-mount a directory on my host (/opt/appdata/nodered/data:/data), but the official node-red-docker Dockerfile appears to create its own user "node-red". How in the world am I supposed to make it possible for the container to copy things into that directory? Every answer I find has a vague reference to "user that node-red is running as". I guess I don't know what that means. I run the docker-compose as root and set PUID and GUID both as 1000, what more can I do?

---

<div class="post-metadata">

**Author:** ![IoTPlay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/iotplay/32/40_2.png) [@IoTPlay](https://discourse.nodered.org/u/IoTPlay)\
**Post date:** [27 September 2018 14:02 UTC](https://discourse.nodered.org/t/node-red-deploy-failed-with-eacces-permission-denied/749/6 "2018-09-27T14:02:22Z")

</div>

Took me a while to solve it.

> **[IoTPlay/docker\_nodered](https://github.com/IoTPlay/docker_nodered)**
>
> Docker NodeRed image, with settings to interop with iotplay - IoTPlay/docker\_nodered

---

<div class="post-metadata">

**Author:** ![IoTPlay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/iotplay/32/40_2.png) [@IoTPlay](https://discourse.nodered.org/u/IoTPlay)\
**Post date:** [27 September 2018 14:10 UTC](https://discourse.nodered.org/t/node-red-deploy-failed-with-eacces-permission-denied/749/7 "2018-09-27T14:10:11Z")

</div>

See the dockerfile (I build them with Ansible) - but you will get the idea of how to solve the uid problem.

> <https://github.com/IoTPlay/docker_nodered/blob/master/Dockerfile_arm>
