ipfs/kubo · error
%s
Error message
%s
What it means
The text encoder for `ipfs cid inspect` re-raises the remote/processing error stored in CidInspectRes.ErrorMsg as the command's error. The message content is whatever the inspect operation put into ErrorMsg, so this is a pass-through of the underlying failure to the CLI user.
Source
Thrown at core/commands/cid.go:539
// CIDv1: use base36 for libp2p-key, base32 for everything else
v1 := cid.NewCidV1(c.Type(), c.Hash())
v1Base := mbase.Encoding(mbase.Base32)
if c.Type() == uint64(mc.Libp2pKey) {
v1Base = mbase.Base36
}
v1Str, err := v1.StringOfBase(v1Base)
if err != nil {
v1Str = v1.String()
}
res.CidV1 = v1Str
return cmds.EmitOnce(resp, res)
},
Encoders: cmds.EncoderMap{
cmds.Text: cmds.MakeTypedEncoder(func(req *cmds.Request, w io.Writer, res *CidInspectRes) error {
if res.ErrorMsg != "" {
return fmt.Errorf("%s", res.ErrorMsg)
}
implicit := ""
if res.Version == 0 {
implicit = ", implicit"
}
fmt.Fprintf(w, "CID: %s\n", res.Cid)
fmt.Fprintf(w, "Version: %d\n", res.Version)
if res.Version == 0 {
fmt.Fprintf(w, "Multibase: %s (implicit)\n", res.Multibase.Name)
} else {
fmt.Fprintf(w, "Multibase: %s (%s)\n", res.Multibase.Name, res.Multibase.Prefix)
}
fmt.Fprintf(w, "Multicodec: %s (0x%x%s)\n", res.Multicodec.Name, res.Multicodec.Code, implicit)
fmt.Fprintf(w, "Multihash: %s (0x%x%s)\n", res.Multihash.Name, res.Multihash.Code, implicit)
fmt.Fprintf(w, " Length: %d bytes\n", res.Multihash.Length)
fmt.Fprintf(w, " Digest: %s\n", res.Multihash.Digest)View on GitHub (pinned to 329838acdf)
Solutions
- Fix the underlying cause reported by the message (usually an invalid or unresolvable CID input)
- Re-run with JSON output (`--enc=json`) to see the full structured result including res.ErrorMsg
- Validate the CID with `ipfs cid format --format=%s <cid>` or a client-side cid.Decode before inspecting
Defensive patterns
Strategy: try-catch
Try / catch
err := cmd.Run()
if err != nil {
var ee *cmds.Error
if errors.As(err, &ee) {
// inspect ee.Message (the original ErrorMsg) and handle
}
} Prevention
- Use --enc=json to get structured error info instead of the text re-raise
- Validate the CID input before running inspect
- Read the res.ErrorMsg content; it names the true underlying cause
When it happens
Trigger: Running `ipfs cid inspect` (text output) when the underlying inspection failed and set res.ErrorMsg; the encoder then returns that message as an error.
Common situations: Inspecting a malformed or unresolvable CID string; daemon-side failure during inspection surfaced through the text encoder path.
Related errors
- inline-limit %d exceeds maximum allowed size of %d bytes
- invalid format string: %q
- cannot convert to CIDv0 with any codec other than dag-pb
- cannot convert to CIDv0 with any multibase other than the im
- invalid cid version: %q
AI-assisted analysis of ipfs/kubo@329838acdf (2026-09-03).
Data as JSON: /api/errors/32a0f5d1d1a4c1ef.
Report an issue: GitHub.