Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 BUG: KV & R2 bindings with a empty string ID/name are rejected by the API rather than being caught by config validation #1660

Closed
KianNH opened this issue Aug 11, 2022 · 0 comments · Fixed by #1667
Assignees
Labels
bug Something that isn't working quick win Potentially easy/straightforward issue to tackle

Comments

@KianNH
Copy link
Contributor

KianNH commented Aug 11, 2022

What version of Wrangler are you using?

2.0.24

What operating system are you using?

Mac

Describe the Bug

Bindings with a blank identifier, such as id = "" or bucket_name = "" for kv_namespaces and r2_buckets respectively, throw a workers.api.error.internal_server error as opposed to being caught by config validation in wrangler.

I assume this is since the validation checks for a string, but not if that string has any content.

https://github.com/cloudflare/wrangler2/blob/main/packages/wrangler/src/config/validation.ts#L1633

Example configuration

[[kv_namespaces]]
binding = "foo"
id = ""

[[r2_buckets]]
binding = "bar"
bucket_name = ""

Error returned

Your worker has access to the following bindings:
- KV Namespaces:
  - foo: 
- R2 Buckets:
  - bar: 
Total Upload: 0.29 KiB / gzip: 0.20 KiB

✘ [ERROR] A request to the Cloudflare API (/accounts/134a5a2c0ba47b38eada4b9c8ead10b6/workers/scripts/test-worker) failed.

  workers.api.error.internal_server [code: 10002]
@KianNH KianNH added the bug Something that isn't working label Aug 11, 2022
@JacobMGEvans JacobMGEvans moved this to Untriaged in workers-sdk Aug 11, 2022
@JacobMGEvans JacobMGEvans added the quick win Potentially easy/straightforward issue to tackle label Aug 15, 2022
@JacobMGEvans JacobMGEvans moved this from Untriaged to In Progress in workers-sdk Aug 15, 2022
@JacobMGEvans JacobMGEvans self-assigned this Aug 15, 2022
Repository owner moved this from In Progress to Done in workers-sdk Aug 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that isn't working quick win Potentially easy/straightforward issue to tackle
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants