{"record":{"id":"aa3d01c2cc016490","repo":"ipfs/kubo","slug":"out-err-server-provided-error-message","errorCode":null,"errorMessage":"out.Err (server-provided error message)","messagePattern":"out\\.Err \\(server-provided error message\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/rpc/pin.go","lineNumber":229,"sourceCode":"\t\t\t\t\tCid string\n\t\t\t\t\tErr string\n\t\t\t\t}\n\t\t\t}\n\t\t\tif err := dec.Decode(&out); err != nil {\n\t\t\t\tif err == io.EOF {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tselect {\n\t\t\t\tcase res <- pinVerifyRes{err: err}:\n\t\t\t\t\treturn\n\t\t\t\tcase <-ctx.Done():\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif out.Err != \"\" {\n\t\t\t\tselect {\n\t\t\t\tcase res <- pinVerifyRes{err: errors.New(out.Err)}:\n\t\t\t\t\treturn\n\t\t\t\tcase <-ctx.Done():\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbadNodes := make([]iface.BadPinNode, len(out.BadNodes))\n\t\t\tfor i, n := range out.BadNodes {\n\t\t\t\tc, err := cid.Decode(n.Cid)\n\t\t\t\tif err != nil {\n\t\t\t\t\tbadNodes[i] = badNode{cid: c, err: err}\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tif n.Err != \"\" {\n\t\t\t\t\terr = errors.New(n.Err)\n\t\t\t\t}\n\t\t\t\tbadNodes[i] = badNode{cid: c, err: err}","sourceCodeStart":211,"sourceCodeEnd":247,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/client/rpc/pin.go#L211-L247","documentation":"During pin verify the client streams progress from the daemon; when the stream carries a final X-Stream-Error-style trailer (out.Err non-empty), the client surfaces the server-provided string verbatim via errors.New(out.Err). The text is produced by the remote daemon, not this library.","triggerScenarios":"api.Pin().Verify(ctx, path) where the daemon reports a stream-level failure mid-verification — e.g. a block fetch failed, the verification session errored out, or the connection dropped and the daemon wrote an error trailer before closing.","commonSituations":"Verifying large pinsets over unstable links, verifying content whose underlying blocks are missing from the datastore, or daemon-side timeouts during long verifications.","solutions":["Read the message to learn the daemon-side cause (missing block, timeout) and address that root cause.","Retry Verify for transient network failures; verification is read-only and idempotent.","If blocks are missing, repair with `ipfs dag stat`/re-fetch the content or re-add from source, then re-verify.","Increase the daemon timeout or run verification in smaller scopes (verify per-path) to avoid mid-stream failures."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"var lastErr error\nfor attempt := 0; attempt < 3; attempt++ {\n    res, err := api.Pin().Verify(ctx, p)\n    if err != nil {\n        lastErr = err\n        time.Sleep(backoff(attempt)) // message text indicates daemon-side cause\n        continue\n    }\n    return res, nil\n}\nreturn nil, fmt.Errorf(\"pin verify failed after retries: %w\", lastErr)","preventionTips":["Run verification with a generous context timeout for large pinsets","Verify paths individually to reduce mid-stream abort risk","Repair missing blocks reported by verify before re-running"],"tags":["pin","verify","stream-error","server-error"],"backgroundTag":"server-error-passthrough","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"}