{"record":{"id":"3fae9be590f85c31","repo":"ipfs/kubo","slug":"s-is-not-a-valid-path-w","errorCode":null,"errorMessage":"%s is not a valid path: %w","messagePattern":"(.+?) is not a valid path: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/commands/files.go","lineNumber":1410,"sourceCode":"\t\t\tif flush, ok := flushOpt.(bool); ok && !flush {\n\t\t\t\treturn fmt.Errorf(\"files rm always flushes for safety. The --flush flag cannot be set to false for this command\")\n\t\t\t}\n\t\t}\n\n\t\tnd, err := cmdenv.GetNode(env)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer mfsPinLock(nd, req.Context).Unlock(req.Context)\n\t\t// if '--force' specified, it will remove anything else,\n\t\t// including file, directory, corrupted node, etc\n\t\tforce, _ := req.Options[forceOptionName].(bool)\n\t\tdashr, _ := req.Options[recursiveOptionName].(bool)\n\t\tvar errs []error\n\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},","sourceCodeStart":1392,"sourceCodeEnd":1428,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/core/commands/files.go#L1392-L1428","documentation":"Per-argument validation in `ipfs files rm`: checkPath rejected one of the supplied paths (invalid format, not absolute, or outside MFS). The invalid argument is collected into the error list and the removal loop continues with remaining arguments; this is a generic path-validation guard, with the faulty path named in the message.","triggerScenarios":"Thrown at core/commands/files.go:1410 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use an absolute MFS path starting with '/', e.g. `ipfs files rm /foo` instead of `foo` or a filesystem path.","Verify the path spelling; the wrapped inner error names the specific checkPath failure."],"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"}