{"record":{"id":"c88b32a724ab32e3","repo":"gastownhall/beads","slug":"reading-existing-dependencies-for-s-w","errorCode":null,"errorMessage":"reading existing dependencies for %s: %w","messagePattern":"reading existing dependencies for (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/graph_apply.go","lineNumber":1234,"sourceCode":"\t\tif id == toID {\n\t\t\treturn true, nil\n\t\t}\n\t\tif seen[id] {\n\t\t\treturn false, nil\n\t\t}\n\t\tseen[id] = true\n\t\tfor _, next := range adj[id] {\n\t\t\tfound, err := visit(next)\n\t\t\tif err != nil || found {\n\t\t\t\treturn found, err\n\t\t\t}\n\t\t}\n\t\tdeps, ok := depCache[id]\n\t\tif !ok {\n\t\t\tvar err error\n\t\t\tdeps, err = tx.GetDependencyRecords(ctx, id)\n\t\t\tif err != nil {\n\t\t\t\treturn false, fmt.Errorf(\"reading existing dependencies for %s: %w\", id, err)\n\t\t\t}\n\t\t\tdepCache[id] = deps\n\t\t}\n\t\tfor _, dep := range deps {\n\t\t\tif !followExistingDep(dep.Type) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfound, err := visit(dep.DependsOnID)\n\t\t\tif err != nil || found {\n\t\t\t\treturn found, err\n\t\t\t}\n\t\t}\n\t\treturn false, nil\n\t}\n\treturn visit(fromID)\n}\n\n// graphApplyEdgeIsLocalCycleRelevant reports whether an edge participates in the","sourceCodeStart":1216,"sourceCodeEnd":1252,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/graph_apply.go#L1216-L1252","documentation":"Wraps an error from tx.GetDependencyRecords while graphApplyHasPath walks existing dependencies to detect cycles. The wrapped error is the actual failure (storage/tx level); this message adds which issue's deps could not be read.","triggerScenarios":"Cycle detection during bd graph apply needs the existing dependency records for issue `id` and the transaction's GetDependencyRecords call fails.","commonSituations":"DB locked or connection dropped mid-apply; issue referenced in the plan was deleted concurrently; storage backend error.","solutions":["Fix the underlying error shown after this prefix (connection, lock, missing issue)","Retry the apply after confirming the referenced issue still exists","Check database health/integrity if GetDependencyRecords fails repeatedly"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"err := bd.GraphApply(ctx, plan)\nif err != nil && strings.Contains(err.Error(), \"reading existing dependencies\") {\n  time.Sleep(backoff)\n  err = bd.GraphApply(ctx, plan) // retry after transient storage failure\n}","preventionTips":["Verify DB connectivity/health before long apply operations","Avoid concurrent writers deleting issues during apply","Monitor for underlying GetDependencyRecord failures"],"tags":["go","storage","error-wrapping","graph-apply"],"backgroundTag":"dependency-record-load-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}