cloudflare / wrangler-action

🧙‍♀️ easily deploy cloudflare workers applications using wrangler and github actions
Apache License 2.0
1.27k stars 160 forks source link

Deploy error: A request to the Cloudflare API (/memberships) failed. #314

Closed hbmartin closed 1 week ago

hbmartin commented 3 weeks ago

Using a token generated with Edit Cloudflare Workers template and the latest v3 action (wrangler@3.78.10) I get the following error:

$ /home/runner/work/email-worker/email-worker/node_modules/.bin/wrangler deploy
   ⛅️ wrangler 3.78.10 (update available 3.84.1)
  ----------------------------------------------
  ✘ [ERROR] A request to the Cloudflare API (/memberships) failed.
    Authentication error [code: 10000]
  📎 It looks like you are authenticating Wrangler via a custom API token set in an environment variable.
  Please ensure it has the correct permissions for this operation.
  Getting User settings...
  error Command failed with exit code 1.

I read through https://developers.cloudflare.com/fundamentals/api/reference/template/ however I can only find Zone and Account resources but not User.

This is what I have in my action:

      - name: Publish
        uses: cloudflare/wrangler-action@v3
        with:
          apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}

And here are the permissions for the token, unchanged from the template:

Screenshot 2024-11-01 at 4 43 55 PM
nprogers commented 2 weeks ago

Does this problem persist if you update to the latest wrangler?

jahands commented 1 week ago

Hi! This appears to be working now from my tests. Here's what it looks like (showing that I'm for sure using an account-owned token):

Screenshot 2024-11-18 at 1 12 02 PM

If you see further issues, let us know.

Thanks!