Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v3 release currently broken #137

Closed
randomairborne opened this issue Aug 9, 2023 · 17 comments
Closed

v3 release currently broken #137

randomairborne opened this issue Aug 9, 2023 · 17 comments
Labels
needs clarification Additional context or information needed

Comments

@randomairborne
Copy link

action + repo When trying to run the worker, iI get an "Error: Action Failed"

Run cloudflare/wrangler-action@v3
  with:
    apiToken: ***
    workingDirectory: cdn-upload-worker
    command: publish --env staging
📥 Installing Wrangler
  Running command: npm install [email protected]
  npm WARN deprecated [email protected]: Please use @jridgewell/sourcemap-codec instead
  ✅ Wrangler installed
npm WARN deprecated [email protected]: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-inject.
🚀 Executing Wrangler Commands
  Error: 🚨 Action failed
@AlCalzone
Copy link

Maybe because the action is using wrangler v3, which doesn't have a publish command anymore, but deploy?
https://developers.cloudflare.com/workers/wrangler/commands/#deploy

@JacobMGEvans
Copy link
Contributor

I should add stderr for more commands.

@JacobMGEvans
Copy link
Contributor

Also a heads up with the new wrangler-action you should be able to consolidate these (once I figure out your bug)

      - name: deploy prod & dev
        uses: cloudflare/wrangler-action@v3
        with:
          apiToken: ${{ secrets.CF_API_TOKEN }}
          workingDirectory: "cdn-upload-worker"
          command:  | 
             deploy --config wrangler.prod.toml
             deploy --config wrangler.toml

@randomairborne
Copy link
Author

ooh nice, thanks
let me know if you need anything else.

JacobMGEvans added a commit that referenced this issue Aug 10, 2023
Previously, we prevented any error logs from propagating too far to prevent leaking of any potentially sensitive information. However, this made it difficult for developers to debug their code.

In this release, we have updated our error handling to allow for more error messaging from pre/post and custom commands. We still discourage the use of these commands for secrets or other sensitive information, but we believe this change will make it easier for developers to debug their code.

Relates to #137
@randomairborne
Copy link
Author

the issue was not publish

@JacobMGEvans
Copy link
Contributor

the issue was not publish

It will be, the release PR will be merged soon #140

This was referenced Aug 10, 2023
@randomairborne
Copy link
Author

wait, publish is an issue?

@1000hz
Copy link
Contributor

1000hz commented Aug 10, 2023

No, @JacobMGEvans mistook your comment to mean "cloudflare/wrangler-action was not published" rather than

- command: publish --env staging
+ command: deploy --env staging

not solving your problem.

We were ironing out some kinks with our release process earlier, hence the confusion. We've now released v3.0.2 with improved error logging when command fails, which should help us better understand what's causing problems with your action run. Would you mind re-running the job in your repo, @randomairborne?

@JacobMGEvans
Copy link
Contributor

Thanks for clarifying Cina!

@randomairborne
Copy link
Author

Ah, okay- now there is More than one account available but unable to select one in non-interactive mode.. I feel like this shouldn't be the case... i think my API token is only supposed to work for my personal account.

@randomairborne
Copy link
Author

Yeah, only one account it added to this API token.

@JacobMGEvans
Copy link
Contributor

JacobMGEvans commented Aug 11, 2023

What does your Wrangler.toml look like? You can replace the info on it with dummy data if its sensitive.

Oh I think I know how you can fix this.

- name: deploy prod & dev
        uses: cloudflare/wrangler-action@v3
        with:
          apiToken: ${{ secrets.CF_API_TOKEN }}
          accountId: ${{ secrets.AccoundID }}
          workingDirectory: "cdn-upload-worker"
          command:  | 
             deploy --config wrangler.prod.toml
             deploy --config wrangler.toml

Should look something like this test which is part of many accounts and has a scoped API Token too:

# END Setup and teardown of Worker Environment Tests
# START Setup and teardown of Workers w/ Secrets Tests
- name: Deploy app secrets w/ hardcoded Wrangler v2
uses: ./
with:
wranglerVersion: "2.20.0"
workingDirectory: "./test/base"
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
secrets: |
SECRET1
SECRET2
env:
SECRET1: ${{ secrets.SECRET1 }}
SECRET2: ${{ secrets.SECRET2 }}

@randomairborne
Copy link
Author

randomairborne commented Aug 11, 2023

Is this a limitation of the API, does it not allow you to check the scope of a token based on accounts? This specific token can only access one account.

@randomairborne
Copy link
Author

btw, setting accountId does not fix the issue

@penalosa
Copy link
Contributor

@randomairborne Could you link the GitHub Actions run with the accountId set to help us debug further?

@penalosa penalosa added needs clarification Additional context or information needed and removed awaiting reporter response labels Aug 17, 2023
@randomairborne
Copy link
Author

It turns out I was setting it wrong, sorry.

@lrapoport-cf
Copy link
Contributor

sounds like this has been resolved :) we will close for now, but please feel free to re-open if you are still running into issues!

@github-project-automation github-project-automation bot moved this from Untriaged to Done in workers-sdk Aug 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs clarification Additional context or information needed
Projects
None yet
Development

No branches or pull requests

6 participants