cloudflare / cloudflare/workers-sdk
R2: support an explicit first-time subscription enablement flow in Wrangler
- Dominant language
- TypeScript
- Stars
- 4.5k
- Forks
- 1.5k
- Avg merge
- 3d 8h
- Merged PRs (30d)
- 186
Description
### Problem
On a Workers Paid account where R2 has never been enabled, Wrangler cannot complete an otherwise reproducible bootstrap:
```console
wrangler r2 bucket create
✘ [ERROR] A request to the Cloudflare API (/accounts/.../r2/buckets) failed.
Please enable R2 Subscription for your account. [code: 10042]
```
The operator must leave the CLI and discover the account-level Dashboard activation flow before any bucket command can work. This is especially awkward for approval-gated non-production bootstrap scripts, which can create D1 databases and Queues through Wrangler but cannot prepare R2 from the same explicit workflow.
### Requested behavior
Please provide one of these explicit, consent-preserving flows:
1. a Wrangler command/API-backed operation that enables the R2 subscription with an explicit confirmation flag; or
2. a machine-readable preflight command that reports disabled/enabled state and prints the exact Dashboard activation URL and required account context.
`wrangler r2 bucket create` should continue to fail closed rather than silently accepting billing terms. The goal is to make the required human approval discoverable and automatable around, not to bypass it.
### Environment
- Wrangler 4.127.1
- macOS
- Workers Paid account
- Reproduced before creating the first R2 bucket
Contributor guide
Research direction
Start at Wrangler's `r2 bucket create` command and trace the Cloudflare API handling for error code 10042. Compare the existing Wrangler flows for creating D1 databases and Queues, then determine whether an explicit subscription operation or a machine-readable preflight best fits the consent requirement. Done means disabled accounts receive a clear, automatable path while bucket creation continues to fail closed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli, cloud
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100