ipfs/kubo · error
%s is not a valid path: %w
Error message
%s is not a valid path: %w
What it means
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.
Source
Thrown at core/commands/files.go:1410
if flush, ok := flushOpt.(bool); ok && !flush {
return fmt.Errorf("files rm always flushes for safety. The --flush flag cannot be set to false for this command")
}
}
nd, err := cmdenv.GetNode(env)
if err != nil {
return err
}
defer mfsPinLock(nd, req.Context).Unlock(req.Context)
// if '--force' specified, it will remove anything else,
// including file, directory, corrupted node, etc
force, _ := req.Options[forceOptionName].(bool)
dashr, _ := req.Options[recursiveOptionName].(bool)
var errs []error
for _, arg := range req.Arguments {
path, err := checkPath(arg)
if err != nil {
errs = append(errs, fmt.Errorf("%s is not a valid path: %w", arg, err))
continue
}
if err := removePath(nd.FilesRoot, path, force, dashr); err != nil {
errs = append(errs, fmt.Errorf("%s: %w", path, err))
}
}
if len(errs) > 0 {
for _, err = range errs {
e := res.Emit(err.Error())
if e != nil {
return e
}
}
return fmt.Errorf("can't remove some files")
}
return nil
},View on GitHub (pinned to 329838acdf)
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.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at core/commands/files.go:1410 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of ipfs/kubo@329838acdf (2026-09-03).
Data as JSON: /api/errors/3fae9be590f85c31.
Report an issue: GitHub.