Skip to content

assistant-api: restore V12 migration to its applied content (fix Flyway checksum crashloop)#573

Merged
ExtraToast merged 1 commit into
mainfrom
fix/assistant-api-restore-v12-migration
Jun 4, 2026
Merged

assistant-api: restore V12 migration to its applied content (fix Flyway checksum crashloop)#573
ExtraToast merged 1 commit into
mainfrom
fix/assistant-api-restore-v12-migration

Conversation

@ExtraToast

Copy link
Copy Markdown
Owner

Symptom

assistant-api and assistant-api-ws were in CrashLoopBackOff, failing to start with:

Flyway: Migration checksum mismatch for migration version 12
  Applied to database : -1120901032
  Resolved locally    : -1416040883

Cause

The leading comment of V12__workspace_agent_session_cli_session_id.sql was reworded (commit 9f17beb9) 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 and validate hard-fails at boot. The ALTER TABLE body 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 repair is 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.

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).
@ExtraToast ExtraToast added the bug Something isn't working label Jun 4, 2026
@ExtraToast ExtraToast self-assigned this Jun 4, 2026
@ExtraToast ExtraToast merged commit 4e78397 into main Jun 4, 2026
41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant