Skip to content

ci-fix: publish-site failing — intermittent Cloudflare faults in the deploy leg #658

Closed as not planned

Description

@leaf-agent

What failed

publish-site on main at 1de8915c — run 34724421108, attempt 1, "Claim delivered feedback before processing (#651)". The deploy-site job failed in Build and push the exact container image, so the deploy and the public verification never ran and leaf.page kept serving the previous release until the rerun. Attempt 2 is green end to end on the identical tree, so main is published and this commit needs nothing further.

The immediate fault

npx wrangler containers push failed at the transport layer, before it exchanged anything with the registry. docker build finished normally and tagged the image at 23:06:54.41; wrangler printed its banner at 23:06:55.17 and gave up 120 ms later:

 ⛅️ wrangler 4.130.0 (update available 4.131.1)
───────────────────────────────────────────────

✘ [ERROR] fetch failed

There are no layer uploads in between, no authentication output, and no HTTP status — fetch failed is Node's undici error for a request that never received a response at all, raised on wrangler's first call to the Cloudflare API. Nothing in the client had produced repository content yet, and the commit cannot reach this: 1de8915c touches skills/leaf/**, two test modules, worker/README.md and five lines of worker/server.py — no Dockerfile.website, no worker/src/, no wrangler.toml, no workflow.

Why this is filed as durable rather than transient

Taken alone this run is an upstream blip. Taken with the week it is the third time in five days that publish-site's Cloudflare deploy leg has failed on an upstream fault and needed a human to rerun it:

Day Run Step Fault
09-08 34274247221 (#456) Build and push the exact container image registry.cloudflare.com returned 500 on the manifest write, after all eleven layers were accepted
09-11 34634144453 (#589) Deploy public Leaf pages Workers API answered 100146 — version could not be found for the version wrangler deploy had uploaded three seconds earlier
09-12 34724421108 Build and push the exact container image fetch failed on wrangler's first API call, before any request completed

Three different endpoints and three different mechanisms, but one recurring fault: the two steps that talk to Cloudflare's control plane fail intermittently, an unchanged rerun always clears them, and in the interval the published site is a release behind main. The local gate's own recurrence (#475, #503, #540) is a separate leg and its remedy — wrangler 4.130.0, via #530 — has landed; the thirty-nine publish-site runs between #589 and this one all succeeded on their first attempt, so this is intermittency, not a broken deploy path.

Each of those trackers argued its own mitigation down on the grounds that it was a single occurrence, and #456 said explicitly that a recurrence is where a retry becomes worth reconsidering. That is the point this run reaches, which is why this issue stays open rather than being closed as diagnosed.

Why no fix is proposed here

There is no single knob. Wrangler exposes no retry flag or environment setting for either command, and its version is not implicated — a transport-level fetch failed is upstream of anything 4.131.1 changes.

The mitigation that remains is a bounded retry, and it is not safe to add unilaterally in the shape the evidence asks for:

  • It would have to wrap both wrangler containers push and wrangler deploy to cover the observed faults. Two call sites is a retry scheme in the workflow rather than one setting, in front of the last gate standing between a regression and a public deploy.
  • For the ci-fix: transient failure on 34274247221 #456 shape it may be actively wrong. LEAF_SITE_RELEASE folds in GITHUB_RUN_ATTEMPT, so a rerun pushes under a fresh tag and cannot race a half-written manifest — a retry inside the same attempt reuses the tag and races exactly that. Making the retry safe means minting a per-attempt tag too, which is no longer knob-sized.
  • The retry idiom the workflow already carries is not the same case. The until loop on Verify the exact public release in Chrome, and the --retry/--max-time probes from Guard public Leaf deployment capacity #386, wait on a rollout that is expected to converge. A push or a deploy that fails at the transport layer has no such expectation, so a retry there suppresses a real Cloudflare outage as readily as a blip.

The decision

Whether to keep the manual rerun as the recovery path — cheap, already effective every time, but it leaves leaf.page stale until someone notices — or to spend a bounded retry with a per-attempt image tag on making the publish self-healing. I can open either the retry PR or a narrower push-only variant on request; recording the pattern seemed the more useful first move, and this issue is the record for the next occurrence to count against.

Activity

  1. added
    tend-outage
    on Sep 12, 2026
  2. leaf-agent commented on Sep 13, 2026

    @leaf-agent
    CollaboratorAuthor

    Run 34274247221

    log tail

    20cbaaf8b6aa: Preparing
    4a5c4af92dd1: Preparing
    a1e04e7072ce: Preparing
    bccbed27246a: Preparing
    a2ac78ea6115: Preparing
    7716c346ed29: Preparing
    e48af84b2108: Preparing
    4a5c4af92dd1: Waiting
    a1e04e7072ce: Waiting
    bccbed27246a: Waiting
    a2ac78ea6115: Waiting
    7716c346ed29: Waiting
    e48af84b2108: Waiting
    20cbaaf8b6aa: Pushed
    458fd1f7eb16: Pushed
    e92f6f74c0b0: Pushed
    bccbed27246a: Layer already exists
    ded84ded4371: Pushed
    a2ac78ea6115: Layer already exists
    7716c346ed29: Layer already exists
    4a5c4af92dd1: Pushed
    a1e04e7072ce: Pushed
    e48af84b2108: Pushed
    9f1c19627adf: Pushed
    received unexpected HTTP status: 500 Internal Server Error
    
    ✘ [ERROR] Docker command exited with code: 1
    
    
    🪵  Logs were written to "/home/runner/.config/.wrangler/logs/wrangler-2026-09-08_20-22-21_820.log"
    ##[error]Process completed with exit code 1.
    

    Run 34634144453

    log tail

    + /examples/triage-board/widgets/lf-tree.js
       (truncating changed assets log, set `WRANGLER_LOG=debug` environment variable to see full diff)
    Uploaded 363 of 1088 assets
    Uploaded 725 of 1088 assets
    Uploaded 1088 of 1088 assets
    ✨ Success! Uploaded 1088 files (441 already uploaded) (5.22 sec)
    
    Total Upload: 128.71 KiB / gzip: 30.16 KiB
    Worker Startup Time: 9 ms
    Your Worker has access to the following bindings:
    Binding                                                  Resource                      
    env.PAGES (LeafWebsiteSession)                           Durable Object                
    env.WEBSITE_EVENTS (leaf_website_events)                 Analytics Engine Dataset      
    env.SOURCE_AGENT_RATE_LIMITER (20 requests/60s)          Rate Limit                    
    env.ASSETS                                               Assets                        
    env.AGENT_PREWARM ("true")                               Environment Variable          
    
    The following containers are available:
    - leaf-website-leafexamplesession (registry.cloudflare.com/ece2539b9b32ab59dd74aa6b6285e5db/leaf-website@sha256:0343e2a36362b045639b7f9ca35e8f2e22809b7019aa8dc43197e6d7e830d90e)
    
    Uploaded leaf-website (8.77 sec)
    
    ✘ [ERROR] A request to the Cloudflare API (/accounts/ece2539b9b32ab59dd74aa6b6285e5db/workers/scripts/leaf-website/versions/98ee4e8f-d170-4a24-b508-bad9330fe90f) failed.
    
      The requested Worker version could not be found, please check the ID being passed and try again. [code: 100146]
      
      If you think this is a bug, please open an issue at: https://github.com/cloudflare/workers-sdk/issues/new/choose
    
    
    🪵  Logs were written to "/home/runner/.config/.wrangler/logs/wrangler-2026-09-11_18-38-38_063.log"
    ##[error]Process completed with exit code 1.
    

    Run 34724421108

    log tail

    #16 1.733  + typing-inspection==0.4.4
    #16 1.733  + uvicorn==0.52.4
    #16 1.733  + webencodings==0.6.1
    #16 1.733  + websockets==17.1
    #16 2.145 /app
    #16 DONE 4.0s
    
    #17 [stage-1  8/10] COPY worker/codex-config.toml /app/.codex/config.toml
    #17 DONE 0.0s
    
    #18 [stage-1  9/10] COPY .tmp/site ./site
    #18 DONE 0.3s
    
    #19 [stage-1 10/10] COPY worker/server.py worker/reply.py ./worker/
    #19 DONE 0.0s
    
    #20 exporting to image
    #20 exporting layers
    #20 exporting layers 1.2s done
    #20 writing image sha256:3c9a6d223496bd4f6fa308e63242506be127f768e6613e1b597fddbfe8f0c01b done
    #20 naming to docker.io/library/leaf-website:b3286bf2f69d062a9b57a7edaaf236dbb473946513bc24ba4c91eff66f710a63 done
    #20 DONE 1.2s
    
     ⛅️ wrangler 4.130.0 (update available 4.131.1)
    ───────────────────────────────────────────────
    
    ✘ [ERROR] fetch failed
    
    
    🪵  Logs were written to "/home/runner/.config/.wrangler/logs/wrangler-2026-09-12_23-06-55_002.log"
    ##[error]Process completed with exit code 1.
    
  3. max-sixty commented on Sep 18, 2026

    @max-sixty
    Owner

    are we sure that this is their issue? I am skeptical given the relative quality of our code that cloudflare is failing and we're acting flawlessly

    and I would prefer to fix our problems rather than add retries

  4. leaf-agent commented on Sep 18, 2026

    @leaf-agent
    CollaboratorAuthor

    You're right, and the retry is withdrawn. I went back over every publish-site run since this issue was filed, and the failures have moved: the deploy leg has not failed once, and our own verification step has failed six times. A retry around wrangler would have fixed none of them.

    Six failures since this issue, all in our step

    Every publish-site failure on main after 09-12 failed in Verify the exact public release in Chrome. No containers push, no deploy, nothing that reaches Cloudflare's control plane.

    Run Commit Terminal error
    34941155345 0309bd07 agent published but did not reply; the page read working
    35276339548 8baf6c47 agent published but did not reply (#772)
    35320758891 c9a5f207 /examples/triage-board/api/view returned 503
    35324499878 de1f4a4e /examples/triage-board/api/view returned 503
    35325145249 5311ed03 /examples/triage-board/api/view returned 503
    35327552033 f249da60 agent turn ended without an answer (#772)

    One structural cause: the step retries the pass that converges and runs the next one once

    The step wraps verify_site.py --release in a 900-second until loop, then runs --agent --release exactly once. All six failures are in that one-shot pass — none of the six reached the loop's deadline. The three 503 runs are the sharpest case: in 35320758891 the loop itself absorbed six consecutive https://leaf.page/api/view … returned 503 between 07:46:39 and 07:48:06, went green, and the agent pass then took a seventh 503 on the triage-board page at 07:48:37 and ended the job. The same status is a wait in one line of the workflow and a hard failure in the next.

    The 503 is not the rollout status we already model

    reader_session already treats a rollout 503 as a wait, but only when it carries Retry-After. These reach check(activated.ok, …) instead, so they carry no Retry-After — and Retry-After is written in exactly one place in the Worker, rollingOut. So this is a 503 on the container-allocating request from somewhere other than the rollout contract worker/README.md states, and I have not identified its source: separating a container-allocation failure from a Worker error path needs the Workers logs, which this account has no Cloudflare credentials for — the same gap #772 ran into.

    Three of the six are #772's hosted-turn shape. The 503 arm is not tracked anywhere.

    On the three runs in this issue

    I still think those three were upstream — fetch failed before any response, a registry 500 after every layer was accepted, and a version the API could not find three seconds after uploading it are all past the last line of our code. But that was the wrong thing to be counting. Three faults across three endpoints in five days is a thin pattern, and treating it as one made a rerun-and-move-on nuisance look like the thing worth engineering against, while the failure mode that actually broke publish-site four times in one day was ours and sat in a step this issue never looked at.

    Recommend closing this: the retry it was accumulating evidence for is not the fix, and the deploy-leg blips are better handled by rerunning when they happen. I can take the 503 arm next if you want it — the first question is whether a reader arriving at a cold page gets that 503 too, which would make it a product defect rather than a gate one.

  5. max-sixty commented on Sep 19, 2026

    @max-sixty
    Owner

    Closing. The 503 arm was already fixed when the comment above was written, and its account of the cause is wrong — worth correcting here so the next reader of those six log lines doesn't start where I did.

    The three 503 runs predate the fix

    rolling_out landed in 2684c18d (#790) at 09:01 UTC on 09-18. The three runs — 35320758891, 35324499878, 35325145249 — ran at 07:42, 08:27 and 08:35 on shas where reader_session had no rollout branch at all; at c9a5f20 that line is a bare check(activated.ok, …). So the reasoning above — that these reached check(activated.ok, …) instead of the Retry-After test, and therefore carried no Retry-After — reads current main against runs that predate it. No publish-site run has taken a 503 since; its one failure in the day and a half since, on f249da60, is #772's shape.

    It was the rollout contract, with the header

    Workers Observability settles what the header question left open. One request logs twice under a single traceId: the Durable Object's invocation and the stateless Worker's. For the fatal api/view at 07:48:37 in run 35320758891 (traceId c3a65be546478da87775ae3682c42305), the Durable Object answered 200 and the stateless Worker answered 503. The only Worker path that turns a container's answer into a 503 is rollingOut, and it sends Retry-After: 5. So the container had started on the previous image, the edge unseated the session exactly as worker/README.md describes, and every one of the seven 503s that run — the six the until loop absorbed and the seventh that ended the job — was that contract rather than anything of Cloudflare's.

    The other candidate does exist and is worth knowing about: @cloudflare/containers returns a bare 503 with no Retry-After from containerFetch when no instance can be allocated. That is why matching on the header rather than on the status is the right discriminator, and it is still the boundary — a container's own 503 fails the release on the first read.

    A reader is not affected

    The open question was whether a reader arriving at a cold page gets this too. They do, and their gesture still lands: I replayed rollingOut's exact answer at /api/event in a preview, refusing twice, and delivery.js retried and landed the comment on the third attempt. The notice it shows meanwhile is wrong — "Couldn't read the answer — retrying your change…", because the 503's body is plain text and the JSON decode is what fails — and that wording is worth fixing, but nothing is lost.

    The three runs this issue was filed for

    Those stand as upstream: fetch failed before any response, a registry 500 after every layer was accepted, and a version the API could not find three seconds after uploading it. Rerunning is the right response to each. There is nothing left here to build.

    This was written by Claude Code on behalf of max-sixty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    tend-outage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions