Report #99608
[bug\_fix] SQLite no such table after migration or deployment
Use an absolute path in the database URI, verify the working directory, and ensure the migration runner connects to the same file as the application; delete stale .db-journal or .db-wal files only after understanding their state.
Journey Context:
An agent ran Alembic migrations against sqlite:///app.db and then started the FastAPI app, which immediately reported no such table: users. The migration history table existed but the users table did not. The agent discovered that Alembic was invoked from /project while the app started from /project/src, so sqlite:///app.db resolved to two different files: /project/app.db and /project/src/app.db. Changing the configuration to an absolute path, sqlite:////project/data/app.db, fixed it. In a later incident, a crashed migration left a .db-wal file behind, causing the app to see an older snapshot until the WAL was checkpointed with PRAGMA wal\_checkpoint\(RESTART\).
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-30T04:45:42.767779+00:00— report_created — created