4 months ago
Dear Railway Support Team,
I am experiencing a critical issue with my deployed Laravel application and need clarification about Railway's container lifecycle management.
Issue Description:
My application uses SQLite database to store Shopify authentication tokens
Every day, the stored authentication tokens are automatically cleared/lost
I have not implemented any code that deletes or clears this data
The SQLite database file and table structure remain intact, but the data disappears
Application Details:
Technology: Laravel + SQLite
Database file location:
/app/database/database.sqliteData being lost: Shopify access tokens stored in 'shops' table
Pattern: Data loss occurs daily at approximately the same time
Questions:
Do Railway containers automatically restart daily for maintenance?
Is the container filesystem ephemeral, causing file data to be lost on restart?
What is Railway's policy on container lifecycle and data persistence?
Do I need to configure persistent volumes to maintain SQLite data between restarts?
What I've Verified:
Database table structure remains intact after data loss
No application code is deleting the data
Shopify tokens do not expire (custom app tokens are permanent)
Issue occurs consistently every ~24 hours
Request for Clarification: I need to understand if Railway containers are designed to restart periodically, which would explain the data loss pattern. If this is the case, I need guidance on implementing persistent storage for my SQLite database.
Could you please confirm:
Railway's container restart schedule/policy
Best practices for SQLite persistence on Railway
Whether persistent volumes are required for file-based databases
This is affecting a production Shopify application, so your prompt response would be greatly appreciated.
Project Details:
Project Name: Unsubscribe-and-prefrence
Thank you for your assistance.
Vikrant Kumar
2 Replies
4 months ago
Hey there! We've found the following might help you get unblocked faster:
🧵 Lost data that was saved to sqlite due to container stopping
🧵 Consul Docker container loses data on Railway despite volume configuration
🧵 Data Missing After Payment + Redeploy – No Deletion Warning
If you find the answer from one of these, please let us know by solving the thread!
4 months ago
Hi Vikrant,
Railway may redeploy services to rebalance workloads across Railway's infrastructure, and you will experience this from time to time on the Free plan.
To persist data, you should store your data in a Volume. See the Docs on Volumes.
Here's a SQLite template with a database underpinned by a Volume.
Regards,
Christian
Status changed to Awaiting User Response Railway • 4 months ago
3 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 • 3 months ago