Data Persistence Issue with Node-RED Deployment
mrzmyr
HOBBYOP

a year ago

Subject:

hey there,

I'm experiencing a data persistence problem with my Node-RED deployment on Railway. Despite configuring a volume, my data is not persisting after redeployments.

Here are the details:

1. Project Setup:

- Service: Node-RED

- Dockerfile: Using official nodered/node-red base image

- Volume mount path: /data

2. Current Configuration:

- Volume created and attached to the service via Railway UI

- Mount path set to /data in Railway configuration

- Dockerfile WORKDIR set to /data

- CMD in Dockerfile: ["npm", "start", "--", "--userDir", "/data"]

3. Issue Description:

After redeployment, all previously saved Node-RED flows and configurations are lost. The /data directory appears to be empty or not persisting as expected.

4. Steps Taken:

- Verified volume creation and attachment in Railway UI

- Confirmed mount path is set to /data

- Checked for any conflicting environment variables

- Reviewed Dockerfile for correct data directory usage

- Attempted multiple deployments to test persistence

5. Expected Behavior:

Node-RED data (flows, configurations) should persist in the /data directory between deployments and restarts.

6. Actual Behavior:

Data is lost after each redeployment, suggesting the volume is not being properly mounted or persisted.

7. Questions:

- Is there a known issue with volume persistence for Node-RED deployments?

- Are there any specific configurations required for Node-RED to work correctly with Railway volumes?

- Can you verify if the volume is being correctly mounted and persisted on your end?

- Are there any logs or diagnostics I can provide to help troubleshoot this issue?

All the best slightly_smiling_face emoji

3 Replies

a year ago

Hello, your workdir and volume mount can not be the same location.


mrzmyr
HOBBYOP

a year ago

thanks @brody!

but does the workdir is not the place where node-red persists data?


a year ago

I think it is, you would need to reference node-reds docs on this.


Loading...