fix(mcp): explain an incompatible state database #142
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/YT-87-incompatible-schema-startup-error"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
yt mcp serveopened its SQLite state database throughmcp_web::db::open_withand propagated whatever came back. A database written by a pre-YT-73 build fails sqlx's checksum validation on migration 1, so the operator sawrunning SQLite migrations / migration 1 was previously applied but has been modifiedand the service restart-looped until systemd blocked it. That text names neither the file, nor the reason, nor the remedy, and the only record of the condition was a prose note incrates/youtrack-mcp/src/db/mod.rs.db::open_poolnow wraps the open and rewrites only the schema-history variants ofMigrateError(VersionMismatch,VersionMissing,Dirty). The message names the configureddatabase_url, states that the history cannot be migrated in place, and gives the move-aside-and-restart remedy plus the explicit list of what does not carry over (accounts, stored instance tokens, OAuth clients, sessions). On a checksum mismatch at version 1 it probessqlite_masteron a read-only connection for thehub_tokens/allowlist/usersmarker tables and, when all three are present, identifies the file as the pre-YT-73 Hub-keyed schema by name; otherwise it uses generic incompatible-history wording. Every otheropen_withfailure (a parent directory that cannot be used,code: 14, a corrupt file) passes through with its original context intact, so the existing troubleshooting row stays accurate.Nothing is deleted, renamed, truncated, or recreated: discarding encrypted tokens is an explicit operator action, not a startup-path decision. The two seeded-database tests assert the file is byte-identical afterwards and that no sibling appeared, so a future auto-rename cannot land unnoticed.
docs/deployment.mdgains a troubleshooting row for the migration failure and a paragraph in the upgrade section stating that a pre-YT-73 database cannot be carried onto the new volume; the sentence that previously suggested copying the old SQLite file across is gone.#YT-87