assistant-api: restore V12 migration to its applied content (fix Flyway checksum crashloop)#573
Merged
Merged
Conversation
assistant-api and assistant-api-ws were CrashLoopBackOff on:
Flyway: Migration checksum mismatch for migration version 12
Applied to database : -1120901032
Resolved locally : -1416040883
The V12 file had its leading comment reworded after it was already applied
to the production database (commit 9f17beb). Flyway checksums the whole
file, comments included, so the edit flipped the checksum and validation
hard-fails on boot. The ALTER TABLE itself was never touched, so the live
schema is correct; only the recorded checksum and the file diverged.
This restores V12 to the byte-exact content that produced the applied
checksum, so validation passes again with no database change. No
flyway repair is used: repairing would bless the edited file, whereas the
applied content is the source of truth and an applied migration must not be
edited in the first place (a CI guard for that follows separately).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Symptom
assistant-apiandassistant-api-wswere in CrashLoopBackOff, failing to start with:Cause
The leading comment of
V12__workspace_agent_session_cli_session_id.sqlwas reworded (commit9f17beb9) after V12 had already been applied to the production database. Flyway checksums the entire migration file — comments included — so the reword flipped the resolved checksum andvalidatehard-fails at boot. TheALTER TABLEbody was never changed, so the live schema is correct; only the file and the recorded checksum diverged.Fix
Restore V12 to the byte-exact content that produced the applied checksum (
-1120901032). Validation then passes with no database change.flyway repairis deliberately not used: repairing would bless the edited file as canonical, but the applied content is the source of truth, and an already-applied migration must not be edited at all. A CI guard enforcing that follows in a separate change.