2 months ago
I asked the railway ai and claude both said: This isnt your fault make a new volume with the 170KB data ur bot has and i did. Now the volume is full again and its going up and up. Claude and railway ai say they cant find the issue and me neither. Its a discord bot
3 Replies
2 months ago
This thread has been opened as a bounty so the community can help solve it.
Status changed to Open Railway • about 2 months ago
0x5b62656e5d
Are you using some sort of SQLite database?
2 months ago
Yes, SQLite, single small file (0.17MB confirmed). Not WAL mode, no backups, nothing else in my code writes to disk. Even migrated to a brand new volume and the same growth showed up again. Genuinely stuck on the cause.
Yes, SQLite, single small file (0.17MB confirmed). Not WAL mode, no backups, nothing else in my code writes to disk. Even migrated to a brand new volume and the same growth showed up again. Genuinely stuck on the cause.
19 days ago
You said you're not using WAL, which likely means SQLite is using its default DELETE journal mode.
In DELETE mode, every write transaction creates a database.db-journal file, writes to it, commits, then deletes it. If the bot writes frequently, that can cause constant filesystem block allocation and deletion even though the actual SQLite file stays around 170 KB.
That may be interacting badly with Railway's block accounting or reclamation, causing the reported volume usage to keep increasing.
A relatively safe experiment is to switch from DELETE to PERSIST using:
PRAGMA journal_mode=PERSIST;
PRAGMA journal_size_limit=1048576;
With PERSIST, SQLite keeps and reuses the rollback journal instead of constantly creating and deleting it. For a 170 KB database, a 1 MB journal limit should be plenty.
Set these PRAGMAs when initializing each SQLite connection. I would not use journal_mode=OFF or MEMORY, since those reduce crash safety and can risk corruption.