Skip to content

flake: Test process crash - duplicate migration number 000472 #1483

@flake-investigator

Description

@flake-investigator

CI Run Link: https://github.com/coder/coder/actions/runs/24717337345

Commit Info:

  • SHA: 9d0469fc4c606dc3701758dc9e3b4e92f6e52b90
  • Author: Michael Suchacz (ibetitsmike)
  • Commit title: feat: allow approved external MCP tools in root plan mode (#24509)

Summary:
Main CI failed across gen, lint, sqlc-vet, test-go-pg (linux/macos/windows), test-go-pg-17, test-go-race-pg, and test-e2e because migrations fail to initialize due to a duplicate migration number (000472). Deterministic code-change failure, not a flake.

Error Evidence:

  • gen job panic:
panic: open containerized database failed: migrate db: migrate setup: create iofs: failed to init driver with path .: duplicate migration file: 000472_mcp_server_allow_in_plan_mode.down.sql

goroutine 1 [running]:
main.main()
	/home/runner/work/coder/coder/coderd/database/gen/dump/main.go:58 +0x4d3
  • test-go-pg (representative):
failed to init driver with path .: duplicate migration file: 000472_mcp_server_allow_in_plan_mode.down.sql
Test: TestRun/OK
  • test-e2e webserver:
error: connect to postgres: migrate up: migrate setup: create iofs: failed to init driver with path .: duplicate migration file: 000472_mcp_server_allow_in_plan_mode.down.sql
  • sqlc-vet fallout:
telemetryitems.sql: GetTelemetryItems: sqlc/db-prepare: error preparing query: ERROR: relation "telemetry_items" does not exist (SQLSTATE 42P01)

Root Cause:
Two migrations share the same number 000472:

  1. coderd/database/migrations/000472_chat_resource_type_audit.{up,down}.sql — commit c968a1f3a3 (Cian Johnston)
  2. coderd/database/migrations/000472_mcp_server_allow_in_plan_mode.{up,down}.sql — commit 9d0469fc4c (Michael Suchacz)

The latter migration reused an existing number, causing migration initialization to fail.

Race/Panic/OOM checks:

  • No "WARNING: DATA RACE" or "race detected during execution of test" in test-go-race-pg output.
  • Panic above is due to duplicate migration number (not OOM).

Precise Assignment Analysis:

  • git log --oneline -- coderd/database/migrations/000472_mcp_server_allow_in_plan_mode.up.sql -> 9d0469fc4c (Michael Suchacz)
  • git log --oneline -- coderd/database/migrations/000472_chat_resource_type_audit.up.sql -> c968a1f3a3 (Cian Johnston)
    Latest change introduced the collision; assigning to ibetitsmike.

Classification:
E. Code Change (migration numbering collision).

Related Issues:

Reproduction:

  • make gen or any job that runs migrations (make lint, sqlc-vet, test-go-*, test-e2e).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions