alyssaxuu/screenity · error · Error

Drive chunk PUT failed: ${chunkRes.status} ${errBody}

Error message

Drive chunk PUT failed: ${chunkRes.status} ${errBody}

What it means

A chunk PUT to the resumable session URL failed with a non-transient status (not 408/429/5xx) or the final retry attempt failed, so the chunk cannot be committed. Thrown in uploadResumable after reading errBody when isTransient is false or attempts are exhausted.

Source

Thrown at src/pages/Background/drive/handleSaveToDrive.js:229

        const range = chunkRes.headers.get("range");
        const match = range && range.match(/bytes=0-(\d+)/);
        const nextOffset = match ? parseInt(match[1], 10) + 1 : offset;
        if (nextOffset > offset) {
          offset = nextOffset;
          advanced = true;
        } else {
          stalled = true;
        }
        break;
      }

      const isTransient =
        chunkRes.status === 408 ||
        chunkRes.status === 429 ||
        chunkRes.status >= 500;
      if (!isTransient || attempt === MAX_CHUNK_ATTEMPTS - 1) {
        const errBody = await chunkRes.text().catch(() => "");
        throw new Error(
          `Drive chunk PUT failed: ${chunkRes.status} ${errBody}`
        );
      }
      const delay = Math.min(1000 * Math.pow(2, attempt), 30000);
      const jitter = Math.random() * 250;
      diagEvent("drive-chunk-retry", {
        offset,
        status: chunkRes.status,
        attempt: attempt + 1,
        delayMs: Math.round(delay + jitter),
      });
      await new Promise((r) => setTimeout(r, delay + jitter));
    }

    if (advanced) {
      stalledRounds = 0;
      continue;
    }

View on GitHub (pinned to 512606387b)

Solutions

  1. Read errBody/status: 404/410 means the session expired — restart the upload from scratch
  2. For 408/429/5xx rely on the existing exponential backoff with jitter loop
  3. Query session state via PUT Content-Range: bytes */total to find the last committed byte
  4. Report the offset so a restarted upload can resume
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at src/pages/Background/drive/handleSaveToDrive.js:229 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of alyssaxuu/screenity@512606387b (2026-09-02). Data as JSON: /api/errors/eac18455852e964f. Report an issue: GitHub.