ERROR: EACCES: permission denied

Hi there!

I’ve just wanted to do write some binary file according to my current level 2 course (Workflow 2 - n8n Documentation).

Sadly I get this error message on the “Write Binary File” node:

Error: EACCES: permission denied, open 'report_orderID_rec73SsBAUtcdov0Z.json'

I’m running a self hosted instance via docker compose on a Synology NAS (just in case that’s important for trouble shooting).

Everything else I’ve tried so far worked without issues. Any help would be really much appreciated.


1 Like

Hey @svzi,

Looks like it is permission issue with the path, Try setting a path and adding the filename to the end of it. On Docker using /tmp/filename.json should work.

Awesome, that works @Jon !

Any idea on how to really fix my permission issues with the path? Anything I could look onto, based on your experience?

I suspect it will be trying to write to /data/filepath.json which would be owned by root and not the node user, If you add an execute command node you can try running the commands below one at a time to find out what the working directory is, What user you are and then try to make an empty file which will likely return the same error.

touch file.txt

This is the output from each command:

  "exitCode": 0,
  "stderr": "",
  "stdout": "/data"
  "exitCode": 0,
  "stderr": "",
  "stdout": "node"
ERROR: Command failed: touch file.txt touch: file.txt: Permission denied

It’s not the very same error reported, but it’s a permission error as well and could possible be the same. What can I do to fix it? From my understanding the user inside the docker container doesn’t need to exist on the host, or am I wrong about that?

Hey @svzi,

There isn’t really anything to fix there, So the /data directory will be owned by root and we don’t recommend storing data there. Normally we would suggest mapping a volume from the host to the container so that your data can be retrieved if needed it also gives you some space to work with files.

Hey @Jon ,

I’ve already mapped some volumes from my host to the container:

      - /var/run/docker.sock:/var/run/docker.sock
      - ./data/.n8n:/home/node/.n8n

Can I add an additional mapping to avoid needing the path prefixing with /tmp/?

Hey @svzi,

I wouldn’t mess with the /data path so it could be worth just adding another mapping like…

- ./data/files:/files

Then you can prefix the path with /files/, You could try messing around with the permissions inside the container to change the owner of the /data folder but it is probably best to avoid that as an upgrade would likely revert it so the volume will be safer.


Thanks @Jon , I’ll give it a try! :slight_smile:

1 Like

Hmm, applied chown 1000:1000 and chmod 777 to the files directory in the docker container but id hasn’t helped :slight_smile:

ERROR: UNKNOWN ERROR - check the detailed error for more information

Hey @organicnz,

Can you open a new thread and complete the template provided so we can learn more about your setup and the error you are seeing.

1 Like