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

uploading environment secrets doesn't work with pages deploy #304

Open
qqpann opened this issue Oct 20, 2024 · 4 comments
Open

uploading environment secrets doesn't work with pages deploy #304

qqpann opened this issue Oct 20, 2024 · 4 comments
Labels
bug Something isn't working triaged

Comments

@qqpann
Copy link

qqpann commented Oct 20, 2024

const args = ["wrangler", "secret:bulk"];

When the repository is pages directory, it needs to run

wrangler pages secret bulk

Otherwise it will run into the following error:

🔑 Uploading secrets...
  /opt/hostedtoolcache/node/18.20.4/x64/bin/npx wrangler secret:bulk
  
   ⛅️ wrangler 3.81.0
  -------------------
  
  
  ✘ [ERROR] It looks like you've run a Workers-specific command in a Pages project.
  
    For Pages, please run `wrangler pages secret bulk` instead.
  
  
  🪵  Logs were written to "/home/runner/.config/.wrangler/logs/wrangler-2024-10-20_12-06-13_693.log"
  Error: The process '/opt/hostedtoolcache/node/18.20.4/x64/bin/npx' failed with exit code 1
Error: Failed to upload secrets.
Error: 🚨 Action failed
@ckhicks
Copy link

ckhicks commented Oct 24, 2024

This appears to be throwing errors on Worker deploys, too.

🔑 Uploading secrets...
  /usr/local/bin/npx wrangler secret:bulk
   ⛅️ wrangler 3.78.10 (update available 3.83.0)
  ----------------------------------------------
  ▲ [WARNING] `wrangler secret:bulk` is deprecated and will be removed in a future major version.
    Please use `wrangler secret bulk` instead, which accepts exactly the same arguments.
  🌀 Creating the secrets for the Worker "[redacted]" 
  Finished processing secrets JSON file:
  ✨ 0 secrets successfully uploaded
  ✘ [ERROR] 🚨 3 secrets failed to upload

Using: actions/checkout@v4 & cloudflare/wrangler-action@v3

@nprogers
Copy link

Does this issue persist if you update the deprecated command and use the latest wrangler version?

@jahands
Copy link
Contributor

jahands commented Nov 18, 2024

Looks like we may need to adjust behavior here to allow setting secrets for Pages, such as with a pages_secrets: field (or somehow detect if the project is a Pages project before uploading secrets.)

Until then, users can work around this by manually uploading secrets in the Cloudflare dashboard, or locally using wrangler secret put

@jahands jahands added enhancement New feature or request bug Something isn't working triaged and removed awaiting reporter response enhancement New feature or request labels Nov 18, 2024
@ckhicks
Copy link

ckhicks commented Nov 18, 2024

Aye, that's generally how I've gotten around these with failing Workers deployments. Seems like these deprecated commands come through every now and then through normal usage of the Wrangler CLI so it's hard to know exactly when it breaks...until it does!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triaged
Projects
None yet
Development

No branches or pull requests

4 participants