{"record":{"id":"81c14a8a85be32c8","repo":"dgraph-io/dgraph","slug":"unhandled-pb-node-v-with-parent-v","errorCode":null,"errorMessage":"Unhandled pb.node <%v> with parent <%v>","messagePattern":"Unhandled pb\\.node <(.+?)> with parent <(.+?)>","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"query/query.go","lineNumber":1373,"sourceCode":"\t\t\tit := doneVars[sg.Params.Var]\n\t\t\tit.Vals = mp\n\t\t\tdoneVars[sg.Params.Var] = it\n\t\t\tsg.Params.UidToVal = mp\n\t\tdefault:\n\t\t\tglog.V(3).Info(\"Warning: Math expression is using unassigned values or constants\")\n\t\t}\n\t\t// Put it in this node.\n\tcase len(sg.Params.NeedsVar) > 0:\n\t\t// This is a var() block.\n\t\tsrcVar := sg.Params.NeedsVar[0]\n\t\tsrcMap := doneVars[srcVar.Name]\n\t\t// The value var can be empty. No need to check for nil.\n\t\tsg.Params.UidToVal = srcMap.Vals\n\tcase sg.Attr == \"uid\" && sg.Params.DoCount:\n\t\t// This is the count(uid) case.\n\t\t// We will do the computation later while constructing the result.\n\tdefault:\n\t\treturn errors.Errorf(\"Unhandled pb.node <%v> with parent <%v>\", sg.Attr, parent.Attr)\n\t}\n\n\treturn nil\n}\n\nfunc (sg *SubGraph) populatePostAggregation(doneVars map[string]varValue, path []*SubGraph,\n\tparent *SubGraph) error {\n\n\tfor idx := range sg.Children {\n\t\tchild := sg.Children[idx]\n\t\tpath = append(path, sg)\n\t\terr := child.populatePostAggregation(doneVars, path, sg)\n\t\tpath = path[:len(path)-1]\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn sg.valueVarAggregation(doneVars, path, parent)","sourceCodeStart":1355,"sourceCodeEnd":1391,"githubUrl":"https://github.com/dgraph-io/dgraph/blob/759e242be62c91f8d084da06ad0c8d21256d9c07/query/query.go#L1355-L1391","documentation":"When building pb.node messages for a subgraph during result construction, Dgraph handles only known cases: value-variable nodes, uid with count, and a few others. Any subgraph whose attribute and parameters do not match a supported case falls into the default branch and produces this internal error, naming the node attr and its parent's attr.","triggerScenarios":"A query shape reaches fillForVal/pb.node construction with an Attr/parameter combination that is neither a value-var source nor 'uid' with DoCount — typically an unsupported aggregation/variable combination or an internal bug triggered by unusual query syntax.","commonSituations":"Exotic queries mixing value variables and count(uid) on the same edge; server bugs on edge-case queries; version mismatch between client query syntax and server support.","solutions":["Simplify the query to isolate which clause triggers the unhandled node case","Remove the value-variable/count combination on the offending predicate and split into two queries","Upgrade Dgraph — this is often an internal bug fixed in later releases","File an issue with the minimal reproducing query if it persists"],"exampleFix":"// before: unsupported mix on one edge\nme(func: uid(1)) { friend { c as count(uid) } x as sum(val(c)) }\n// after: split concerns\nme(func: uid(1)) { friend { c as count(uid) } }\ny(func: uid(1)) { f as friend { friend { uid } } }","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"Unhandled pb.node\") {\n    // internal case: isolate the offending clause and simplify the query\n    return fmt.Errorf(\"unsupported query shape: %w\", err)\n}","preventionTips":["Avoid exotic combinations of value variables and count(uid) on the same edge","Pin a known-good Dgraph server version and upgrade deliberately","Reproduce complex queries in Ratel before shipping","Report minimal reproducers to Dgraph if this internal error appears"],"tags":["dgraph","internal","query","pb-node"],"backgroundTag":"dgraph-unsupported-query-shape","analyzedSha":"759e242be62c91f8d084da06ad0c8d21256d9c07","analyzedAt":"2026-09-01T14:42:12.034Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}