{"record":{"id":"ce5fa07d9b135d14","repo":"ipfs/kubo","slug":"file-type-d-not-supported","errorCode":null,"errorMessage":"file type %d not supported","messagePattern":"file type (.+?) not supported","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/rpc/apifile.go","lineNumber":259,"sourceCode":"\t\tit.curFile, err = it.core.getDir(it.ctx, path.FromCid(c), int64(it.cur.Size), it.cur.Mode, it.cur.ModTime)\n\t\tif err != nil {\n\t\t\tit.err = err\n\t\t\treturn false\n\t\t}\n\tcase unixfs.TFile:\n\t\tit.curFile, err = it.core.getFile(it.ctx, path.FromCid(c), int64(it.cur.Size), it.cur.Mode, it.cur.ModTime)\n\t\tif err != nil {\n\t\t\tit.err = err\n\t\t\treturn false\n\t\t}\n\tcase unixfs.TSymlink:\n\t\tit.curFile, err = it.core.getSymlink(it.ctx, path.FromCid(c), it.cur.ModTime)\n\t\tif err != nil {\n\t\t\tit.err = err\n\t\t\treturn false\n\t\t}\n\tdefault:\n\t\tit.err = fmt.Errorf(\"file type %d not supported\", it.cur.Type)\n\t\treturn false\n\t}\n\treturn true\n}\n\nfunc (it *apiIter) Node() files.Node {\n\treturn it.curFile\n}\n\ntype apiDir struct {\n\tctx  context.Context\n\tcore *UnixfsAPI\n\tsize int64\n\tpath path.Path\n\n\tmode  os.FileMode\n\tmtime time.Time\n","sourceCodeStart":241,"sourceCodeEnd":277,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/client/rpc/apifile.go#L241-L277","documentation":"During directory iteration, apiIter switches on it.cur.Type (a numeric UnixFS entry type from the ls RPC) to build the files.Node: file, directory, or symlink. Any other numeric type hits the default branch and records this error, stopping iteration. It guards against new/unknown entry types the client cannot materialize locally.","triggerScenarios":"Iterating a directory (via UnixfsAPI.Get on a directory path) that contains an entry whose ls Type value is not one of the known numeric constants (0/1/2/3 per the RPC schema) — usually a type added by a newer daemon.","commonSituations":"Newer daemon listing HAMT shards or raw nodes that this client cannot represent; version-skewed client/daemon; custom servers emitting out-of-range Type values.","solutions":["Upgrade client/rpc so it recognizes the entry type reported by the daemon","Align kubo versions between client and daemon","Inspect entry types with `ipfs ls <dir>` to identify the offending type","Skip or substitute unknown entries in your own iteration code if you call the ls RPC directly"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// pre-list the directory and skip unknown numeric types\nvar out struct{ Objects []struct{ Links []struct{ Type int `json:\"Type\"` } `json:\"Links\"` } `json:\"Objects\"` }\n_ = api.Request(\"ls\").Option(\"arg\", dir).Exec(ctx, &out)\nfor _, l := range out.Objects[0].Links {\n    if l.Type < 0 || l.Type > 3 { log.Printf(\"skipping entry with unknown type %d\", l.Type) }\n}","typeGuard":"func knownLsEntryType(t int) bool { return t >= 0 && t <= 3 }","tryCatchPattern":"if strings.Contains(err.Error(), \"file type \") && strings.Contains(err.Error(), \"not supported\") {\n    // skip the entry or upgrade the client\n    return iterateSkippingUnknown(ctx, api, dir)\n}","preventionTips":["Keep client/rpc upgraded with the daemon","Inspect `ipfs ls <dir>` for exotic entry types before iterating","Skip/flag unknown types in custom tooling instead of failing the whole walk"],"tags":["go","ipfs","rpc","unixfs"],"backgroundTag":"unsupported-file-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"}