{"record":{"id":"208e159242cca5f8","repo":"d2lang/d2","slug":"board-at-path-v-not-found","errorCode":null,"errorMessage":"board at path %v not found","messagePattern":"board at path (.+?) not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"d2oracle/get.go","lineNumber":90,"sourceCode":"\t\t\t\tif len(boardPath) > 1 {\n\t\t\t\t\tif ReplaceBoardNode(n.MapKey.Value.Map, ast2, boardPath[1:]) {\n\t\t\t\t\t\treturn true\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tn.MapKey.Value.Map.Nodes = ast2.Nodes\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn false\n}\n\nfunc GetChildrenIDs(g *d2graph.Graph, boardPath []string, absID string) (ids []string, _ error) {\n\tg = GetBoardGraph(g, boardPath)\n\tif g == nil {\n\t\treturn nil, fmt.Errorf(\"board at path %v not found\", boardPath)\n\t}\n\n\tmk, err := d2parser.ParseMapKey(absID)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tobj, ok := g.Root.HasChild(d2graph.Key(mk.Key))\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"%v not found\", absID)\n\t}\n\n\tfor _, ch := range obj.ChildrenArray {\n\t\tids = append(ids, ch.AbsID())\n\t}\n\n\treturn ids, nil\n}\n","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/d2lang/d2/blob/0d69dca6f532ceaeacd615d35d1eaa41a238ffdb/d2oracle/get.go#L72-L108","documentation":"d2oracle.GetChildrenIDs first resolves boardPath through GetBoardGraph; a nil result means no board in the graph matches the path, so it returns \"board at path %v not found\". The library validates the board path before touching any objects. It signals that the caller's board navigation input is invalid, not that a specific object is missing.","triggerScenarios":"Calling d2oracle.GetChildrenIDs(g, boardPath, absID) where boardPath does not resolve to an existing board, e.g. GetChildrenIDs(g, []string{\"layers.layer1\"}, \"x.y\") when the graph has no such board.","commonSituations":"Hard-coded board path from another project/diagram; board path built by joining with '.' then splitting incorrectly; referencing a board inside a scenario/step that has not been defined; stale path after refactoring the D2 script.","solutions":["Verify the board path exists in the current graph (list boards from the D2 script) and fix the spelling/structure.","Pass an empty boardPath ([]string{} or nil) if you actually want children on the root board.","Ensure path elements match exactly, including underscores vs dashes and casing.","Regenerate the path programmatically from the graph instead of hard-coding it."],"exampleFix":"// before\nids, err := d2oracle.GetChildrenIDs(g, []string{\"layers\", \"auth\"}, \"root.db\")\n// after\nids, err := d2oracle.GetChildrenIDs(g, []string{\"layers\", \"authLayer\"}, \"root.db\") // board actually defined in script","handlingStrategy":"validation","validationCode":"if d2oracle.GetBoardGraph(g, boardPath) == nil {\n\treturn nil, fmt.Errorf(\"board %v does not exist; fix boardPath before GetChildrenIDs\", boardPath)\n}\nids, err := d2oracle.GetChildrenIDs(g, boardPath, absID)","typeGuard":"func boardResolvable(g *d2graph.Graph, boardPath []string) bool {\n\treturn d2oracle.GetBoardGraph(g, boardPath) != nil\n}","tryCatchPattern":"ids, err := d2oracle.GetChildrenIDs(g, boardPath, absID)\nif err != nil {\n\tif strings.Contains(err.Error(), \"board at path\") {\n\t\tids, err = d2oracle.GetChildrenIDs(g, nil, absID) // fallback to root board\n\t}\n\tif err != nil {\n\t\treturn err\n\t}\n}","preventionTips":["Validate board paths against the graph before any d2oracle getter call.","Use nil/empty boardPath for the root board rather than guessing a path.","Centralize board-path construction in one helper with tests.","Keep board names in sync between scripts and calling code (rename is a breaking change)."],"tags":["d2","board-path","api-misuse"],"backgroundTag":"resource-not-found","analyzedSha":"0d69dca6f532ceaeacd615d35d1eaa41a238ffdb","analyzedAt":"2026-08-31T12:19:21.182Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}