{"record":{"id":"f3cc8f88ab0cad5f","repo":"ipfs/kubo","slug":"unknown-data-field-encoding","errorCode":null,"errorMessage":"unknown data field encoding","messagePattern":"unknown data field encoding","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/commands/object/object.go","lineNumber":19,"sourceCode":"package objectcmd\n\nimport (\n\t\"errors\"\n\n\tcmds \"github.com/ipfs/go-ipfs-cmds\"\n)\n\ntype Link struct {\n\tName, Hash string\n\tSize       uint64\n}\n\ntype Object struct {\n\tHash  string `json:\"Hash,omitempty\"`\n\tLinks []Link `json:\"Links,omitempty\"`\n}\n\nvar ErrDataEncoding = errors.New(\"unknown data field encoding\")\n\nvar ObjectCmd = &cmds.Command{\n\tStatus: cmds.Deprecated, // https://github.com/ipfs/kubo/issues/7936\n\tHelptext: cmds.HelpText{\n\t\tTagline: \"Deprecated commands to interact with dag-pb objects. Use 'dag' or 'files' instead.\",\n\t\tShortDescription: `\n'ipfs object' is a legacy plumbing command used to manipulate dag-pb objects\ndirectly. Deprecated, use more modern 'ipfs dag' and 'ipfs files' instead.`,\n\t},\n\n\tSubcommands: map[string]*cmds.Command{\n\t\t\"data\":  RemovedObjectCmd,\n\t\t\"diff\":  ObjectDiffCmd,\n\t\t\"get\":   RemovedObjectCmd,\n\t\t\"links\": RemovedObjectCmd,\n\t\t\"new\":   RemovedObjectCmd,\n\t\t\"patch\": ObjectPatchCmd,\n\t\t\"put\":   RemovedObjectCmd,","sourceCodeStart":1,"sourceCodeEnd":37,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/core/commands/object/object.go#L1-L37","documentation":"ErrDataEncoding is a sentinel error exported by the deprecated `ipfs object` command family. The legacy `object` commands can render a DAG node's data field only in the encodings they know; when asked for an unknown data encoding they return this error. The whole ObjectCmd group is marked Deprecated in favor of `ipfs dag` and `ipfs files`.","triggerScenarios":"Calling a legacy object subcommand (e.g. `ipfs object get <cid>` variants that accept a data encoding option) with an unsupported encoding value; programmatically invoking the ObjectCmd tree with an invalid encoding argument.","commonSituations":"Users still on the deprecated `ipfs object` API (issue #7936) passing typos or encodings supported by newer `dag` tooling; scripts written against old kubo versions run on current ones.","solutions":["Migrate to `ipfs dag get <cid>` (with --output-codec for format conversion) instead of `ipfs object`.","Use `ipfs files` / MFS commands for filesystem-style operations previously done via `ipfs object`.","If an encoding value was passed, correct it to one the legacy command accepts, or better, drop the deprecated call."],"exampleFix":"// before\nipfs object get --data-encoding=bogus <cid>\n// after\nipfs dag get <cid>            # or: ipfs dag get <cid> --output-codec=raw","handlingStrategy":"fallback","validationCode":"// validate encoding against the set the legacy command supports before calling\nvar validEncodings = map[string]struct{}{\"text\": {}, \"base64\": {}}\nif _, ok := validEncodings[encoding]; !ok {\n    encoding = \"base64\" // or refuse\n}","typeGuard":null,"tryCatchPattern":"// err is the sentinel; compare directly, no unwrap needed\nif err := cmd.Run(); err != nil && errors.Is(err, object.ErrDataEncoding) {\n    // fall back to `ipfs dag get`\n}","preventionTips":["Treat the `ipfs object` tree as deprecated; use `ipfs dag`/`ipfs files` in new code.","Whitelist encoding values in scripts before invoking.","Watch for cmds.Deprecated status on commands before adopting them."],"tags":["cli","deprecated","dag-pb"],"backgroundTag":"unknown-encoding","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"}