{"record":{"id":"5dd1cb4636937713","repo":"gastownhall/beads","slug":"loading-deps-for-s-w","errorCode":null,"errorMessage":"loading deps for %s: %w","messagePattern":"loading deps for (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/linear.go","lineNumber":1401,"sourceCode":"\t\tif ident == \"\" {\n\t\t\tcontinue\n\t\t}\n\t\tidToIdent[issue.ID] = ident\n\t}\n\tif len(idToIdent) == 0 {\n\t\treturn nil, nil\n\t}\n\t// Second pass: walk each child-bead's dependencies, find the\n\t// parent-child edge, and emit a link if both ends are Linear-synced.\n\tlinks := make([]linear.ParentLink, 0)\n\tfor _, issue := range issues {\n\t\tchildIdent, ok := idToIdent[issue.ID]\n\t\tif !ok {\n\t\t\tcontinue\n\t\t}\n\t\tdeps, err := store.GetDependenciesWithMetadata(ctx, issue.ID)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"loading deps for %s: %w\", issue.ID, err)\n\t\t}\n\t\tfor _, d := range deps {\n\t\t\tif d == nil || d.DependencyType != types.DepParentChild {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\t// child depends-on parent — the dep target's embedded Issue is the parent.\n\t\t\tparentIdent, ok := idToIdent[d.Issue.ID]\n\t\t\tif !ok {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tlinks = append(links, linear.ParentLink{\n\t\t\t\tChildIdentifier:  childIdent,\n\t\t\t\tParentIdentifier: parentIdent,\n\t\t\t})\n\t\t}\n\t}\n\treturn links, nil\n}","sourceCodeStart":1383,"sourceCodeEnd":1419,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/linear.go#L1383-L1419","documentation":"buildLinearParentLinks loads each issue's dependencies (with metadata) from the store via GetDependenciesWithMetadata to derive parent-child links for reconciliation. If the store query fails, the error is wrapped as 'loading deps for <issue-id>'.","triggerScenarios":"Reconciling Linear parents (bd linear sync/push) when the underlying store query for an issue's dependencies fails — DB connection loss, corrupted Dolt data, or store closed mid-operation.","commonSituations":"Dolt database locked or unavailable during long sync; daemon restarted mid-run; disk/IO errors; interrupted migration leaving the deps table unreadable.","solutions":["Retry the linear sync after confirming the store is healthy (`bd doctor`)","Restart the bd daemon / reconnect the store, then re-run","Check Dolt database integrity and restore from backup if the deps data is corrupted"],"exampleFix":"// before\n$ bd linear sync\nError: loading deps for bd-abc123: connection refused\n// after\n$ bd doctor && bd daemon restart\n$ bd linear sync","handlingStrategy":"retry","validationCode":"if err := exec.Command(\"bd\", \"doctor\").Run(); err != nil {\n\treturn fmt.Errorf(\"store unhealthy; fix before linear sync\")\n}","typeGuard":null,"tryCatchPattern":"err := runLinearSync(ctx)\nif err != nil && strings.Contains(err.Error(), \"loading deps for\") {\n\ttime.Sleep(2 * time.Second)\n\terr = runLinearSync(ctx) // retry once after store recovers\n}","preventionTips":["Avoid concurrent bd writes/syncs that can contend on the Dolt store","Keep the daemon running and restart it after crashes before re-syncing","Back up the database; verify integrity periodically with bd doctor"],"tags":["database","dependencies","linear","store"],"backgroundTag":"dependency-load-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}