{"record":{"id":"5eaaa4e63d804d64","repo":"gastownhall/beads","slug":"parent-issue-s-not-found-5eaaa4","errorCode":null,"errorMessage":"parent issue '%s' not found","messagePattern":"parent issue '(.+?)' not found","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/list_show_filter_modes.go","lineNumber":61,"sourceCode":"// is unchanged for that reason: three modes here still name the type.\n//\n// Widening the hole is an edit in the config and a diff a reviewer sees.\n\n// getHierarchicalChildren handles the --tree --parent combination logic.\n// baseFilter carries CLI filters (--type, --status, etc.) through the recursive walk.\nfunc getHierarchicalChildren(ctx context.Context, store storage.DoltStorage, dbPath string, parentID string, baseFilter types.IssueFilter) ([]*types.Issue, error) {\n\t// First verify that the parent issue exists\n\tvar parentIssue *types.Issue\n\terr := withStorage(ctx, store, dbPath, func(s storage.DoltStorage) error {\n\t\tvar err error\n\t\tparentIssue, err = s.GetIssue(ctx, parentID)\n\t\treturn err\n\t})\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error checking parent issue: %v\", err)\n\t}\n\tif parentIssue == nil {\n\t\treturn nil, fmt.Errorf(\"parent issue '%s' not found\", parentID)\n\t}\n\n\t// Use recursive search to find all descendants using the same logic as --parent filter.\n\t// The parent itself is NOT included in the result set — only actual children and\n\t// their descendants. This matches the behavior of --json and --flat (GH#3349).\n\tallDescendants := make(map[string]*types.Issue)\n\n\terr = findAllDescendants(ctx, store, dbPath, parentID, baseFilter, allDescendants)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error finding descendants: %v\", err)\n\t}\n\n\tif len(allDescendants) == 0 {\n\t\treturn nil, nil\n\t}\n\n\t// Include the parent as the tree root only when descendants exist,\n\t// so the tree renderer can draw the hierarchy with the parent at the top.","sourceCodeStart":43,"sourceCodeEnd":79,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/list_show_filter_modes.go#L43-L79","documentation":"getHierarchicalChildren resolves the requested --parent issue before enumerating its descendants. When the storage layer reports that no issue exists for the given parentID (parentIssue == nil), the function refuses to silently return an empty list and throws this error so the user knows the parent itself is invalid.","triggerScenarios":"Calling `bd list --parent <id>` (or the watched-issues path via loadWatchedIssues) with an issue ID that does not exist in the store, e.g. after the issue was deleted, the ID was mistyped, or the local Dolt database has not been synced and is missing that issue.","commonSituations":"Typo in parent ID; referencing an issue deleted by a teammate before your local `bd dolt pull`; running in the wrong repo/beads dir so the parent lives in a different database; stale scripts holding old IDs.","solutions":["Run `bd show <parentID>` to confirm the issue exists in this database","Check for typos or prefix mistakes in the parent ID","Sync the database (`bd dolt pull`) if the parent was created elsewhere","Re-run the command from the correct repository / -C directory"],"exampleFix":"// before\nbd list --parent bd-9999\n// after\nbd show bd-9999   # verify it exists first\nbd list --parent bd-9999","handlingStrategy":"validation","validationCode":"if out, err := exec.Command(\"bd\", \"show\", parentID).Run(); err != nil {\n    return fmt.Errorf(\"parent %s does not exist; aborting\", parentID)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always `bd show <id>` before using an ID as a parent filter","Pull (`bd dolt pull`) before scripting against remotely-created issues","Run commands from the correct repo/beads dir"],"tags":["cli","issue-tracking","parent-lookup"],"backgroundTag":"parent-issue-not-found","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}