{"record":{"id":"ef3ccb0e19a8f557","repo":"gastownhall/beads","slug":"checking-wisp-dependencies-table-w","errorCode":null,"errorMessage":"checking wisp_dependencies table: %w","messagePattern":"checking wisp_dependencies table: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/storage/schema/migration_repairs.go","lineNumber":212,"sourceCode":"// below are therefore the full shape as of immediately before 0053 runs --\n// every column/index any main migration <=52 adds to these tables -- verified\n// by building a bounded fresh chain (migrations 1..52 only) and comparing\n// against SHOW CREATE TABLE, not by manual inspection. Nothing from 54/55\n// (lease columns added then removed again) or 56 belongs here.\nfunc ensureWispTablesForMixedBlockedRecompute(ctx context.Context, db DBConn) error {\n\thasWisps, err := schemaTableExists(ctx, db, \"wisps\")\n\tif err != nil {\n\t\treturn fmt.Errorf(\"checking wisps table: %w\", err)\n\t}\n\tif !hasWisps {\n\t\tif _, err := db.ExecContext(ctx, wispsTableDDLForMigration0047); err != nil {\n\t\t\treturn fmt.Errorf(\"creating wisps for migration 0047: %w\", err)\n\t\t}\n\t}\n\n\thasWispDeps, err := schemaTableExists(ctx, db, \"wisp_dependencies\")\n\tif err != nil {\n\t\treturn fmt.Errorf(\"checking wisp_dependencies table: %w\", err)\n\t}\n\tif !hasWispDeps {\n\t\tif _, err := db.ExecContext(ctx, wispDependenciesTableDDLForMigration0047); err != nil {\n\t\t\treturn fmt.Errorf(\"creating wisp_dependencies for migration 0047: %w\", err)\n\t\t}\n\t\treturn nil\n\t}\n\n\treturn ensureWispDependenciesSplitTargets(ctx, db)\n}\n\n// ensureWispIsBlockedForRecompute repairs a drift shape in ignored/0006's own\n// guard: it no-ops (SELECT 1) when wisps does not exist yet at the moment it\n// runs, and once the ignored cursor advances past 6 that migration is never\n// pending again (pending = version > MAX(cursor); a missing low-numbered row\n// does not lower the high-water mark). wisps can be materialized without\n// is_blocked several ways -- ignored/0001's own CREATE-then-RENAME leaves an\n// existing wisps table untouched, and the main-side 0047 repair above","sourceCodeStart":194,"sourceCodeEnd":230,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/storage/schema/migration_repairs.go#L194-L230","documentation":"After handling wisps, the pre-0047 repair probes for wisp_dependencies via INFORMATION_SCHEMA.TABLES. This error wraps failure of that probe — the catalog lookup itself failed (connection error, server issue), not merely the table being absent.","triggerScenarios":"bd init pre-0047 repair on a clone where wisp_dependencies was never synced locally (dolt_ignore'd) and the INFORMATION_SCHEMA.TABLES lookup fails due to a dropped connection or server error.","commonSituations":"Clone-skew window after a schema bump (#4695/#4176); transient network outage during upgrade; overloaded shared Dolt server.","solutions":["Retry bd init after restoring connectivity — steps re-probe the schema","Check Dolt server health with bd doctor","Verify the server version supports the INFORMATION_SCHEMA queries used","Inspect the wrapped error for the underlying cause"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// pre-check the catalog probe path\nvar n int\nerr := db.QueryRowContext(ctx, `SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES\n  WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'wisp_dependencies'`).Scan(&n)\n// err != nil here means the same probe the repair uses will fail","typeGuard":null,"tryCatchPattern":"hasDeps, err := schemaTableExists(ctx, db, \"wisp_dependencies\")\nif err != nil {\n    if isTransient(err) {\n        return ensureWispTablesForMixedBlockedRecompute(ctx, db) // idempotent re-probe\n    }\n    return err\n}","preventionTips":["Retry init after restoring connectivity — all pre-0047 steps re-probe the schema","Check server health (bd doctor) when INFORMATION_SCHEMA queries fail","Avoid upgrading clones over unstable network links","Keep Dolt server software current"],"tags":["dolt","migration","sql","transient"],"backgroundTag":"table-not-found","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}