cloudflare / workers-sdk

⛅️ Home to Wrangler, the CLI for Cloudflare Workers®
https://developers.cloudflare.com/workers/
Apache License 2.0
2.69k stars 706 forks source link

🐛 BUG: Most commands are returning "perhaps your object identifier is invalid? [code: 7003]" error #2100

Closed noman-land closed 2 years ago

noman-land commented 2 years ago

What version of Wrangler are you using?

2.1.13

What operating system are you using?

macOS 12.6

Describe the Bug

Most npx wrangler commands are returning a variation of the error:

✘ [ERROR] A request to the Cloudflare API (/accounts/[redacted]/workers/scripts/my-service/bindings) failed.

  Could not route to
  /client/v4/accounts/[redacted]/workers/scripts/my-service/bindings,
  perhaps your object identifier is invalid? [code: 7003]

For example npx wrangler dev --env qa returns:

Could not route to 
/client/v4/accounts/[redacted]/workers/scripts/my-service/edge-preview, 
perhaps your object identifier is invalid? [code: 7003]

Also, GitHub deploy actions are erroring with similar errors.

npx wrangler whoami shows me:

Scope (Access)
- account (read)
- user (read)
- workers (write)
- workers_kv (write)
- workers_routes (write)
- workers_scripts (write)
- workers_tail (read)
- d1 (write)
- pages (write)
- zone (read)
- offline_access

I've tried logging out and back in as well as rotating the Global API Key.

noman-land commented 2 years ago

This appears to have been happening because I still had an account_id in my wrangler.toml file even though it is no longer necessary. This was the cryptic error that was happening as a result. I've resolved this by removing that property from the config.

ghostdevv commented 2 years ago

I am having this issue and I never had an account_id in my wrangler.toml - and when running the command it prompts me to select an account