Skip to content

docs: add Workers R2 Storage Read to the deploy token's permissions - #87

Open
selfie-bot wants to merge 1 commit into
mainfrom
fix/issue-86
Open

selfie-bot wants to merge 1 commit into
mainfrom
fix/issue-86

Conversation

@selfie-bot

Copy link
Copy Markdown
Collaborator

The App production release dispatch after #85 (run 44678811328) failed in wrangler deploy with A request to the Cloudflare API (/accounts/…/r2/buckets/selfie-blobs) failed. Authentication error [code: 10000]. The deploy token has no R2 permission. Until #85 it didn't need one.

Wrangler 4.156.2 checks each R2 binding before it deploys. If the live Worker already binds BLOBS to the same bucket_name, wrangler reuses that binding and makes no API call (R2Handler.canInherit). Otherwise it calls GET /r2/buckets/<name> to see whether the bucket exists, and only a "not found" (code 10006) lets the deploy continue. #85 moved BLOBS from selfie-hackathon-images to selfie-blobs, so this was the first deploy to make that call. Cloudflare's API schema says the call needs com.cloudflare.edge.r2.bucket.read, which comes with the Workers R2 Storage Read token group.

This PR doesn't fix the deploy on its own. A maintainer has to add Workers R2 Storage Read (account-wide) to CLOUDFLARE_API_TOKEN and dispatch the release again. This change records that permission in OPERATIONS.md's list of the token's exact permissions, so a rotated token keeps it. #85 also noted that a future preflight check of the bucket's r2.dev access would need the same read permission.

Refs #86 — automated triage

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant