{"record":{"id":"cabcd0880339d59b","repo":"ipfs/kubo","slug":"t-is-not-a-valid-ipld-node","errorCode":null,"errorMessage":"%T is not a valid IPLD node","messagePattern":"%T is not a valid IPLD node","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/commands/dag/get.go","lineNumber":51,"sourceCode":"\n\tp, err := cmdutils.PathOrCidPath(req.Arguments[0])\n\tif err != nil {\n\t\treturn err\n\t}\n\n\trp, remainder, err := api.ResolvePath(req.Context, p)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tobj, err := api.Dag().Get(req.Context, rp.RootCid())\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tuniversal, ok := obj.(ipldlegacy.UniversalNode)\n\tif !ok {\n\t\treturn fmt.Errorf(\"%T is not a valid IPLD node\", obj)\n\t}\n\n\tfinalNode := universal.(ipld.Node)\n\n\tif len(remainder) > 0 {\n\t\tremainderPath := ipld.ParsePath(path.SegmentsToString(remainder...))\n\n\t\tfinalNode, err = traversal.Get(finalNode, remainderPath)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tencoder, err := multicodec.LookupEncoder(uint64(codec))\n\tif err != nil {\n\t\treturn fmt.Errorf(\"invalid encoding: %s - %s\", codec, err)\n\t}\n","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/core/commands/dag/get.go#L33-L69","documentation":"`ipfs dag get` resolves the requested path and expects the result object to implement `ipldlegacy.UniversalNode` so it can be narrowed to an `ipld.Node` for traversal/serialization. If the resolved value is some other type (an internal contract violation of the resolver/GetAPI), the command refuses with this error naming the unexpected Go type via `%T`.","triggerScenarios":"Calling `ipfs dag get` (possibly with a path suffix/remainder) where the underlying API's `Get` returns a value that is not an IPLD node — e.g. an unexpected resolver output for the given codec, or a patched/mismatched coreapi layer.","commonSituations":"Requesting a CID/path whose codec resolves through a code path returning a non-node object; mixed kubo/boxo versions where the node interfaces changed; a bug in a custom resolver or plugin.","solutions":["Note the `%T` type name in the error and file a bugreport at https://github.com/ipfs/kubo/issues.","Ensure CLI and daemon versions match and no patched boxo/coreapi is in use.","Try the same CID without a path suffix to see if plain node retrieval works.","Check `ipfs dag get --output-codec` / alternate codecs as a workaround while investigating."],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":"func asIPLDNode(v any) (ipld.Node, bool) {\n    u, ok := v.(ipldlegacy.UniversalNode)\n    if !ok {\n        return nil, false\n    }\n    n, ok := u.(ipld.Node)\n    return n, ok\n}","tryCatchPattern":"if strings.HasSuffix(err.Error(), \"is not a valid IPLD node\") {\n    // capture the %T type and report at github.com/ipfs/kubo/issues\n}","preventionTips":["Keep kubo and boxo versions matched to avoid interface drift.","Test `ipfs dag get <cid>` without path suffixes when debugging exotic codecs.","Avoid patched coreapi/resolver code that could return non-node values."],"tags":["ipld","dag-get","type-mismatch","bugreport"],"backgroundTag":"invalid-ipld-node-type","analyzedSha":"329838acdfafae224582930457efe80aa217afc0","analyzedAt":"2026-09-03T18:30:52.135Z","contentChangedAt":"2026-09-03T18:30:52.135Z","schemaVersion":2},"datasetVersion":"2026-09-11T00:17:11.886Z"}