Subject: Persistent EACCES Permission Denied on n8n Deployment with Volume

almoustashar
FREE

6 days ago

Hello Railway Team,

I am experiencing a persistent deployment issue with the n8n template and hope you can provide some insight.

1. Goal: To deploy the scalable n8n template (main + worker + postgres + redis) with a persistent volume attached to the main n8n service at the mount path /home/node/.n8n.

2. The Problem: The main n8n service is stuck in a crash-loop. The logs consistently show the following error, indicating a file system permission issue:

Error: EACCES: permission denied, open '/home/node/.n8n/config'

3. Troubleshooting Steps Taken: We have tried multiple advanced solutions to resolve this, but the issue persists:

  • Attempt 1: Basic Dockerfile: We deployed from a GitHub repo with a Dockerfile that uses USER root and RUN chown -R node:node /home/node/.n8n. The error continued.

  • Attempt 2: Advanced Entrypoint Script: We created a custom entrypoint.sh script to run chown -R node:node /home/node/.n8n every time the container starts, then execute the n8n process. The Dockerfile was updated to use this entrypoint. Despite this, the EACCES error remains.

Conclusion: It seems that the way volumes are mounted at runtime is overriding any permission changes made during the image build or at the start of the container via an entrypoint script. The node user inside the container cannot get write access to the volume provided by the platform.

Could you please investigate this? It seems to be a platform-specific interaction with this particular Docker image (n8nio/n8n). My project is mindful-determination.

Thank you for your help.

$10 Bounty

2 Replies

railway[bot]

6 days ago

Hey there! We've found the following might help you get unblocked faster:

If you find the answer from one of these, please let us know by solving the thread!


6 days ago

This thread has been marked as public for community involvement, as it does not contain any sensitive or personal information. Any further activity in this thread will be visible to everyone.

Status changed to Open brody 6 days ago


Hi

Is this deploy new? Do you have any data there you need to keep?

Anyway, any chown you do in the Dockerfile or entry-point is overwritten by the volume mount, so the non-privileged node user in the n8n image cannot write to /home/node/.n8n.

There are 2 good work-arounds:

  1. Run the main n8n container as root (remove or override USER node, or add USER root at the end of the Dockerfile). Root owns the mount and the service will start.

  2. Skip the volume: with a Postgres backend the .n8n folder only stores transient cache; you can rely on Postgres for persistence and keep the folder in the container’s ephemeral filesystem.


Subject: Persistent EACCES Permission Denied on n8n Deployment with Volume - Railway Help Station