Repository navigation
Retry the site deploy when Cloudflare cannot find the uploaded Worker version - #6546
Conversation
… version publish-site's deploy fails when Cloudflare's Worker Versions API answers 100146 for the version Wrangler just uploaded, and a later deploy of the same tree succeeds. The step now deploys again, up to three attempts five minutes apart, only on that answer; any other failure ends the step at once. Refs #3826
|
@leaf-agent please widen the retry to cover the outages your description lists. Deploy again every 5 minutes until 30 minutes after the first
|
The deploy now retries Cloudflare's 100146 every 5 minutes until 30 minutes after the first one, the window the maintainer asked for, since the Oct 24 and Nov 19 outages both outlasted ten minutes. The job's timeout-minutes rises from 45 to 75 so that window fits before the public verification's 15-minute wait. Any other deploy failure still fails the step on its first attempt.
|
Done in f3556ec. The deploy now retries every 5 minutes until 30 minutes after the first |
…oy.sh Main's #6546 retries `publish-site`'s deploy when Cloudflare answers 100146 for the version just uploaded, every 5 minutes until 30 minutes after the first, since its outages have lasted over 15 minutes. This branch's script retried the same lookup failure where it surfaces after the upload, as "not fully applied". The two are one mechanism, so the script now retries either, 30 s after the first failure and then every 5 minutes until 30 minutes after it, and `publish-site` and `deploy-dev.sh` both run it. Checked against a stub wrangler: success, 100146 then success, two half-applied deploys then success, and another error exiting at once.
… Object scheduling (#6550) Every leaf.page deploy was followed by 2–5 minutes in which container starts failed ("Failed to start container"): Cloudflare activated the Worker at once but rolled the image out over minutes, and the page store refused the previous image. This moves the session object to Cloudflare's Durable Object scheduling: `LeafSession` starts, proxies and idles out its own container on the Container API (the deprecated `@cloudflare/containers` SDK is removed), with the image from its own Worker version, so a start after a deploy always runs the deployed image. The image pre-build in `publish-site`, `--containers-rollout` and `max_instances` go. Closes #4081 To weigh: - The new policy needs a new class (migration v3), so every visitor starts once from the published page. `LeafWebsiteSession` stays as an empty export: Cloudflare refuses to delete a class while its container application stands, and refuses a version that omits it. Deleting both is a follow-up. - A container from before a deploy is still stopped at the session's first request after it, and the store still refuses it meanwhile, so a turn in progress is cut off. Keeping it running was built and tried (first commit) and backed out (second): the Worker↔container interface has no version, so an older container could be left unable to save. - `worker/wrangler-deploy.sh` is now the one deploy retry, for `publish-site` and `deploy-dev.sh`: it folds in main's 100146 retry (#6546) and also reruns a deploy that uploaded the Worker but failed to apply the container application, which wrangler does when the same lookup outlasts its 2.5 s read-back (3 of 6 dev attempts). On production's first deploy, which creates the new application, that rerun is what gives the class a container, so the first retry comes after 30 s. The maintainer asked for this on a Leaf page. Tests: worker vitest, `tests/process/website_server`, `leaf-dev site verify website-worker`, and three deploys to `leaf-website-dev` with a visitor's tab held open: no failed request to a visitor, one reload at the deploy, every sent question answered. > _This was written by Claude Code on behalf of max-sixty_
publish-sitefails when Cloudflare's Worker Versions API answers100146("The requested Worker version could not be found") for the versionwrangler deployhas just uploaded, and a later deploy of the same tree succeeds with no change here. This makes Deploy public Leaf pages deploy again on that answer, every 5 minutes until 30 minutes after the first100146; any other failure, including a different Wrangler error, still fails the step on its first attempt. The job'stimeout-minutesrises from 45 to 75 so that window fits beside the public verification's 15-minute--waitand the agent journey after it. This is the bounded retry the maintainer named on #3826 as the repair if the lookup failure recurred, and it recurred in run 44628090061.Needs the control-plane owner's approval: it edits a workflow, so it isn't landing on review alone.
The window is sized to the outages seen so far. On Oct 24, run 40131829999's deploys about 12 minutes apart both failed before a third passed. On Nov 19, run 44628090061's rerun deployed at 22:47 UTC, 16 minutes after the first failure, and got
100146again. In the last five successful runs the job took 11 to 14 minutes, about 8 of them before the deploy, so the worst case is about 8 + 30 + the verification's ~34 minutes, under 75.Verified by running the step's script with the deploy command,
sleepanddatestubbed, each deploy taking a simulated minute:100146then success exits 0 after two calls.100146every time exits 1 after six calls, with the last deploy ending 30 minutes after the first failure.The match string
[code: 100146]is the one in the failed run's log.set -o pipefailis needed because the step's default shell isbash -e, under whichwrangler … | teewould reporttee's status.Closes #3826 — automated triage