Bug: CrashLoopBackOff — Alembic migration chain forked, DB in partial state #183
Labels
No labels
domain:backend
domain:devops
domain:frontend
status:approved
status:in-progress
status:needs-fix
status:qa
type:bug
type:devops
type:feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
forgejo_admin/basketball-api#183
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Type
Bug
Lineage
Standalone — discovered during westside landing site validation. basketball-api returns 502, blocking /teams dynamic content.
Repo
forgejo_admin/basketball-apiWhat Broke
basketball-api is in CrashLoopBackOff (32+ restarts). Two cascading errors:
737093f, 23 commits behind) crashed with:Can't locate revision identified by '018'15f3047) crashes with:DuplicateColumn: column "custom_notes" of relation "players" already existsRoot cause: the migration chain was forked during development. Migrations ran out of order, then
022_merge_heads.pylinearized the chain, but the DB never ran through the fixed chain.DB State (partial migration)
Repro Steps
kubectl get pods -n basketball-api→ CrashLoopBackOffkubectl logs deploy/basketball-api -n basketball-api→ DuplicateColumn errorpsql -U basketball -d basketball -c "SELECT version_num FROM alembic_version"→018Expected Behavior
App boots, runs migrations forward cleanly, serves /public/teams endpoint.
Environment
15f3047(latest main)018Fix Plan
alembic stamp 020alembic upgrade head(applies 021, 022, 023, 024)Reference:
sop-db-migration-recoveryAcceptance Criteria
curl https://basketball-api.tail5b443a.ts.net/healthreturns 200curl https://basketball-api.tail5b443a.ts.net/public/teamsreturns team data024Related
project-westside-basketballScope Review: NEEDS_REFINEMENT
Review note:
review-445-2026-03-26Issue scope is high quality (detailed root cause, DB state audit, concrete fix plan, verifiable acceptance criteria, valid SOP reference) but board/traceability hygiene needs attention before moving to next_up.
in_progressfor #184. Clarify whether #183 restates remaining work or is a duplicate.story:Xlabel. Likelystory:WS-S26based on westside landing site context.