{"record":{"id":"ab8b3373357b4a9c","repo":"ipfs/kubo","slug":"can-t-remove-some-files","errorCode":null,"errorMessage":"can't remove some files","messagePattern":"can't remove some files","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/commands/files.go","lineNumber":1425,"sourceCode":"\t\tfor _, arg := range req.Arguments {\n\t\t\tpath, err := checkPath(arg)\n\t\t\tif err != nil {\n\t\t\t\terrs = append(errs, fmt.Errorf(\"%s is not a valid path: %w\", arg, err))\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif err := removePath(nd.FilesRoot, path, force, dashr); err != nil {\n\t\t\t\terrs = append(errs, fmt.Errorf(\"%s: %w\", path, err))\n\t\t\t}\n\t\t}\n\t\tif len(errs) > 0 {\n\t\t\tfor _, err = range errs {\n\t\t\t\te := res.Emit(err.Error())\n\t\t\t\tif e != nil {\n\t\t\t\t\treturn e\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn fmt.Errorf(\"can't remove some files\")\n\t\t}\n\t\treturn nil\n\t},\n}\n\nfunc removePath(filesRoot *mfs.Root, path string, force bool, dashr bool) error {\n\tif path == \"/\" {\n\t\treturn fmt.Errorf(\"cannot delete root\")\n\t}\n\n\t// 'rm a/b/c/' will fail unless we trim the slash at the end\n\tif path[len(path)-1] == '/' {\n\t\tpath = path[:len(path)-1]\n\t}\n\n\tdir, name := gopath.Split(path)\n\n\tpdir, err := getParentDir(filesRoot, dir)","sourceCodeStart":1407,"sourceCodeEnd":1443,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/core/commands/files.go#L1407-L1443","documentation":"Aggregate result of `ipfs files rm` when at least one of the requested paths failed (invalid path or removal error). Each individual error was already emitted to the response stream; this final error signals the command as a whole did not fully succeed, while some paths may have been removed.","triggerScenarios":"Thrown at core/commands/files.go:1425 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read the per-path errors emitted before this message to see which arguments failed.","Re-run `ipfs files rm` for only the paths that were not removed; removals are idempotent, and already-removed paths with --force report no error."],"exampleFix":null,"handlingStrategy":"try-catch","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"}