{"record":{"id":"d005436e1622d974","repo":"ipfs/kubo","slug":"failed-to-decode-multibase-w","errorCode":null,"errorMessage":"failed to decode multibase: %w","messagePattern":"failed to decode multibase: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/commands/multibase.go","lineNumber":114,"sourceCode":"\tArguments: []cmds.Argument{\n\t\tcmds.FileArg(\"encoded_file\", true, false, \"encoded data to decode\").EnableStdin(),\n\t},\n\tRun: func(req *cmds.Request, resp cmds.ResponseEmitter, env cmds.Environment) error {\n\t\tif err := req.ParseBodyArgs(); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfiles := req.Files.Entries()\n\t\tfile, err := cmdenv.GetFileArg(files)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to access file: %w\", err)\n\t\t}\n\t\tencodedData, err := io.ReadAll(file)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to read file contents: %w\", err)\n\t\t}\n\t\t_, data, err := mbase.Decode(string(encodedData))\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to decode multibase: %w\", err)\n\t\t}\n\t\treader := bytes.NewReader(data)\n\t\treturn resp.Emit(reader)\n\t},\n}\n\nvar mbaseTranscodeCmd = &cmds.Command{\n\tHelptext: cmds.HelpText{\n\t\tTagline: \"Transcode multibase string between bases\",\n\t\tLongDescription: `\nThis command expects multibase inside of a file or via stdin.\n\nBy default it will use URL-safe base64url encoding,\nbut one can customize used base with -b:\n\n  > echo -n hello | ipfs multibase encode > file\n  > cat file\n  uaGVsbG8","sourceCodeStart":96,"sourceCodeEnd":132,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/core/commands/multibase.go#L96-L132","documentation":"Failure in `ipfs multibase decode`: mbase.Decode could not parse the input string as any multibase — the data either lacks a valid multibase prefix character or is corrupted after the prefix. Wraps the underlying decode error; the encoder name is not needed since it is self-describing in multibase.","triggerScenarios":"Thrown at core/commands/multibase.go:114 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the input starts with a valid multibase prefix (e.g. 'u' for base64url, 'z' for base58btc)","Re-copy the encoded string; trailing newlines or whitespace can corrupt it","Re-encode the original data if the source is lost"],"exampleFix":null,"handlingStrategy":"validation","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"}