Error during deployment when using a volume
ddotx
PROOP

6 months ago

After adding the volume and mounting it in the application, I encounter this error every time during deployment.

"""

Stopping Container

May 26 18:28:17

npm error path /app

May 26 18:28:17

npm error command failed

May 26 18:28:17

npm error signal SIGTERM

May 26 18:28:17

npm error command sh -c nest start

May 26 18:28:17

npm error A complete log of this run can be found in: /root/.npm/_logs/2025-05-26T10_59_10_899Z-debug-0.log

May 26 18:28:18

Stopping Container

"""

Solved$10 Bounty

7 Replies

ddotx
PROOP

6 months ago

Kindly review the screenshots I provided.


brody
EMPLOYEE

6 months 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 months ago


lofimit
HOBBY

6 months ago

Maybe your volume is mounting over /app and wiping out your app files inside the container, so when the container starts, it can’t find your app files and crashes.

Try mounting the volume somewhere else.


lofimit

Maybe your volume is mounting over /app and wiping out your app files inside the container, so when the container starts, it can’t find your app files and crashes.Try mounting the volume somewhere else.

angobello
PRO

6 months ago

My thoughts as well

Try mounting elsewhere and if you are using a Dockerfile check the workdir as well


smolpaw
HOBBY

6 months ago

This looks like a permission issue, you node app's user doesn't have the permission to write to the volume.
If you can connect with me on discord : smolit
So we could finish this quicker. This platform's forum like conversation doesn't allow for quick conversations.


ddotx
PROOP

6 months ago

I adhere to this document Using Volumes | Railway Docs

Relative Paths

Nixpacks, the default buildpack used by Railway, puts your application files in an /app folder at the root of the container. If your application writes to a directory at a relative path, and you need to persist that data on the volume, your mount path should include the app path.

For example, if your application writes data to ./data, you should mount the volume to /app/data.


ddotx
PROOP

6 months ago

please see my variables, I also added RAILWAY_RUN_UID=0

Attachments


ddotx

please see my variables, I also added RAILWAY_RUN_UID=0

smolpaw
HOBBY

6 months ago

I just tried to reproduce this by running a node application, have it built by nixpacks and then mount a volume at /app/logs
It worked without a hitch. No RAILWAY_RUN_UID required as nixpacks runs the node process as root by default.

You need to share your code with me to get to the root of this issue. Maybe add my email to your git repo temporarily so i can do a review ?


Status changed to Solved chandrika 6 months ago


Loading...