workers-sdk: 🐛 BUG: Authentication error [code: 10000]
Which Cloudflare product(s) does this pertain to?
Wrangler
What version of Wrangler are you using?
2.9.0
What operating system are you using?
Mac
Describe the Bug
Locally and on the buildkite CI/CD, I’m getting the following error:
wrangler publish --env staging
Delegating to locally-installed wrangler@2.9.0 over global wrangler@2.9.0...
Run `npx wrangler publish --env staging` to use the local version directly.
⛅️ wrangler 2.9.0
-------------------
Your worker has access to the following bindings:
- Vars:
- ENVIRONMENT: "staging"
- MRYUM_URL: "staging.mryum.com"
Total Upload: 415.84 KiB / gzip: 65.54 KiB
✘ [ERROR] A request to the Cloudflare API (/accounts/<OBFUSCATED>/workers/scripts/global-staging-qr-proxy) failed.
Authentication error [code: 10000]
If you think this is a bug, please open an issue at:
https://github.com/cloudflare/wrangler2/issues/new/choose
I have tried to reset the token. I have tried passing in the CLOUDFLARE_API_TOKEN=<YOUR_API_TOKEN_VALUE> in the command line. I have tried adding permission “Account Workers Scripts Edit” permission to your token.
Nothing seems to be fixing the issue
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 6
- Comments: 23 (8 by maintainers)
Hi @jspspike
Initially we were using
CLOUDFLARE_API_TOKENandCLOUDFLARE_ACCOUNT_ID,CLOUDFLARE_API_TOKENis the one that you create manually:But few days ago during CI deployment it just stoped working viat throwing error
Authentication error [code: 10000], no changes were done to token permissions, so we switched toCLOUDFLARE_EMAILandCLOUDFLARE_API_KEY(aka Global API Key)I ran into this error as well and after hours of debugging discovered that wrangler caches some account settings into the “node_modules/.cache/wrangler/” directory, then it uses those and ignores environment variables!
How would you pass the CF_API_TOKEN to Wrangler manually? I couldn’t find any instructions in the documentation on how to do this.
I am seeing the same issue “workers.api.error.unauthorized [code: 10023]”. This started happening on a perfectly working github action.