ipfs/kubo · error
invalid probe CID: %w
Error message
invalid probe CID: %w
What it means
`ipfs diag healthy` decodes a hardcoded probe CID constant (diagHealthyProbeCIDStr); if cid.Decode fails the command wraps the error as 'invalid probe CID'. This indicates the compiled-in probe CID constant is malformed — effectively a build/code defect, not user input.
Source
Thrown at core/commands/diag.go:64
Helptext: cmds.HelpText{
Tagline: "Report whether the daemon is operational.",
ShortDescription: `
Exits 0 if the daemon is running and can resolve the well-known empty
UnixFS directory. Exits non-zero if shutdown has started or the DAG
pipeline is broken. Intended for container healthchecks.
`,
},
Run: func(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error {
if t := shutdown.StartedAt(); !t.IsZero() {
return fmt.Errorf("daemon is shutting down (started %s ago)", time.Since(t).Round(time.Second))
}
api, err := cmdenv.GetApi(env, req)
if err != nil {
return err
}
probeCID, err := cid.Decode(diagHealthyProbeCIDStr)
if err != nil {
return fmt.Errorf("invalid probe CID: %w", err)
}
if _, _, err := api.ResolvePath(req.Context, path.FromCid(probeCID)); err != nil {
return fmt.Errorf("probe resolve: %w", err)
}
if _, err := api.Dag().Get(req.Context, probeCID); err != nil {
return fmt.Errorf("probe fetch: %w", err)
}
return cmds.EmitOnce(res, "ok")
},
}
var diagDatastoreCmd = &cmds.Command{
Status: cmds.Experimental,
Helptext: cmds.HelpText{
Tagline: "Low-level datastore inspection for debugging and testing.",
ShortDescription: `
'ipfs diag datastore' provides low-level access to the datastore for debugging
and testing purposes.View on GitHub (pinned to 329838acdf)
Solutions
- Rebuild kubo from a clean upstream checkout
- Inspect diagHealthyProbeCIDStr in core/commands/diag.go and fix the constant
- File an issue if it occurs on an official release
Example fix
// before const diagHealthyProbeCIDStr = "bafy...typo" // after const diagHealthyProbeCIDStr = "bafkreiefnkxuhnqny3rjrkxqnmu4fyptx47vs3s25v7dlo7kcqbkqg3mka" // valid CID
Defensive patterns
Strategy: try-catch
Try / catch
if _, err := cid.Decode(probeCIDStr); err != nil { return fmt.Errorf("invalid probe CID: %w", err) }
// catch: inspect wrapped cid error, fix the constant Prevention
- Keep the probe CID constant as a tested value
- Add a unit test asserting cid.Decode(diagHealthyProbeCIDStr) succeeds
When it happens
Trigger: cid.Decode(diagHealthyProbeCIDStr) returns an error, i.e. the constant in core/commands/diag.go is not a valid CID string.
Common situations: Patched/forked builds where the constant was edited incorrectly; rarely seen in upstream builds.
Related errors
- Import.CidVersion must be 0 or 1, got %d
- inline-limit %d exceeds maximum allowed size of %d bytes
- unknown event type
- missing option "mhlen"
- invalid format string: %q
AI-assisted analysis of ipfs/kubo@329838acdf (2026-09-03).
Data as JSON: /api/errors/be649afff915c85e.
Report an issue: GitHub.