{"record":{"id":"31bf1bf417144040","repo":"ipfs/kubo","slug":"unrecognized-node-type-s","errorCode":null,"errorMessage":"unrecognized node type: %s","messagePattern":"unrecognized node type: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/commands/files.go","lineNumber":416,"sourceCode":"\td, err := ft.FSNodeFromBytes(n.Data())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tstat := statOutput{\n\t\tHash:           enc.Encode(cid),\n\t\tBlocks:         len(n.Links()),\n\t\tSize:           d.FileSize(),\n\t\tCumulativeSize: cumulsize,\n\t}\n\n\tswitch d.Type() {\n\tcase ft.TDirectory, ft.THAMTShard:\n\t\tstat.Type = \"directory\"\n\tcase ft.TFile, ft.TSymlink, ft.TMetadata, ft.TRaw:\n\t\tstat.Type = \"file\"\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unrecognized node type: %s\", d.Type())\n\t}\n\n\tif mode := d.Mode(); mode != 0 {\n\t\tstat.Mode = uint32(mode)\n\t} else if d.Type() == ft.TSymlink {\n\t\tstat.Mode = uint32(os.ModeSymlink | 0x1FF)\n\t}\n\n\tif mt := d.ModTime(); !mt.IsZero() {\n\t\tstat.Mtime = mt.Unix()\n\t\tif ns := mt.Nanosecond(); ns > 0 {\n\t\t\tstat.MtimeNsecs = ns\n\t\t}\n\t}\n\n\treturn &stat, nil\n}\n","sourceCodeStart":398,"sourceCodeEnd":434,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/core/commands/files.go#L398-L434","documentation":"`ipfs files stat` encountered an MFS/UnixFS node whose type is not one of directory, HAMTShard, file, symlink, metadata, or raw. This error means the internal node kind returned by the node's Type() does not map to any supported stat output category, which normally indicates an unsupported or corrupt node type rather than user input error.","triggerScenarios":"Running `ipfs files stat <path>` where the node at the path has a UnixFS node type outside ft.TDirectory, ft.THAMTShard, ft.TFile, ft.TSymlink, ft.TMetadata, or ft.TRaw (e.g. a future/new UnixFS type produced by a newer node version, or a corrupted node).","commonSituations":"Reading an MFS entry written by a newer IPFS version with a node type this binary doesn't know; corrupted repo datastore entries; using stat on a path whose block data failed to parse into a known UnixFS type.","solutions":["Upgrade kubo to the latest version so it recognizes all current UnixFS node types","Verify the path points to a normal file or directory created by `ipfs files`","Re-add or re-create the affected MFS entry, as the node data may be corrupted","Check the underlying block with `ipfs dag get <cid>` to inspect the actual node type"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// before stat, confirm the node is a known type\nout, err := run(\"ipfs\", \"files\", \"ls\", filepath.Dir(p))\nif err != nil { return err }\nif !strings.Contains(out, filepath.Base(p)) { return fmt.Errorf(\"path %s missing\", p) }","typeGuard":null,"tryCatchPattern":"if err := ipfsFilesStat(p); err != nil {\n    if strings.Contains(err.Error(), \"unrecognized node type\") {\n        // fall back to `ipfs dag get` to inspect the raw node, or upgrade kubo\n    }\n}","preventionTips":["Keep kubo up to date so all UnixFS node types are recognized","Only build MFS trees with `ipfs files add/cp/mkdir`, not hand-crafted DAGs","Pin and verify MFS roots after writes"],"tags":["mfs","unixfs","cli"],"backgroundTag":"unsupported-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"}