{"record":{"id":"5a288f4321fd58fb","repo":"ipfs/kubo","slug":"error-while-listing-remote-pins-v","errorCode":null,"errorMessage":"error while listing remote pins: %v","messagePattern":"error while listing remote pins: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/ipfs/kubo/pinmfs.go","lineNumber":218,"sourceCode":"\tpinStatusMsg := \"pinning to %q: received pre-existing %q status for %q (requestid=%q)\"\n\tfor ps := range lsPinCh {\n\t\texistingRequestID = ps.GetRequestId()\n\t\tif ps.GetPin().GetCid() == cid && ps.GetStatus() == pinclient.StatusFailed {\n\t\t\tmfslog.Errorf(pinStatusMsg, svcName, pinclient.StatusFailed, cid, existingRequestID)\n\t\t} else {\n\t\t\tmfslog.Debugf(pinStatusMsg, svcName, ps.GetStatus(), ps.GetPin().GetCid(), existingRequestID)\n\t\t}\n\t\tif ps.GetPin().GetCid() == cid && ps.GetStatus() != pinclient.StatusFailed {\n\t\t\tpinning = true\n\t\t\tpinTime = ps.GetCreated().UTC()\n\t\t\tbreak\n\t\t}\n\t}\n\tfor range lsPinCh { // in case the prior loop exits early\n\t}\n\terr := <-lsErrCh\n\tif err != nil {\n\t\treturn lastPin{}, fmt.Errorf(\"error while listing remote pins: %v\", err)\n\t}\n\n\tif !pinning {\n\t\t// Prepare Pin.name\n\t\taddOpts := []pinclient.AddOption{pinclient.PinOpts.WithName(pinName)}\n\n\t\t// Prepare Pin.origins\n\t\t// Add own multiaddrs to the 'origins' array, so Pinning Service can\n\t\t// use that as a hint and connect back to us (if possible)\n\t\tif node.PeerHost() != nil {\n\t\t\taddrs, err := peer.AddrInfoToP2pAddrs(host.InfoFromHost(node.PeerHost()))\n\t\t\tif err != nil {\n\t\t\t\treturn lastPin{}, err\n\t\t\t}\n\t\t\taddOpts = append(addOpts, pinclient.PinOpts.WithOrigins(addrs...))\n\t\t}\n\n\t\t// Create or replace pin for MFS root","sourceCodeStart":200,"sourceCodeEnd":236,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/cmd/ipfs/kubo/pinmfs.go#L200-L236","documentation":"Thrown by pinMFS when listing the node's current remote pins from the configured remote pinning service fails: the error received on lsErrCh after the paginated list finishes (or exits early) is non-nil. pinMFS uses this list to decide whether the MFS root is already pinned remotely; listing failure aborts the whole MFS pin operation. Kubo intentionally blocks on this to avoid duplicate or lost pins.","triggerScenarios":"Remote pinning service (Pinata, web3.storage, etc.) returns an error on the LIST /pins endpoint: invalid or expired service API key, service outage/5xx, rate limiting, network failure, or a service that does not implement the pinning-service API list endpoint.","commonSituations":"`ipfs pin remote add --service=...` against a service whose credentials were rotated; Pinata rate limits; self-hosted pinning services behind a broken proxy; services implementing only add/status but not full list.","solutions":["Verify the pinning service is configured and reachable: `ipfs pin remote service ls` and test credentials with `ipfs pin remote ls --service=<name>`.","Fix or rotate the service API key in the config: `ipfs pin remote service add <name> <url> <key>`.","Check the service's status/rate limits; wait and retry if it is a 429/5xx.","Use `--background=false`/retry after connectivity issues resolve, or temporarily pin via a different service."],"exampleFix":"// before\nipfs pin remote add /ipfs/<cid> --service=pinata   # stale key -> list fails\n// after\nipfs pin remote service add pinata https://api.pinata.cloud/psa <NEW_API_KEY>\nipfs pin remote add /ipfs/<cid> --service=pinata","handlingStrategy":"try-catch","validationCode":"// verify the pinning service before pinning MFS remotely\nif _, err := exec.Command(\"ipfs\", \"pin\", \"remote\", \"ls\",\n\t\"--service=myService\").Output(); err != nil {\n\treturn fmt.Errorf(\"pinning service unavailable, fix service/key first: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"if err := pinMFS(ctx, nd, svc, opts); err != nil {\n\tvar pe *ipfs.PinDirError\n\tif strings.Contains(err.Error(), \"listing remote pins\") {\n\t\t// service-side problem: check key/outage, optionally retry with backoff\n\t\treturn retryWithBackoff(func() error { return pinMFS(ctx, nd, svc, opts) })\n\t}\n\treturn err\n}","preventionTips":["Test `ipfs pin remote ls --service=<name>` after any API key rotation","Check the pinning service's status page and rate limits before bulk operations","Confirm the service implements the full IPFS Pinning Service API (including LIST)"],"tags":["remote-pinning","network","api"],"backgroundTag":"pinning-service-list-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"}