cloudflare / cloudflare/workers-sdk

[wrangler] `r2 bucket info <BUCKET>` bugs

Open
#12,495 0 comments 0 reactions 2 assignees Claimed by @MattieTK View on GitHub
package:wrangler
Dominant language
TypeScript
Stars
4.5k
Forks
1.5k
Avg merge
3d 8h
Merged PRs (30d)
187

Description

> [!CAUTION]
> Probably good to check if other `--json` commands are affected by the same bug.
> It looks like any command that can throw would be affected

### What versions & operating system are you using?

wrangler 4.63.0

### Please provide a link to a minimal reproduction

pnpm wrangler r2 bucket info no-bucket --json

### Describe the Bug

The command fails if the bucker doesn't exist:

```
pnpm wrangler r2 bucket info no-bucket

⛅️ wrangler 4.63.0
───────────────────
Getting info for 'cache6'...

✘ [ERROR] A request to the Cloudflare API (/accounts/0a32994c9e7d81ae884d4b40873dd43f/r2/buckets/cache6) failed.
```

Worse it that it fails in the same way when using the`--json` flag

```
pnpm wrangler r2 bucket info no-bucket --json

✘ [ERROR] A request to the Cloudflare API (/accounts/0a32994c9e7d81ae884d4b40873dd43f/r2/buckets/no-bucket) failed.

The specified bucket does not exist. [code: 10006]
```

The output should be valid JSON with the `--json` flag.

### Please provide any relevant error logs

Could be related to https://github.com/cloudflare/workers-sdk/issues/11253

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.