{"record":{"id":"45de685869fbccb9","repo":"ipfs/kubo","slug":"failed-to-access-file-w","errorCode":null,"errorMessage":"failed to access file: %w","messagePattern":"failed to access file: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/commands/multibase.go","lineNumber":67,"sourceCode":"\tArguments: []cmds.Argument{\n\t\tcmds.FileArg(\"file\", true, false, \"data to encode\").EnableStdin(),\n\t},\n\tOptions: []cmds.Option{\n\t\tcmds.StringOption(mbaseOptionName, \"multibase encoding\").WithDefault(\"base64url\"),\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\tencoderName, _ := req.Options[mbaseOptionName].(string)\n\t\tencoder, err := mbase.EncoderByName(encoderName)\n\t\tif 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\tbuf, 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\tencoded := encoder.Encode(buf)\n\t\treader := strings.NewReader(encoded)\n\t\treturn resp.Emit(reader)\n\t},\n}\n\nvar mbaseDecodeCmd = &cmds.Command{\n\tHelptext: cmds.HelpText{\n\t\tTagline: \"Decode multibase string\",\n\t\tLongDescription: `\nThis command expects multibase inside of a file or via stdin:\n\n  > echo -n hello | ipfs multibase encode -b base16 > file","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/core/commands/multibase.go#L49-L85","documentation":"Failure in `ipfs multibase encode` while obtaining the input stream: cmdenv.GetFileArg could not open or access the file argument (or stdin), e.g. missing argument, unreadable path, or an empty input set. Wraps the underlying access error; no bytes were read yet.","triggerScenarios":"Thrown at core/commands/multibase.go:67 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass the data explicitly: ipfs multibase encode <file> or pipe via stdin","Check the file exists and is readable","Fix argument quoting so the shell delivers the path correctly"],"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"}