{"record":{"id":"90e83c4155cf9396","repo":"gastownhall/beads","slug":"failed-to-build-dependency-resolver-v","errorCode":null,"errorMessage":"Failed to build dependency resolver: %v","messagePattern":"Failed to build dependency resolver: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"internal/tracker/engine.go","lineNumber":1323,"sourceCode":"\n\tif err := e.Store.RunInIssueLifecycleTransaction(ctx, fmt.Sprintf(\"bd: reimport update %s\", c.IssueID), func(tx storage.IssueLifecycleTransaction) error {\n\t\treturn applyPullIssueFields(ctx, tx, c.IssueID, updates, e.Actor)\n\t}); err != nil {\n\t\te.warn(\"Failed to update %s during reimport: %v\", c.IssueID, err)\n\t}\n}\n\n// createDependencies creates dependencies from the pending list, matching\n// external IDs to local issue IDs. Returns the number of dependencies that\n// failed to resolve or create.\nfunc (e *Engine) createDependencies(ctx context.Context, deps []DependencyInfo) int {\n\tif len(deps) == 0 {\n\t\treturn 0\n\t}\n\n\tresolveIssue, err := e.dependencyIssueResolver(ctx, nil)\n\tif err != nil {\n\t\te.warn(\"Failed to build dependency resolver: %v\", err)\n\t\treturn len(deps)\n\t}\n\n\terrCount := 0\n\tfor _, dep := range deps {\n\t\tfromIssue, err := resolveIssue(ctx, dep.FromExternalID)\n\t\tif err != nil {\n\t\t\te.warn(\"Failed to resolve dependency source %s: %v\", dep.FromExternalID, err)\n\t\t\terrCount++\n\t\t\tcontinue\n\t\t}\n\t\ttoIssue, err := resolveIssue(ctx, dep.ToExternalID)\n\t\tif err != nil {\n\t\t\te.warn(\"Failed to resolve dependency target %s: %v\", dep.ToExternalID, err)\n\t\t\terrCount++\n\t\t\tcontinue\n\t\t}\n","sourceCodeStart":1305,"sourceCodeEnd":1341,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/tracker/engine.go#L1305-L1341","documentation":"While importing dependencies during pull, the engine could not construct the issue resolver used to translate external IDs to local issues (dependencyIssueResolver). All pending dependencies are then counted as failed and skipped. This is an upfront infrastructure failure, not a per-dependency problem.","triggerScenarios":"e.dependencyIssueResolver(ctx, nil) returns an error at the start of createDependencies — typically a failure to build the external-ref → local-issue lookup (storage query failure, DB lock, or store unavailable).","commonSituations":"Local database locked or unavailable during pull; storage driver error while prefetching the ref-to-issue index; large-scale DB degradation after a crash.","solutions":["Inspect the wrapped error for the underlying storage failure and fix it (locks, connectivity to DB, disk).","Re-run `bd pull` — dependency creation is idempotent and will retry on the next pull.","Verify DB health (integrity check) if the resolver keeps failing.","Ensure the bd process has write access to the .beads storage."],"exampleFix":"// before: another bd process holds the DB lock\nbd sync --pull-only &\nbd doctor\n// after: stop competing processes, then pull\nbd doctor\nbd pull","handlingStrategy":"retry","validationCode":"// verify storage is available before pulls that import dependencies\nif err := store.Ping(ctx); err != nil {\n    log.Fatalf(\"dependency import will fail: storage unavailable: %v\", err)\n}","typeGuard":null,"tryCatchPattern":"// retry the pull — the resolver rebuild is cheap and edges are idempotent\nfor i := 0; i < 3; i++ {\n    stats, err := engine.Sync(ctx, opts)\n    if err == nil { break }\n    if isStorageErr(err) { time.Sleep(backoff(i)); continue }\n    break\n}","preventionTips":["Run bd doctor before dependency-heavy pulls","No concurrent bd processes on the same database","Check .beads directory write permissions","Investigate repeated resolver-build failures as storage degradation"],"tags":["sync","dependencies","storage","resolver"],"backgroundTag":"dependency-resolver-init-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}