{"record":{"id":"da842551c280cbfe","repo":"ipfs/kubo","slug":"unrecognized-type","errorCode":null,"errorMessage":"unrecognized type","messagePattern":"unrecognized type","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/commands/files.go","lineNumber":777,"sourceCode":"\t\t\tout := &filesLsOutput{[]mfs.NodeListing{{Name: name}}}\n\t\t\tif long {\n\t\t\t\tout.Entries[0].Type = int(fsn.Type())\n\n\t\t\t\tsize, err := fsn.Size()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tout.Entries[0].Size = size\n\n\t\t\t\tnd, err := fsn.GetNode()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tout.Entries[0].Hash = enc.Encode(nd.Cid())\n\t\t\t}\n\t\t\treturn cmds.EmitOnce(res, out)\n\t\tdefault:\n\t\t\treturn errors.New(\"unrecognized type\")\n\t\t}\n\t},\n\tEncoders: cmds.EncoderMap{\n\t\tcmds.Text: cmds.MakeTypedEncoder(func(req *cmds.Request, w io.Writer, out *filesLsOutput) error {\n\t\t\tnoSort, _ := req.Options[dontSortOptionName].(bool)\n\t\t\tif !noSort {\n\t\t\t\tslices.SortFunc(out.Entries, func(a, b mfs.NodeListing) int {\n\t\t\t\t\treturn strings.Compare(a.Name, b.Name)\n\t\t\t\t})\n\t\t\t}\n\n\t\t\tlong, _ := req.Options[longOptionName].(bool)\n\t\t\tfor _, o := range out.Entries {\n\t\t\t\tif long {\n\t\t\t\t\tif o.Type == int(mfs.TDir) {\n\t\t\t\t\t\to.Name += \"/\"\n\t\t\t\t\t}\n\t\t\t\t\tfmt.Fprintf(w, \"%s\\t%s\\t%d\\n\", o.Name, o.Hash, o.Size)","sourceCodeStart":759,"sourceCodeEnd":795,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/core/commands/files.go#L759-L795","documentation":"'ipfs files ls' hit its default arm when classifying the looked-up MFS node: fsn.Type() returned a directory-entry type the switch does not cover (only file/directory cases are handled). Indicates an MFS node in an unexpected state rather than bad user input.","triggerScenarios":"Thrown at core/commands/files.go:777 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the listing; the MFS tree may be in a transient state","Restart the daemon to rebuild the MFS root from the filesystem","Report persistent occurrences to the kubo tracker"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}