{"record":{"id":"8cd0df5ec09ba733","repo":"ruvnet/ruflo","slug":"pinata-list-failed-http-res-status-json-st","errorCode":null,"errorMessage":"Pinata list failed (HTTP ${res.status}): ${JSON.stringify(res.data)}","messagePattern":"Pinata list failed \\(HTTP (.+?)\\): (.+?)","errorType":"http","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/cli/src/appliance/rvfa-distribution.ts","lineNumber":377,"sourceCode":"  }\n\n  async publishPatch(patchBuf: Buffer, meta?: PublishMetadata): Promise<PublishResult> {\n    const name = meta?.name || `patch-${Date.now()}.rvfp`;\n    return this.upload(name, patchBuf, {\n      type: 'rvfp-patch', version: meta?.version || '', description: meta?.description || '',\n    });\n  }\n\n  async fetch(cid: string, outputPath: string): Promise<void> {\n    const data = await httpGet(`${this.gw}/ipfs/${cid}`);\n    await mkdir(dirname(outputPath), { recursive: true });\n    await writeFile(outputPath, data);\n  }\n\n  async list(): Promise<PublishedItem[]> {\n    const res = await pinataReq('GET', `${this.api}/data/pinList?status=pinned&pageLimit=100`, this.jwt);\n    if (res.status !== 200)\n      throw new Error(`Pinata list failed (HTTP ${res.status}): ${JSON.stringify(res.data)}`);\n    const d = res.data as { rows: Array<{\n      ipfs_pin_hash: string; metadata?: { name?: string }; size: number; date_pinned: string;\n    }> };\n    return (d.rows || []).map((r) => ({\n      cid: r.ipfs_pin_hash, name: r.metadata?.name || r.ipfs_pin_hash,\n      size: r.size, date: r.date_pinned,\n    }));\n  }\n\n  async pin(cid: string, name?: string): Promise<void> {\n    const body = Buffer.from(JSON.stringify({ hashToPin: cid, pinataMetadata: { name: name || cid } }));\n    const res = await pinataReq('POST', `${this.api}/pinning/pinByHash`, this.jwt, body, 'application/json');\n    if (res.status !== 200)\n      throw new Error(`Pinata pin failed (HTTP ${res.status}): ${JSON.stringify(res.data)}`);\n  }\n}\n\n// ── Convenience exports ──────────────────────────────────────","sourceCodeStart":359,"sourceCodeEnd":395,"githubUrl":"https://github.com/ruvnet/ruflo/blob/6b01dc5a687b26b3e218f796de45ec51f8fa9e8c/v3/@claude-flow/cli/src/appliance/rvfa-distribution.ts#L359-L395","documentation":"Thrown by RvfaPublisher.list() when Pinata's GET /data/pinList returns a non-200 status. The message includes the HTTP status and response body. list() enumerates already-pinned items for inventory/discovery and uses the same Bearer JWT as upload.","triggerScenarios":"HTTP 401/403 (JWT invalid or lacks read scope), 429 (rate limit on the list endpoint), 400 (malformed query string), or 5xx (Pinata service degradation).","commonSituations":"JWT permissions were narrowed after construction; the listing query (pageLimit=100) exceeded an account filter; rate limiting from polling list() in a tight loop; Pinata API version drift changing the endpoint contract.","solutions":["Check the HTTP status in the message; 401/403 means rotate the JWT with read+pin scopes.","For 429, throttle list() calls or cache the result rather than polling.","Confirm the Pinata API base URL (config.apiUrl) is correct and not behind a proxy that rewrites responses.","Retry transient 5xx responses; treat persistent failure as an upstream incident."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"async function safeList(pub: RvfaPublisher) {\n  try {\n    return await pub.list();\n  } catch (e) {\n    const msg = (e as Error).message;\n    if (/HTTP 401|HTTP 403/.test(msg)) throw new Error('JWT lacks read scope or is expired');\n    if (/HTTP 429|HTTP 5\\d\\d/.test(msg)) throw new Error('Transient Pinata error; retry later');\n    throw e;\n  }\n}","preventionTips":["Ensure the JWT has the read/pinList scope.","Cache list() results rather than polling in a tight loop.","Confirm config.apiUrl points to the correct Pinata API base.","Retry transient 429/5xx with exponential backoff."],"tags":["pinata","ipfs","network","list"],"backgroundTag":null,"analyzedSha":"6b01dc5a687b26b3e218f796de45ec51f8fa9e8c","analyzedAt":"2026-08-12T13:20:50.148Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}