ipfs/kubo · error
msg (server-provided error message)
Error message
msg (server-provided error message)
What it means
parseErrNotFoundWithFallbackToMSG first tries to interpret the daemon's error string as a structured 'ipld not found' error; if it cannot, it returns the raw server-provided message wrapped in errors.New(msg). The message text is whatever the daemon sent, so its content is not produced by this library.
Source
Thrown at client/rpc/errors.go:40
func (e prePostWrappedNotFoundError) String() string {
return e.Error()
}
func (e prePostWrappedNotFoundError) Error() string {
return e.pre + e.wrapped.Error() + e.post
}
func (e prePostWrappedNotFoundError) Unwrap() error {
return e.wrapped
}
func parseErrNotFoundWithFallbackToMSG(msg string) error {
err, handled := parseErrNotFound(msg)
if handled {
return err
}
return errors.New(msg)
}
func parseErrNotFoundWithFallbackToError(msg error) error {
err, handled := parseErrNotFound(msg.Error())
if handled {
return err
}
return msg
}
func parseErrNotFound(msg string) (error, bool) {
if msg == "" {
return nil, true // Fast path
}
if err, handled := parseIPLDErrNotFound(msg); handled {
return err, trueView on GitHub (pinned to 329838acdf)
Solutions
- Read the message text: it is the daemon's own error, and the fix depends on what the daemon said (path missing, permission denied, timeout, etc.).
- If the path truly exists, verify you are connecting to the intended node (Addresses.API / --api) and that the CID/path is correct.
- Upgrade go-ipfs-api so more daemon error strings are parsed into typed errors instead of falling back to raw text.
Defensive patterns
Strategy: try-catch
Type guard
func isNotFound(err error) bool {
var nf iface.ErrIsDir // example narrowing; primary check is string pattern
if errors.As(err, &nf) { return true }
return strings.Contains(err.Error(), "not found")
} Try / catch
_, err := api.Dag().Get(ctx, p)
if err != nil {
if strings.Contains(err.Error(), "not found") {
// handle absence
} else {
// raw server error; inspect message and daemon logs
}
} Prevention
- Read the error message directly — it is the daemon's own failure reason
- Verify you target the intended node (Addresses.API / --api) before debugging the message
- Keep the client updated so more daemon errors parse into typed errors
When it happens
Trigger: Any RPC call (e.g. api.Object().Get, api.Dag().Get via this helper path) whose daemon response is an error that does not match the recognized 'not found under ...' pattern — for example a permission, timeout, or generic server error passed through this fallback.
Common situations: Daemon-side errors like 'file does not exist', blocked/permission errors, or new daemon error formats the old client does not recognize arriving during dag/object lookups.
Related errors
- unknowm mhType %d
- cids didn't match - local %s, remote %s
- got unexpected number of keys back
- Name.Resolve: depth other than 1 or %d not supported
- http api returned no error and no results
AI-assisted analysis of ipfs/kubo@329838acdf (2026-09-03).
Data as JSON: /api/errors/3ddc39d65a8584a9.
Report an issue: GitHub.