{"record":{"id":"792e765f2e05405d","repo":"alyssaxuu/screenity","slug":"drive-chunk-put-exhausted-retries-at-offset-offs","errorCode":null,"errorMessage":"Drive chunk PUT exhausted retries at offset ${offset}","messagePattern":"Drive chunk PUT exhausted retries at offset (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/pages/Background/drive/handleSaveToDrive.js","lineNumber":249,"sourceCode":"        );\n      }\n      const delay = Math.min(1000 * Math.pow(2, attempt), 30000);\n      const jitter = Math.random() * 250;\n      diagEvent(\"drive-chunk-retry\", {\n        offset,\n        status: chunkRes.status,\n        attempt: attempt + 1,\n        delayMs: Math.round(delay + jitter),\n      });\n      await new Promise((r) => setTimeout(r, delay + jitter));\n    }\n\n    if (advanced) {\n      stalledRounds = 0;\n      continue;\n    }\n    if (!stalled) {\n      throw new Error(\n        `Drive chunk PUT exhausted retries at offset ${offset}`\n      );\n    }\n    // Drive accepted none of the chunk. Resending the same range is correct,\n    // but bound it so a persistently stalled upload fails instead of looping.\n    stalledRounds += 1;\n    if (stalledRounds >= MAX_STALL_ROUNDS) {\n      throw new Error(\n        `Drive resumable upload made no progress at offset ${offset}`\n      );\n    }\n    const stallDelay = Math.min(1000 * Math.pow(2, stalledRounds - 1), 15000);\n    diagEvent(\"drive-chunk-stall\", {\n      offset,\n      round: stalledRounds,\n      delayMs: stallDelay,\n    });\n    await new Promise((r) => setTimeout(r, stallDelay));","sourceCodeStart":231,"sourceCodeEnd":267,"githubUrl":"https://github.com/alyssaxuu/screenity/blob/512606387b8d07dda5e63bb428bd063f0a2a3ed0/src/pages/Background/drive/handleSaveToDrive.js#L231-L267","documentation":"All MAX_CHUNK_ATTEMPTS retries for the current chunk failed with transient statuses (408/429/5xx) or non-advancing responses, and the loop did not classify the outcome as 'stalled'. Thrown in uploadResumable to abort rather than loop indefinitely.","triggerScenarios":"Thrown at src/pages/Background/drive/handleSaveToDrive.js:249 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the whole upload later, resuming via the session status endpoint (PUT Content-Range: bytes */size)","Check connectivity and the Drive status dashboard before surfacing a user-facing failure","Resume from the committed offset reported by the status query"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"512606387b8d07dda5e63bb428bd063f0a2a3ed0","analyzedAt":"2026-09-02T20:59:09.419Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T02:17:09.455Z"}