{"record":{"id":"c3637fc8466146f5","repo":"gastownhall/beads","slug":"failed-to-check-dependencies-w","errorCode":null,"errorMessage":"failed to check dependencies: %w","messagePattern":"failed to check dependencies: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/migrate_issues.go","lineNumber":164,"sourceCode":"\t\tif jsonOutput {\n\t\t\treturn outputJSON(map[string]interface{}{\n\t\t\t\t\"message\": \"No issues match the specified filters\",\n\t\t\t})\n\t\t}\n\t\tfmt.Println(\"Nothing to do: no issues match the specified filters\")\n\t\treturn nil\n\t}\n\n\t// Step 3: Expand set to M (migration set) based on --include\n\tmigrationSet, dependencyStats, err := expandMigrationSet(ctx, s, candidates, p)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to compute migration set: %w\", err)\n\t}\n\n\t// Step 4: Check for orphaned dependencies\n\torphans, err := checkOrphanedDependencies(ctx, s)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to check dependencies: %w\", err)\n\t}\n\n\tif len(orphans) > 0 && p.strict {\n\t\treturn fmt.Errorf(\"strict mode: found %d orphaned dependencies\", len(orphans))\n\t}\n\n\t// Step 5: Build migration plan\n\tplan := buildMigrationPlan(candidates, migrationSet, dependencyStats, orphans, p.from, p.to)\n\n\t// Step 6: Display plan\n\tif err := displayMigrationPlan(plan, p.dryRun); err != nil {\n\t\treturn err\n\t}\n\n\t// Step 7: Execute migration if not dry-run\n\tif !p.dryRun {\n\t\tif !p.yes && !jsonOutput {\n\t\t\tif !confirmMigration(plan) {","sourceCodeStart":146,"sourceCodeEnd":182,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/migrate_issues.go#L146-L182","documentation":"This error wraps failures from checkOrphanedDependencies during step 4 of `bd migrate-issues`, which detects dependencies in the migration set that point at issues not being migrated. It indicates the orphan-detection query itself failed, not that orphans were found (that is error 1033's strict-mode message). The real cause is in the wrapped error.","triggerScenarios":"checkOrphanedDependencies(ctx, s) returns a non-nil error while querying dependency records for the migration set.","commonSituations":"Storage engine errors during dependency scans; context deadline exceeded on very large dependency tables; database file corruption after an interrupted sync.","solutions":["Read the wrapped inner error for the root cause","Check database integrity with `bd doctor`","Retry after confirming no competing bd process is writing","If the dependency table is large, ensure the storage backend has adequate resources"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// ensure the store is healthy and no other process is writing before migrating\nbd doctor\n# verify no concurrent bd sync is running","typeGuard":null,"tryCatchPattern":"if err := runMigrate(); err != nil {\n    if unwrapped := errors.Unwrap(err); unwrapped != nil {\n        log.Printf(\"orphan check failed: %v\", unwrapped)\n    }\n    return err\n}","preventionTips":["Run bd doctor before migrations","Serialize migrations with other bd operations","Keep dependency tables pruned of stale records"],"tags":["cli","migrations","dependencies"],"backgroundTag":"orphan-dependency-check-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}