{"record":{"id":"56cb899500f18e00","repo":"gastownhall/beads","slug":"failed-to-get-all-dependency-records-w","errorCode":null,"errorMessage":"failed to get all dependency records: %w","messagePattern":"failed to get all dependency records: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/migrate_issues.go","lineNumber":453,"sourceCode":"\t}\n\n\t// Count outgoing edges: migrated issues depend on external issues\n\toutgoing := 0\n\tfor _, deps := range depsByIssue {\n\t\tfor _, dep := range deps {\n\t\t\tif !setMap[dep.DependsOnID] {\n\t\t\t\toutgoing++\n\t\t\t}\n\t\t}\n\t}\n\n\t// For incoming edges, we need to find all deps whose resolved target is in\n\t// the migration set but whose issue_id is not. Use GetAllDependencyRecords;\n\t// the returned records expose the target via dep.DependsOnID (resolved from\n\t// the typed columns).\n\tallDeps, err := s.GetAllDependencyRecords(ctx)\n\tif err != nil {\n\t\treturn dependencyStats{}, fmt.Errorf(\"failed to get all dependency records: %w\", err)\n\t}\n\n\tincoming := 0\n\tfor issueID, deps := range allDeps {\n\t\tif setMap[issueID] {\n\t\t\tcontinue // Skip edges from within the migration set\n\t\t}\n\t\tfor _, dep := range deps {\n\t\t\tif setMap[dep.DependsOnID] {\n\t\t\t\tincoming++\n\t\t\t}\n\t\t}\n\t}\n\n\treturn dependencyStats{\n\t\tincomingEdges: incoming,\n\t\toutgoingEdges: outgoing,\n\t}, nil","sourceCodeStart":435,"sourceCodeEnd":471,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/migrate_issues.go#L435-L471","documentation":"This error wraps failures from GetAllDependencyRecords inside countCrossRepoEdges, which loads every dependency record in the database to compute incoming edges — dependencies whose resolved target (DependsOnID) is in the migration set but whose owning issue_id is not. It means the full dependency-table scan failed while building migration statistics. The wrapped error holds the underlying cause.","triggerScenarios":"s.GetAllDependencyRecords(ctx) returns an error while computing incoming cross-repo edges during expandMigrationSet.","commonSituations":"Databases with very large dependency tables hitting scan timeouts or memory limits; corrupted dependency rows; storage backend unavailable mid-command.","solutions":["Read the wrapped error for the root storage cause","Run `bd doctor` to check dependency-table health","Retry when the database is not under concurrent write load","For very large tables, migrate in smaller filtered batches to reduce scan pressure"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"# check dependency-table health and size before large migrations\nbd doctor\nbd deps --json | jq 'length'","typeGuard":null,"tryCatchPattern":"err := runMigrate()\nif err != nil && strings.Contains(err.Error(), \"failed to get all dependency records\") {\n    log.Printf(\"full dep scan failed (%v); retrying once\", errors.Unwrap(err))\n    err = runMigrate()\n}","preventionTips":["Run bd doctor to keep the dependency table healthy","Avoid full-graph migrations on very large databases — batch instead","Retry outside of concurrent write windows"],"tags":["cli","dependencies","storage"],"backgroundTag":"dependency-records-fetch-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}