SQLite Database Not Persistent
emersonbroga
HOBBYOP

7 months ago

I think Im loosing my database on every new deploy.

This is a simple NextJS Application using Sequelize with SQLite.

On my NextJS/Sequelize configs I have it set to:

  dialect: "sqlite",
  storage: process.env.SQLITE_PATH,

Then on Railway I have it with env vars:

RAILWAY_RUN_UID: 0
SQLITE_PATH: file:/data/ebookpay.db

and lastly I have the volume mounted with the mount path set to /data .

I have other projects exactly like thins on railway and as far as I remember they work as expected. Not sure what am I missing on this one.

Solved

2 Replies

mjablonski
PRO

7 months ago

Are you sure that the file protocol (file:) should be prependend to SQLITE_PATH?


brody
EMPLOYEE

7 months ago

Hello,

Your mount path is likely incorrect, please see our docs on that topic -

https://docs.railway.com/guides/volumes#relative-paths

Right now, you have the volume mount path as /data so try /app/data instead.

Best,
Brody


Status changed to Awaiting User Response Railway 7 months ago


Railway
BOT

4 months ago

This thread has been marked as solved automatically due to a lack of recent activity. Please re-open this thread or create a new one if you require further assistance. Thank you!

Status changed to Solved Railway 4 months ago


Loading...