fix(workspace/db): repair channels stuck at alembic 025 (missing orchestration columns)#558
Draft
zomux wants to merge 1 commit into
Draft
fix(workspace/db): repair channels stuck at alembic 025 (missing orchestration columns)#558zomux wants to merge 1 commit into
zomux wants to merge 1 commit into
Conversation
…stration columns
Two migrations were both authored as revision "025":
- 025_add_channel_orchestration (this lineage): adds
channels.orchestration_mode + orchestration_instruction
- 025_add_evaluation_jobs (experimental SWE-bench lineage): creates
the evaluation_jobs table
Any DB that ran the evaluation-jobs variant first got stamped
alembic_version='025', so a later `alembic upgrade head` treated the DB
as already at head and never created the orchestration columns. Every
channel-list / /v1/discover query then 500s with
"column channels.orchestration_mode does not exist".
Add migration 026 that idempotently ensures both columns exist
(ADD COLUMN IF NOT EXISTS), repairing a DB stuck at 025 while being a
no-op where 025 already applied cleanly.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Production incident
workspace-backendprod was 500ing on every channel-list //v1/discoverquery:Root cause
Two migrations were both authored as revision
025:025_add_channel_orchestration(this lineage / develop / release) → addschannels.orchestration_mode+orchestration_instruction025_add_evaluation_jobs(experimental SWE-bench lineage) → createsevaluation_jobsThe prod DB had run the evaluation-jobs variant first and was stamped
alembic_version='025'. When the orchestration code deployed,alembic upgrade headsaw the DB already at025and became a no-op — so the orchestration columns were never created. Confirmed on prod:alembic_version='025'butorchestration%columns absent.Fix
ADD COLUMN IF NOT EXISTS);/v1/discovernow returns 401 (auth) instead of 500. 17,071 channel rows intact.026that idempotently ensures both columns exist, so the alembic history is consistent and any other environment stuck at025self-repairs on next deploy. No-op where025applied cleanly.Deploy
Fast-forward
releasefromdevelopafter merge; RailwaypreDeployCommand = alembic upgrade headwill apply026(025→026, no-op DDL, stamps 026).Follow-up (not in this PR)
The duplicate revision
025should be de-conflicted at the source: the SWE-bench025_add_evaluation_jobsneeds renumbering before that lineage ever merges, or the collision recurs.Verification
026's SQL creates the correct columns and is a clean no-op on re-run.🤖 Generated with Claude Code