cloudflare / wrangler-action

šŸ§™ā€ā™€ļø easily deploy cloudflare workers applications using wrangler and github actions
Apache License 2.0
1.25k stars 159 forks source link

šŸ› BUG: āœ˜ [ERROR] A request to the Cloudflare API ... failed. #179

Closed mmhdi closed 1 year ago

mmhdi commented 1 year ago

Which Cloudflare product(s) does this pertain to?

Workers for Platforms, Workers Runtime, Wrangler core

What version(s) of the tool(s) are you using?

Wrangler 3.10.1, Wrangler Action 3.2

What version of Node are you using?

20.8.0

What operating system are you using?

Linux Ubuntu 22.04.3

Describe the Bug

Hi, Wrangler Action was working 2 days ago, but now it shows error [ERROR] ParseError: A request to the Cloudflare API (/accounts/iiiiiiiiiiiiiiiiiiiidddddddddddd/workers/services/wordpress-plugins) failed., how can I fix it?

Please provide a link to a minimal reproduction

repository private

Please provide any relevant error logs

šŸš€ Running Wrangler Commands
  šŸš€ Executing command: npx wrangler deploy
   ā›…ļø wrangler 3.10.1
  -------------------
  Total Upload: 0.23 KiB / gzip: 0.18 KiB

  āœ˜ [ERROR] A request to the Cloudflare API (/accounts/iiiiiiiiiiiiiiiiiiiidddddddddddd/workers/scripts/wordpress-plugins) failed.

    Authentication error [code: 10000]

    If you think this is a bug, please open an issue at: https://github.com/cloudflare/workers-sdk/issues/new/choose

  Error: āœ˜ [ERROR] ParseError: A request to the Cloudflare API (/accounts/iiiiiiiiiiiiiiiiiiiidddddddddddd/workers/services/wordpress-plugins) failed.

        at throwFetchError (/home/runner/work/wordpress-plugins/wordpress-plugins/node_modules/wrangler/wrangler-dist/cli.js:121072:17)
        at fetchResult (/home/runner/work/wordpress-plugins/wordpress-plugins/node_modules/wrangler/wrangler-dist/cli.js:121024:5)
        at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
        at async deploy (/home/runner/work/wordpress-plugins/wordpress-plugins/node_modules/wrangler/wrangler-dist/cli.js:149579:31)
        at async Object.deployHandler [as handler] (/home/runner/work/wordpress-plugins/wordpress-plugins/node_modules/wrangler/wrangler-dist/cli.js:138908:3) {
      text: 'A request to the Cloudflare API (/accounts/iiiiiiiiiiiiiiiiiiiidddddddddddd/workers/services/wordpress-plugins) failed.',
      notes: [ { text: 'Authentication error [code: 10000]' } ],
      location: undefined,
      kind: 'error',
      code: 10000
    }

Error: `npx wrangler deploy` returned non-zero exit code.
Error: šŸšØ Action failed
------------------------------------------------------------------------------------------
wrangler-action.yml
-------------------------------
name: Wrangler Action

on:
  push:
    branches:
      - main

jobs:
  deploy:
    runs-on: ubuntu-latest
    name: Deploy
    steps:
      - uses: actions/checkout@v4

      - name: Set up Node.js
        uses: actions/setup-node@v3
        with:
          node-version: 20

      - name: Deploy
        uses: cloudflare/wrangler-action@v3
        with:
          apiToken: "aaaaaaaaaapppppppppiiiiiiiii"
          accountId: "iiiiiiiiiiiiiiiiiiiidddddddddddd"
          wranglerVersion: "3.10.1"
          packageManager: "npm"
admah commented 1 year ago

Hello šŸ‘‹ This looks like an authentication error with the wrangler GitHub action. Did you set everything up per the instructions at https://github.com/cloudflare/wrangler-action?

mmhdi commented 1 year ago

Yes, it was working previously, now with version 3.2 it does not work, even when I go back to the old versions

admah commented 1 year ago

@mmhdi I think it's an auth error, not a Wrangler/Action issue. Can you try setting a new API token per the instructions here: https://github.com/cloudflare/wrangler-action#authentication ?

1000hz commented 1 year ago

Closing this issue as it sounds like the problem is an API Token that expired. Please reopen if this turns out not to be the cause.