I’ve been working on a personal project for nearly 10 months. It’s a Node.js application with an SQLite database. Recently, I managed to deploy the application to Fly.io, and it’s been running fine. However, I’m facing an issue with my SQLite database.
The problem is that when I update my database with “X” data, it seems to work initially, but after a few minutes, the changes are lost, and it reverts to the state before I deployed the application. I’ve noticed this especially when the application crashes and restarts.
ID STATE NAME SIZE REGION ZONE ENCRYPTED ATTACHED VM CREATED AT
vol_24yeo0ezydpwlzjr created mazoetbe 1GB ams 6d3a true 6e82933c0293d8 1 week ago
fly machine list
ID NAME STATE REGION IMAGE IP ADDRESS VOLUME CREATED LAST UPDATED APP PLATFORM PROCESS GROUP SIZE
6e82933c0293d8 damp-fire-7976 started ams mazoethub:deployment-01HD476DV8S7Q1BW6XZCTVBW7Y fdaa:3:5ee:a7b:c6ef:d85d:40cb:2 vol_24yeo0ezydpwlzjr 2023-10-06T10:07:43Z 2023-10-19T20:29:39Z v2 app shared-cpu-1x:256MB
I have already tried a lot of options mentioned, including Mount and Prep for Deployment. In here I didn’t get, where can i locate lib/tasks/fly.rake file. So I add that path to my app code base. But even that didn’t make any changes.
Has anyone encountered a similar issue when using SQLite with Fly.io? I’d appreciate any insights or suggestions to ensure the data remains persistent in my database after updates and application restarts.
2023-10-20T17:51:32.153 app[6e82933c0293d8] ams [info] [ 731.228210] reboot: Restarting system
2023-10-20T17:51:32.370 runner[6e82933c0293d8] ams [info] machine did not have a restart policy, defaulting to restart
2023-10-20T17:51:33.326 app[6e82933c0293d8] ams [info] [ 0.038365] PCI: Fatal: No config space access function found
2023-10-20T17:51:33.549 app[6e82933c0293d8] ams [info] INFO Starting init (commit: 15238e9)…
2023-10-20T17:51:33.573 app[6e82933c0293d8] ams [info] INFO Mounting /dev/vdb at /sqllite/volumename w/ uid: 1000, gid: 1000 and chmod 0755
2023-10-20T17:51:33.577 app[6e82933c0293d8] ams [info] INFO Resized /sqllite/volumename to 1069547520 bytes
Error msg - Error: SQLITE_CANTOPEN: unable to open database file