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

🐛 BUG: npx wrangler deploy randomly fails on GitHub Runner #7957

Open
Maxastuart opened this issue Jan 29, 2025 · 2 comments
Open

🐛 BUG: npx wrangler deploy randomly fails on GitHub Runner #7957

Maxastuart opened this issue Jan 29, 2025 · 2 comments
Labels
bug Something that isn't working kv-asset-handler Relating to @cloudflare/kv-asset-handler

Comments

@Maxastuart
Copy link

Which Cloudflare product(s) does this pertain to?

Wrangler, KV Asset Handler, KV

What versions are you using?

3.106.0 [Wrangler], 20.18.1 [Node.js], 10.8.2 [npm/npx]

What operating system and version are you using?

Ubuntu 24.04.1 LTS on GitHub Runner

Please provide a link to a minimal reproduction

No response

Describe the Bug

Our app's deployment of static assets to Workers KV store fails 30%-50% of the time, specifically
when deploying to production. We get by by re-running the failed GitHub Action Runner jobs, which
usually works when its this specific error.

> npx wrangler deploy -e prod --outdir dist
(...)
Uploaded 99% [209,427 out of 210,427]
Upload failed, aborting...

✘ [ERROR] Received a malformed response from the API

  <!DOCTYPE html>
  <!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en-US"> <![endif]-->
  <!--[if I... (length = 7180)

  PUT /accounts/***/storage/kv/namespaces/05a5b25fa8da48878798cf6f4527165e/bulk -> 524 
  
  If you think this is a bug, please open an issue at: https://github.com/cloudflare/workers-sdk/issues/new/choose

I haven't been able to reproduce locally. My hunch is npx wrangler deploy encounters an occasional
cloudflare network error that may be exacerbated by the sheer amount of data we upload (for
web crawler SEO purposes) in addition to the runner's ephemeral nature & network.

Github Runner Image: ubuntu-24.04

Please provide any relevant error logs


> npx wrangler deploy -e prod --outdir dist

npm warn exec The following package was not found and will be installed: [email protected]
npm warn deprecated [email protected]: Please use @jridgewell/sourcemap-codec instead
npm warn deprecated [email protected]: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-inject.

 ⛅️ wrangler 3.106.0
--------------------

Fetching list of already uploaded assets...
Building list of assets to upload...
 + 404.62[34](https://github.com/TackleHunger/TackleHunger/actions/runs/13024104686/job/36330346889#step:13:35)a50d0e.html (uploading new version of 404.html)
 + _next/data/n1zd7WyFvcJv2ke63ohwB/charity/0RG08000/S1TSH9S4/donate.fb249e7774.json (uploading new version of _next/data/n1zd7WyFvcJv2ke63ohwB/charity/0RG08000/S1TSH9S4/donate.json)
(...)
 + _next/data/n1zd7WyFvcJv2ke63ohwB/charity/0RG0800T/donate.93fc4cfe00.json (uploading new version of _next/data/n1zd7WyFvcJv2ke63ohwB/charity/0RG0800T/donate.json)
   (truncating changed assets log, set `WRANGLER_LOG=debug` environment variable to see full diff)
Uploading 210,427 new assets...
Skipped uploading 271 existing assets.
Uploaded 0% [1,000 out of 210,427]
(...)
Uploaded 99% [209,427 out of 210,427]
Upload failed, aborting...

✘ [ERROR] Received a malformed response from the API

  <!DOCTYPE html>
  <!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en-US"> <![endif]-->
  <!--[if I... (length = 7180)

  PUT /accounts/***/storage/kv/namespaces/05a5b25fa8da48878798cf6f4527165e/bulk -> 524 
  
  If you think this is a bug, please open an issue at: https://github.com/cloudflare/workers-sdk/issues/new/choose



Cloudflare collects anonymous telemetry about your usage of Wrangler. Learn more at https://github.com/cloudflare/workers-sdk/tree/main/packages/wrangler/telemetry.md

@Maxastuart Maxastuart added the bug Something that isn't working label Jan 29, 2025
@github-project-automation github-project-automation bot moved this to Untriaged in workers-sdk Jan 29, 2025
@WillTaylorDev
Copy link
Contributor

@Maxastuart can you provide your wrangler.toml? I believe this is for Workers Sites, not Workers with static assets.

@WalshyDev WalshyDev added kv-asset-handler Relating to @cloudflare/kv-asset-handler and removed Workers + Assets labels Feb 3, 2025
@emily-shen emily-shen moved this from Untriaged to Backlog in workers-sdk Feb 4, 2025
@Maxastuart
Copy link
Author

@WillTaylorDev yes, it is workers sites, with a custom worker and additional assets.

compatibility_date = "2023-05-24"
main = "workers-site/src/index.ts"

# Local environment
#  - dev worker is primarily for testing local code on actual CF workers
#  - some values are inherited for all environments unless overridden, but not kv_namespaces or [vars]
minify = false
name = "map-local"
route = "REDACTED/*"
kv_namespaces = [
  { binding = "CAMPAIGNS", id = "REDACTED", preview_id = "REDACTED" },
  { binding = "CAMPAIGN_IMAGES", id = "REDACTED", preview_id = "REDACTED" },
  { binding = "PAYOUT_REPORTS", id = "REDACTED", preview_id = "REDACTED" },
]

[observability.logs]
enabled = true

[site]
bucket = "./out"

[vars]
DEBUG = "true"
ENV_NAME = "local"
ORIGIN = "https://REDACTED"

# Dev environment overrides
#  - primarily for testing code in github PRs on actual CF workers
[env.dev]
minify = false
name = "map-dev"
route = "REDACTED/*"
kv_namespaces = [
  { binding = "CAMPAIGNS", id = "REDACTED" },
  { binding = "CAMPAIGN_IMAGES", id = "REDACTED" },
  { binding = "PAYOUT_REPORTS", id = "REDACTED" },
]
[env.dev.vars]
DEBUG = "true"
ENV_NAME = "dev"
ORIGIN = "https://REDACTED"

[env.staging]
minify = true
name = "map-staging"
route = "REDACTED/*"
kv_namespaces = [
  { binding = "CAMPAIGNS", id = "REDACTED" },
  { binding = "CAMPAIGN_IMAGES", id = "REDACTED" },
  { binding = "PAYOUT_REPORTS", id = "REDACTED" },
]
[env.staging.vars]
DEBUG = "true"
ENV_NAME = "staging"
ORIGIN = "https://REDACTED"

[env.prod]
minify = true
name = "map-prod"
route = "REDACTED/*"
kv_namespaces = [
  { binding = "CAMPAIGNS", id = "REDACTED" },
  { binding = "CAMPAIGN_IMAGES", id = "REDACTED" },
  { binding = "PAYOUT_REPORTS", id = "REDACTED" },
]
[env.prod.vars]
DEBUG = "false"
ENV_NAME = "prod"
ORIGIN = "https://REDACTED"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that isn't working kv-asset-handler Relating to @cloudflare/kv-asset-handler
Projects
Status: Backlog
Development

No branches or pull requests

3 participants