Menu

#107 fix(deploy): log Cloudflare purge response body on failure

open
nobody
bug (2)
2026-05-17
2026-05-17
Anonymous
No

Originally created by: TheoV823

Problem

scripts/deploy_site.py swallows the Cloudflare API response body when a purge request fails. The except block at lines 78–79 only prints the HTTPError string representation, not the JSON errors[] body returned by Cloudflare. This makes purge failures opaque — the Task 3 HTTP 400 in run 25990885821 required manual log inspection and code reading to diagnose.

Finding

Discovered during Task 3 of the post-launch cleanup runbook (2026-05-17). Deploy run 25990885821 logged only:

[WARN] Cloudflare purge error (deploy succeeded): HTTP Error 400: Bad Request

The actual Cloudflare errors[] body was never surfaced, preventing self-diagnosis.

Proposed fix

In scripts/deploy_site.py around line 78, change the except block to read and log the response body:

except urllib.error.HTTPError as e:
    body = e.read().decode("utf-8", errors="replace")
    print(f"[WARN] Cloudflare purge error: {e}{body}")

This preserves the non-fatal warn-only behaviour while making future failures self-diagnosing.

Scope

  • One-line change in scripts/deploy_site.py
  • No behaviour change — still non-fatal, deploy still succeeds
  • Can be combined with the companion issue (filter non-HTML URLs) on the same branch

See also: [#46] (renamed site files in delta deploy) — distinct problem in the same file; keep scopes separate.

Discovered during post-launch cleanup runbook (2026-05-17).

Related

Tickets: #108
Tickets: #46

Discussion


Log in to post a comment.

Auth0 Logo