4 months ago
Hello,
I'm trying to self-host n8n on Railway with a custom Dockerfile to include ffmpeg and other tools. The container consistently crashes on deployment with an ENOENT error related to the package.json file.
The core problem: The volume mount seems to be overwriting the core n8n application files.
I have tried the following steps based on documentation and troubleshooting:
Dockerfile Modifications: I've attempted multiple Dockerfile configurations to install
ffmpegand other dependencies. I also tried changing theWORKDIRand explicitly copying n8n's files to a new directory to prevent conflicts.Volume Configuration: The
RAILWAY_VOLUME_MOUNT_PATHis correctly set to/home/node/.n8n/data, and I have deleted and recreated the volume several times.User Permissions: I've ensured that my Dockerfile correctly switches between the
rootuser (for installing packages) and thenodeuser (for running the application).
Despite these efforts, the container crashes with the following error:
Mounting volume on: /var/lib/containers/railwayapp/bind-mounts/...
npm error code ENOENT
npm error syscall open
npm error path /home/node/package.json
npm error enoent Could not read package.json: Error: ENOENT: no such file or directory, open '/home/node/package.json'
It seems the volume is somehow overriding the entire /home/node directory, even though the mount path is set to a subdirectory.
Has anyone encountered this specific issue with n8n and Railway? What could be causing the volume to overwrite the application files, and how can I resolve this?
Any insights would be greatly appreciated.
1 Replies
4 months 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!