Wrangler R2 "bucket not found" in CI
The R2 bucket named in your binding does not exist in the account you deploy to. R2 buckets are referenced by name, not id, so create the bucket with the exact name in the binding before deploying.
What this error means
A deploy fails with "The specified bucket does not exist" or "bucket not found" for an r2_buckets binding.
✘ [ERROR] A request to the Cloudflare API failed.
The specified bucket does not exist. [code: 10006]Common causes
The bucket was never created in this account
R2 does not auto-create buckets on deploy; the bucket_name must already exist in the target account.
A name mismatch or wrong account
A typo in bucket_name, or deploying to a different account, means the referenced bucket cannot be found.
How to fix it
Create the bucket, then bind it
- Create the bucket:
wrangler r2 bucket create my-bucket. - Set the exact
bucket_namein the binding. - Deploy to the account that owns the bucket.
npx wrangler r2 bucket create my-bucket
# wrangler.toml:
[[r2_buckets]]
binding = "ASSETS"
bucket_name = "my-bucket"Verify the bucket list in CI
List buckets to confirm the name exists in the account the token maps to.
npx wrangler r2 bucket listHow to prevent it
- Create R2 buckets before referencing them in bindings.
- Match
bucket_nameexactly, including case. - Deploy to the account that owns the bucket.