Invalid access token in wrangler

I run npx wrangler login - I go through the oauth flow. It says it logged in successfully.

I run npx wrangler whoami, I always get the following:

 ⛅️ wrangler 3.18.0
-------------------
Getting User settings...

✘ [ERROR] A request to the Cloudflare API (/accounts) failed.

  Invalid access token [code: 9109]
  
  If you think this is a bug, please open an issue at:
  https://github.com/cloudflare/workers-sdk/issues/new/choose

I run npx wrangler logout I get

 ⛅️ wrangler 3.18.0
-------------------
Not logged in, exiting...

Nothing I do seems to alter this behavior. I am stuck in the water, and this community forum seems to be my last recourse. Am I doing something wrong?

P.S - This was working at one point.

This also seemed to happen directly after going on a paid plan for workers.

I am also experiencing the same issue :frowning:

In my case, I had an env var set. Check to see if you have the CLOUDFLARE_API_TOKEN env set elsewhere.

Adding the following permissions fixed it for me

Also User Memberships, User Details and Zone

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.