{"record":{"id":"b1bfc0e795edb822","repo":"ipfs/kubo","slug":"failed-to-check-pin-status-for-requestid-q-due-to","errorCode":null,"errorMessage":"failed to check pin status for requestid=%q due to error: %v","messagePattern":"failed to check pin status for requestid=%q due to error: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/commands/pin/remotepin.go","lineNumber":240,"sourceCode":"\t\t\t// TODO: confirm this works as expected\n\t\t\tp, err := peer.AddrInfoFromP2pAddr(d)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif err := api.Swarm().Connect(ctx, *p); err != nil {\n\t\t\t\tlog.Infof(\"error connecting to remote pin delegate %v : %w\", d, err)\n\t\t\t}\n\t\t}\n\n\t\t// Block unless --background=true is passed\n\t\tif !req.Options[pinBackgroundOptionName].(bool) {\n\t\t\tconst pinWaitTime = 500 * time.Millisecond\n\t\t\tvar timer *time.Timer\n\t\t\trequestID := ps.GetRequestId()\n\t\t\tfor {\n\t\t\t\tps, err = c.GetStatusByID(ctx, requestID)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"failed to check pin status for requestid=%q due to error: %v\", requestID, err)\n\t\t\t\t}\n\t\t\t\tif ps.GetRequestId() != requestID {\n\t\t\t\t\treturn fmt.Errorf(\"failed to check pin status for requestid=%q, remote service sent unexpected requestid=%q\", requestID, ps.GetRequestId())\n\t\t\t\t}\n\t\t\t\ts := ps.GetStatus()\n\t\t\t\tif s == pinclient.StatusPinned {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tif s == pinclient.StatusFailed {\n\t\t\t\t\treturn fmt.Errorf(\"remote service failed to pin requestid=%q\", requestID)\n\t\t\t\t}\n\t\t\t\tif timer == nil {\n\t\t\t\t\ttimer = time.NewTimer(pinWaitTime)\n\t\t\t\t} else {\n\t\t\t\t\ttimer.Reset(pinWaitTime)\n\t\t\t\t}\n\t\t\t\tselect {\n\t\t\t\tcase <-timer.C:","sourceCodeStart":222,"sourceCodeEnd":258,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/core/commands/pin/remotepin.go#L222-L258","documentation":"When `ipfs pin remote add --background` (or service requiring polling) runs, kubo polls the remote pinning service with `GetStatusByID` using the returned request ID until the pin settles. If any status poll fails (network error, service 4xx/5xx, auth failure), it wraps the underlying error in this message. It is a pass-through wrapper: the real cause is the `%v` suffix.","triggerScenarios":"Remote pinning service temporarily unreachable or returning HTTP errors while kubo polls; invalid/expired service credentials causing per-request rejections; request ID lost on the service side (e.g. pin garbage-collected on the remote).","commonSituations":"Using pinning services behind flaky networks or rate limits; wrong/rotated API tokens in `ipfs pin remote service add`; service restarts losing queued pin requests mid-poll.","solutions":["Read the wrapped `%v` cause and fix it (auth token, connectivity, rate limit).","Retry the operation: check status manually with `ipfs pin remote ls --service=<svc> --status=pinned|failed` to see whether the pin eventually succeeded.","Re-issue the `pin remote add` if the remote request was dropped; request IDs are not recoverable.","Verify service config with `ipfs pin remote services ls` and re-add with correct endpoint/key.","Add retry/backoff around background pin operations in automation."],"exampleFix":"// before\nclient.Request(\"pin/remote/add\").Option(\"service\", svc).Option(\"bg\", true).Arguments(cid).Send(ctx)\n// after — verify service auth up front and surface cause\nif err := verifyServiceAuth(ctx, svc); err != nil { return fmt.Errorf(\"remote pin service %s unavailable: %w\", svc, err) }\nclient.Request(\"pin/remote/add\").Option(\"service\", svc).Option(\"bg\", true).Arguments(cid).Send(ctx)","handlingStrategy":"retry","validationCode":"// verify service credentials and reachability before a background add\nif err := client.Request(\"pin/remote/services/ls\").Send(ctx); err != nil {\n    return fmt.Errorf(\"remote pinning service unreachable: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"for attempt := 0; attempt < 3; attempt++ {\n    if err := remotePinAdd(ctx, svc, cid); err != nil {\n        if strings.Contains(err.Error(), \"failed to check pin status\") {\n            time.Sleep(backoff(attempt)); continue\n        }\n        return err\n    }\n    break\n}\n// afterwards confirm with: ipfs pin remote ls --service=svc --status=pinned","preventionTips":["Monitor `pin remote ls --status=failed|pinned` after background adds","Keep service API tokens valid and rotated in config","Add exponential backoff retries around background pin polling","Check service uptime/rate limits before bulk pin operations"],"tags":["network","ipfs","pinning","remote-service","polling"],"backgroundTag":"remote-pin-status-check-failed","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"}