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.
wrangler
✘ [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.
Terminal
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.
Terminal
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.
Related guides
Wrangler "binding ... not found" in wrangler.toml in CIFix Wrangler "binding not found" errors in CI - a KV, D1, R2, or service binding in wrangler.toml references…
Wrangler KV "namespace not found" in CIFix Wrangler KV "namespace not found" / "is not valid" in CI - a kv_namespaces binding id in wrangler.toml do…
Wrangler D1 "Couldn't find a D1 DB" / database not found in CIFix Wrangler D1 "Couldn't find a D1 DB with the name or binding" in CI - the d1_databases binding references…