Prove the Name and Route First
Consider a composite incident, assembled from failure modes in this series rather than one customer. At 09:12, three people report three different problems with the same store. A customer in Frankfurt sees "Web server is down." A colleague in Toronto sees yesterday's prices. An automated probe gets HTTP 403. The on-call engineer disables the WAF, then a cache rule, then DNSSEC. By 09:40 the site is worse and nobody can say which change mattered.
One deploy touched four layers, and each observer saw a different layer fail. A layered runbook replaces guessing with one question: how far did this request get, and which layer wrote the last piece of evidence?
A useful analogy is courier tracking. A parcel's scan history proves handoffs, not the condition of the box. cf-ray is that tracking number for an HTTP request, and the other response headers are the scan events.
Terms first:
- Authoritative DNS holds the zone's records. A recursive resolver asks on the client's behalf and caches the answer for the record's time to live (TTL).
- A proxied record (the orange cloud) answers with Cloudflare anycast addresses instead of your origin, so HTTP passes through the edge. A DNS-only record answers with the origin address and never touches the HTTP path.
- Anycast announces one address from many data centers; the chosen one is the point of presence (PoP), reported as
coloby/cdn-cgi/traceand in the Ray ID suffix. - SNI is the hostname requested during the TLS handshake; it selects the certificate and zone configuration.
- A Ray ID is the
cf-rayvalue, for example8f2c1d4e9a7b6c5d-SJC. The edge adds it and forwards it to the origin, so it can join both logs.
The order is deliberately boring: name, route, TLS, cache or security decision, Worker, origin. Each layer can end the request before the next runs, so evidence from a later layer is absent, not negative. If a request never reached the cache, "the cache is fine" is not a finding.
Start with the name. Query the exact hostname twice and keep both answers and TTLs: a TTL that counts down between queries is a cached answer, while a TTL that resets came from the authoritative server. Check delegation before suspecting the record itself.
Proxied records use Auto TTL, which is 300 seconds and cannot be edited, so propagation is bounded at the resolver but not at every intermediate cache. Negative answers are cached too, so a name that did not exist can keep returning NXDOMAIN after you create it.
Next, prove the route with one request that prints status and headers, then read the response the way an operator would:
| Response evidence | What it proves | When it is missing |
|---|---|---|
cf-ray | The name resolved and the request reached a Cloudflare PoP | DNS or the client path still needs work |
server: cloudflare | The edge answered rather than the origin directly | The record may be DNS-only |
cf-cache-status | Whether the cache was consulted, and its outcome | An edge-generated response, such as a block, never reached cache |
age | How long the cached entry has existed | No cache entry was served |
| HTTP status | Which layer wrote the last response | No HTTP response completed |
A Ray ID is the first hard proof. It shows the name resolved and the request reached a PoP, so DNS is no longer the suspect; a timeout with no Ray ID means the request likely never reached Cloudflare — a client-path or ISP problem. That kills the most common false hypothesis.
Figure 1 turns that into a ladder with explicit stop points; the point is not exhaustiveness, but making the next test the only reasonable one.
%%{init: {'theme':'base','themeCSS':'.edgeLabel .label text, .edgeLabel text, .edgeLabel span { fill:#132440 !important; color:#132440 !important; }','themeVariables': {'primaryColor':'#16476A','primaryTextColor':'#ffffff','primaryBorderColor':'#132440','secondaryColor':'#3B9797','secondaryTextColor':'#ffffff','secondaryBorderColor':'#132440','tertiaryColor':'#c4873b','tertiaryTextColor':'#132440','tertiaryBorderColor':'#132440','lineColor':'#5a6e82','textColor':'#132440','titleColor':'#132440','mainBkg':'#16476A','nodeBorder':'#132440','clusterBkg':'#eef3f7','clusterBorder':'#132440','edgeLabelBackground':'#ffffff','actorBkg':'#16476A','actorTextColor':'#ffffff','actorBorder':'#132440','activationBkgColor':'#3B9797','activationBorderColor':'#132440','signalColor':'#5a6e82','signalTextColor':'#132440','noteBkgColor':'#c4873b','noteTextColor':'#132440','noteBorderColor':'#132440','labelBoxBkgColor':'#a8dede','labelBoxBorderColor':'#132440','labelTextColor':'#132440','loopTextColor':'#132440','altBackground':'#f8f9fa','fontFamily':'DM Sans, sans-serif'}}}%%
flowchart TD
S["Symptom with URL and UTC time"] --> D["1. DNS: dig answer and TTL"]
D --> DQ{"Expected edge address?"}
DQ -->|no| DX["Stop: delegation, record, or negative cache"]
DQ -->|yes| T["2. TLS: certificate and handshake"]
T --> TQ{"HTTP status received?"}
TQ -->|no| TX["Stop: browser-to-edge TLS"]
TQ -->|yes| R["3. Route: cf-ray, colo, server"]
R --> RQ{"cf-ray present?"}
RQ -->|no| RX["Stop: request never reached the edge"]
RQ -->|yes| C["4. Cache and security headers"]
C --> CQ{"Edge-generated 4xx?"}
CQ -->|yes| CX["Stop: Security Events by Ray ID"]
CQ -->|no| W["5. Worker: outcome and trace"]
W --> WQ{"Worker on this route?"}
WQ -->|yes| WX["Worker evidence decides"]
WQ -->|no| O["6. Origin: 52x and direct test"]
WX --> O
O --> Z["One root-cause claim with recovery evidence"]
classDef primary fill:#132440,color:#ffffff,stroke:#0b172b;
classDef secondary fill:#16476A,color:#ffffff,stroke:#0f314a;
classDef ok fill:#3B9797,color:#ffffff,stroke:#2a6f6f;
classDef danger fill:#BF092F,color:#ffffff,stroke:#7a0420;
classDef warn fill:#c4873b,color:#132440,stroke:#8a5a1f;
class DQ,TX,RX,CQ,O,Z primary;
class S,D,DX,T,TQ,R,RQ,C,CX,W,WQ,WX secondary;
Figure 1 encodes one habit that matters more than any command.
Change one thing, then re-run the same request
A different URL, a different client, or a five-minute gap introduces new variables. Keep a control hostname that shares the zone but not the Worker route or the cache rule, and compare the two. The comparison is what turns a guess into a finding.
Figure 2 makes the boundaries explicit. Evidence from boundary 2 cannot explain why boundary 3 refused a connection, and a clean dig at boundary 1 does not excuse a 526 at boundary 3. Collect the last piece of evidence that exists, then test the next hop.
Separate TLS Failures From Origin 52x Errors
TLS is two connections: browser to edge, and edge to origin. The encryption mode governs the second; the certificate the browser sees belongs to the first. Most "SSL is broken" tickets collapse the two, which is why teams replace the wrong certificate.
Split the two connections. A browser-to-edge failure usually produces no HTTP status: the browser reports a certificate error and curl exits 60, so there is no Ray ID because no HTTP response completed. An edge-to-origin failure under Full or Full (strict) does produce a response — 525 when the handshake fails, 526 when Cloudflare cannot validate the origin certificate. Both are TLS failures, and that overlap is the trap.
Same hostname, same minute, two different owners — and two different fixes. Run each leg separately and keep the results:
The --connect-to form keeps the hostname and SNI while connecting to the origin address, which is how Cloudflare documents separating origin behavior from edge behavior. curl -k answers only whether the origin responds when validation is skipped; it is a diagnostic, never a fix.
Figure 3 shows the branch structure. The first branch is "did any HTTP status come back?", because that single observation decides whether you are debugging a certificate or a connection.
| Symptom | Failed leg | Evidence to capture | First safe action |
|---|---|---|---|
Browser certificate error, curl exit 60, no cf-ray | Browser to edge | openssl s_client -showcerts leaf issuer, subject, expiry; SNI used | Confirm the hostname is covered by an edge certificate and that the chain is complete |
HTTP 526 with cf-ray | Edge to origin, validation | Origin certificate via --connect-to; hostname match, expiry, issuer chain | Fix the origin chain or expiry; do not weaken Full (strict) as a permanent fix |
HTTP 525 with cf-ray | Edge to origin, handshake | Origin TLS listener, supported versions and ciphers, origin error log | Check that the origin accepts TLS on the configured port and protocol |
HTTP 522 with cf-ray | Edge to origin, network or ACK | Direct origin test from another network; origin firewall rules for Cloudflare IPs | Check SYN reachability and firewall before changing TLS settings |
HTTP 520 with cf-ray | Edge to origin, malformed response | Origin log at the same Ray ID; response size; headers over 128 KB | Look for a crash, an empty reply, or oversized cookies and headers |
HTTP 524 with cf-ray | Edge to origin, slow response | Origin request duration; the 125-second proxy read timeout | Profile or queue the slow work; do not retry it harder |
HTTP 523 with cf-ray | Edge to origin, no route | Origin IP, route table, VPC or firewall path | Fix routing or the origin address, not the certificate |
The 52x family is narrower than "the server is down." Error 520 means the origin returned an empty, unknown, or unexpected response — a crash, a security plugin blocking Cloudflare IPs, headers over 128 KB, or malformed responses. Error 521 means the origin refused the connection. Error 522 means no SYN+ACK within 19 seconds, or no ACK within 90 seconds.
The remaining codes split the same way. Error 523 means no route to the origin. Error 524 means the connection succeeded but no body arrived before the 125-second proxy read timeout. Error 525 is a failed handshake; 526 is a certificate Cloudflare could not validate.
Two codes that mislead
A 522 is not proof that TCP never established, because a timeout while TLS is pending can be reported as 522 rather than 525. And 502 and 504 can come from the edge or the origin, so "5xx means Cloudflare" is invalid; read the body, Ray ID, and origin log.
Figure 3 also marks where one test is inconclusive. A 522 from one network and a 200 from another points at routing or a firewall, not the application.
%%{init: {'theme':'base','themeCSS':'.edgeLabel .label text, .edgeLabel text, .edgeLabel span { fill:#132440 !important; color:#132440 !important; }','themeVariables': {'primaryColor':'#16476A','primaryTextColor':'#ffffff','primaryBorderColor':'#132440','secondaryColor':'#3B9797','secondaryTextColor':'#ffffff','secondaryBorderColor':'#132440','tertiaryColor':'#c4873b','tertiaryTextColor':'#132440','tertiaryBorderColor':'#132440','lineColor':'#5a6e82','textColor':'#132440','mainBkg':'#16476A','nodeBorder':'#132440','clusterBkg':'#eef3f7','clusterBorder':'#132440','edgeLabelBackground':'#ffffff','actorBkg':'#16476A','actorTextColor':'#ffffff','actorBorder':'#132440','activationBkgColor':'#3B9797','activationBorderColor':'#132440','signalColor':'#5a6e82','signalTextColor':'#132440','noteBkgColor':'#c4873b','noteTextColor':'#132440','noteBorderColor':'#132440','labelBoxBkgColor':'#a8dede','labelBoxBorderColor':'#132440','labelTextColor':'#132440','loopTextColor':'#132440','altBackground':'#f8f9fa','fontFamily':'DM Sans, sans-serif'}}}%%
flowchart TD
Q["HTTPS request fails"] --> H{"Any HTTP status?"}
H -->|no| A["Browser or curl TLS error"]
A --> A1["openssl s_client -showcerts"]
A1 --> A2{"Chain valid for hostname?"}
A2 -->|no| A3["Edge certificate: issuance or coverage"]
A2 -->|yes| A4["Client trust, SNI, protocol, or HSTS"]
H -->|yes| B{"Status 525 or 526?"}
B -->|yes| B1["Edge-to-origin TLS under Full or Full strict"]
B1 --> B2["curl --connect-to origin IP"]
B2 --> B3{"Origin certificate valid?"}
B3 -->|no| B4["Fix origin chain, expiry, or hostname"]
B3 -->|yes| B5["Check SNI, port, and mode alignment"]
B -->|no| C{"Status 520, 521, 522, 523, or 524?"}
C -->|yes| C1["Edge-to-origin reachability or time"]
C1 --> C2["Check firewall, route, 19 s SYN, 125 s read"]
C -->|no| D{"Status 502 or 504?"}
D -->|yes| D1["Edge or origin: read body and both logs"]
D -->|no| D2["Origin application: join its log by Ray ID"]
classDef primary fill:#132440,color:#ffffff,stroke:#0b172b;
classDef secondary fill:#16476A,color:#ffffff,stroke:#0f314a;
classDef ok fill:#3B9797,color:#ffffff,stroke:#2a6f6f;
classDef danger fill:#BF092F,color:#ffffff,stroke:#7a0420;
classDef warn fill:#c4873b,color:#132440,stroke:#8a5a1f;
class A3,B1,B2,B4,C1,C2,D1,D2 primary;
class H,A1,A4,B5 secondary;
class A2,B3 ok;
class Q,A,B,C,D danger;
Not every knob exists on your plan
The 125-second proxy read timeout is adjustable only for Enterprise zones, so a smaller origin timeout may be the practical fix elsewhere. Dashboard error analytics uses a 1% traffic sample, so it finds patterns, not individual requests; the Ray ID lookup is the per-request tool. Do not turn an Enterprise-only setting into advice for every reader.
Check Cache and Security Decisions
Cache and security produce the same complaint — "the site is wrong" — and require different evidence. The CF-Cache-Status header is the cache's own account of what happened. Read the value together with Age; each one implies a different next test.
| Cache status | Meaning | Next test |
|---|---|---|
| HIT | Served from cache; Age is the entry's age since admission or revalidation | Confirm the cache key and the rule that matched |
| MISS | Eligible but absent, so the origin was asked | Compare age and Cache-Control across two requests |
| EXPIRED | Present but stale, so the origin was asked again | Check whether the origin sent a fresh response |
| REVALIDATED | A conditional request confirmed the cached copy | Treat the stored entry as current |
| UPDATING | An asynchronous stale-while-revalidate refresh serves the stale copy meanwhile | Wait for the refresh, then re-read age |
| STALE | Expired, and the origin was unreachable, so the stale copy was served | Investigate origin reachability, not the cache |
| BYPASS | A candidate at request time, but the origin response refused storage: no-store, bare private, Set-Cookie, Vary: *, or an oversized object | Fix the origin response or its size, not the purge |
| DYNAMIC | The edge decided at request time that the asset was not eligible | Fix eligibility; a purge cannot help |
| NONE / UNKNOWN | No cache lookup: a block, a redirect rule, or a Worker response with no subrequest | Look earlier in the request path |
The most consequential misreading is treating DYNAMIC as "the cache is cold." It means the request was never a candidate: uncached HTML or JSON, a Bypass cache setting, or Development Mode. Purging cannot fix a request that never consulted the cache. BYPASS is different: the request was a candidate, but the origin response refused storage, so the fix is in the origin headers.
A HIT is not a correctness test
A HIT is not proof that the cached copy is correct, and DYNAMIC is not proof that the cache is cold. Read the status together with its age, the cache key variant, and the rule that matched; a purge aimed at the wrong key produces a clean-looking purge and an unchanged page.
A cache root cause needs recovery evidence, not a purge. Suppose the pricing page shows an old price after a deploy. Record the status, age, and Cache-Control for the exact URL, then request the same path with a distinguishing query string such as ?v=2. If the plain URL is a HIT with an old age and the variant is a MISS with fresh content, the origin is fine and one entry is stale. Purge that URL and repeat: a MISS followed by a HIT with a reset age is recovery evidence. A HIT with the pre-purge age means the purge targeted a different key — commonly apex versus www, a stripped query string, or a device variant.
Security decisions come earlier than cache lookups. A WAF custom rule that blocks a request produces a 403 (or a 1020 page) with a Ray ID and usually CF-Cache-Status: NONE/UNKNOWN, because the response never reached cache. That combination is a signal to stop debugging cache. Search Security Events for the Ray ID; the event names the service, rule, and action. Security Events may use sampled data, so a missing event is not proof that no rule matched — widen the window and check the rule's own logs before blaming the origin.
Challenges are a third outcome. A successful solve sets cf_clearance, and a command-line client never solves one, so "works in my browser, fails in CI" is often a challenge, not an outage. Some edge-generated security responses also carry cf-mitigated; when present, treat the response as produced by Cloudflare's security layer rather than your application.
What a finished root cause sounds like
"The /pricing entry was cached by rule X under key Y for two hours; the deploy changed the origin body but not the URL, so the edge served the old entry. Recovery: purge by URL, first request a MISS, second a HIT with an age near zero." That names the mechanism, the key, and the evidence.
Follow the Worker and Its Bound Resources
A Worker changes what "the response" means. On a matched route it runs on the request path and can synthesize a response without any origin request. The user-visible response may then carry CF-Cache-Status: NONE/UNKNOWN; if the Worker calls fetch, the subrequest gets its own cache status while the main request still reports none. Reading the main header as if it described the subrequest is a common false hypothesis.
The same layering applies to bindings. A Worker may hold KV, R2, D1, Durable Object, service-binding, or secret bindings, each an independent dependency with its own latency and failure mode. Cloudflare's tracing instruments those calls automatically: fetch calls, KV reads, R2 operations, Durable Object invocations, and RPC calls appear as spans without code changes. Custom spans can mark application stages with ctx.tracing.enterSpan, and span context exposes trace and span IDs that can be logged next to the Ray ID.
Failure codes narrow the search:
- 1101 — the Worker threw an uncaught JavaScript exception; Workers Logs or
wrangler tailshows it, and source maps make the stack readable. - 1102 — the Worker exceeded a resource limit; the outcome distinguishes
exceededCpufromexceededMemory, which are different fixes. - 1027 — the free-tier daily request limit was reached.
- 1042 — a same-zone fetch without the
global_fetch_strictly_publicflag, or aworkers.devURL with no Worker serving it. - 1024 — a subrequest targeted a Cloudflare-owned IP address.
Pull the evidence by request, not by scrolling. Stream the Worker's own log lines and keep a local copy while you reproduce the failure:
Match the line to the Ray ID or trace ID you already recorded, then read the outcome and the exception. Source maps turn the stack into file and line numbers; the same trace shows which binding span was reached before the failure.
Four failures the response cannot show
Work scheduled after the response is invisible to the client. A rejection inside ctx.waitUntil cannot change the status already sent; only logs and traces show it. A try/catch that turns every binding error into a 200 makes the service look healthy while data is missing, and a binding renamed in code but not in configuration throws on first access as 1101. CPU time is not wall time either: awaiting a slow origin consumes wall time without the same CPU budget.
A composite case shows the same discipline. The api.example.com endpoint starts returning 1101 after a release while the edge is healthy, the cache header says none, and the origin sees no request. Workers Logs filtered on the error shows a TypeError on the sessions binding, and the trace has no KV span: the binding was renamed in the configuration but not in the code. Recovery evidence is the same request returning 200, a KV span in the trace, and the route's error count back at zero — no purge, DNS change, or WAF exception was involved.
Figure 4 separates what the client sees from what the operator can prove. Four failures that look similar from outside end in different places: a 1101 before the response exists, a caught binding error, an origin fetch failure, and a waitUntil rejection the client never sees.
The tradeoff is real. More instrumentation means more log volume, retention cost, and redaction work. The minimum useful set is one structured line per request with the Ray ID, trace ID, matched route, binding names touched, outcome, and duration. That line is what turns "the Worker is flaky" into a bounded claim.
Investigate a Set of Deliberately Broken Test Scenarios
Investigate a Set of Deliberately Broken Test Scenarios
Status: design-only. Not executed for this article. Every "expected" statement below is a prediction from documented behavior, not a measured result.
Prerequisites. No Enterprise feature is required: the exercise uses standard 52x behavior and Worker error codes, not configurable timeouts or Log Explorer. Without a separate origin, run scenarios 1, 5, 6, and 7 and record the rest as not tested.
- Zone and origin: a Free or Pro zone, one proxied test hostname (
lab.example.com), and an origin you can edit. - Worker: deployed on a route such as
lab.example.com/api/*. - Local tools:
digandcurlfor DNS and HTTP. - TLS and deploy:
openssland Wrangler.
Minimal setup. Build four small pieces, then record a baseline before changing anything.
- Origin: serve
/pricingwith a visible version string and a short, explicit Cache-Control. - Cache Rule: make
/pricingeligible for two hours so you can stale it deliberately. - WAF: one disabled custom rule blocking requests whose User-Agent contains
troubleshoot-probeon/admin. - Worker: reads one KV binding and returns JSON at
/api/version.
dig +short lab.example.com
curl -sS -D - -o /dev/null https://lab.example.com/pricing
# keep cf-ray, cf-cache-status, Age, and the /cdn-cgi/trace colo value
| # | Break this | Expected signature | Failure check |
|---|---|---|---|
| 1 | DNS-only A record on broken.lab.example.com pointing at an address with nothing listening | Connection failure with no Ray ID | A Ray ID means the record is still proxied; the test proved nothing about DNS |
| 2 | Proxied origin address that drops traffic | 522 with a Ray ID after the connect timeout | A DNS error means the record is not proxied; restore the address afterwards |
| 3 | Self-signed origin certificate under Full (strict) | 526 with a Ray ID; --connect-to shows the same certificate | Success under Full is a mode difference, not a fix |
| 4 | Prime /pricing to HIT, then change the origin body without changing the URL | Old body and growing Age; ?v=2 fresh; purge gives MISS then HIT | A HIT with the pre-purge Age means the purge missed the key |
| 5 | Enable the WAF rule and request with the probe user agent | 403 or a 1020 page, Ray ID, no cache lookup | An absent event means another layer blocked it, or sampling hid it |
| 6 | Rename the KV binding in code but not in configuration | 1101, exception in Workers Logs, no KV span | A 200 with a KV span and outcome success means the names match again |
| 7 | Throw inside ctx.waitUntil after returning the response | 200 to the client; the failure appears only in logs or traces | A 5xx means the throw happened before the response |
| 8 | Endpoint that sleeps past the read timeout | 524 with a Ray ID while the origin still works | A 522 means the connection never established |
One signature per scenario. A correct run produces no Ray ID, 522, 526, a stale HIT, a 403 with no cache lookup, 1101, a 200 with a post-response log, and 524. Restore the address or mode after each scenario, or the next test starts contaminated; any scenario that repeats another's signature means the setup, not the hypothesis, needs fixing.
Cost is wall-clock only. DNS queries are free; a handful of Worker invocations and proxied requests is negligible; no add-on is required. The 524 test simply occupies a connection for over two minutes. Cleanup: delete the WAF rule, the Cache Rule, the Worker route, the test records, and the broken hostname, then purge the zone once and confirm the baseline request is 200 with the expected headers.
Write a Root-Cause Report for Each Observed Symptom
The deliverable is a falsifiable paragraph, assembled from evidence in this order:
- Request identity: UTC timestamp, exact URL, client, network, and Ray ID.
- Name and edge: DNS answer and TTL; HTTP status; certificate observation per TLS leg.
- Cache and security: cache status and age; security event matched by Ray ID.
- Worker and origin: outcome, trace ID, direct-to-origin result, and the single change that was made.
Keep failing and passing requests close in time and input, and state which layer's evidence is missing rather than treating absence as success. "No WAF event" is weak; "no WAF event and cf-cache-status: HIT" is stronger, because it locates the decision that actually happened.
Pass/fail evidence. These are acceptance criteria for the method, not lab results.
- P1 — Name and route proven. PASS if it has a
diganswer with TTL and a failing-requestcf-ray. FAIL if the first entry is a config change. - P2 — TLS leg named. PASS if browser-to-edge and edge-to-origin are distinguished by a certificate observation. FAIL if "SSL error" appears without a leg.
- P3 — 52x tied to a documented condition. PASS if 522, 523, 524, or 526 is connected to the 19-second SYN, 90-second ACK, 125-second read, route, or validation condition. FAIL if "server down" is the explanation.
- P4 — Cache claim tested against key and age. PASS if status,
Age, and key variant (apex versuswww, query string, device) are recorded. FAIL if a purge comes first. - P5 — Security decision confirmed. PASS if Security Events shows the service, rule, and action for the Ray ID. FAIL if a 403 is blamed on the origin without a lookup.
- P6 — Worker evidence present. PASS if the outcome (success, exception,
exceededCpu,exceededMemory) and a log line or span are recorded. FAIL if a 1101 is "fixed" by redeploying without reading logs. - P7 — Recovery proven with one change. PASS if the same request returns the expected result after one change, with before and after Ray IDs. FAIL if several settings changed and causality is unknown.
Self-check.
- A request returns HTTP 522 with
cf-ray, anddigshows the correct proxied answer. Is DNS the cause? No. The Ray ID proves the request reached the edge, so resolution succeeded. 522 is edge-to-origin: no SYN+ACK within 19 seconds, or no ACK within 90 seconds. Check the origin path and firewall. - After a deploy, the cache status is
DYNAMICand the page is stale. Will a purge help? No.DYNAMICmeans the request was never a cache candidate — no matching rule, a Bypass cache setting, an uncached extension, or Development Mode. A purge only removes stored entries. Fix eligibility, then judge freshness. - A Worker returns 200 but the downstream write failed. Where is the evidence? In logs and traces, not the status. Work scheduled with
ctx.waitUntilruns after the response, so the client cannot see its failure. Filter Workers Logs by the Ray ID or trace ID.
Unresolved limitations. Ray IDs are not guaranteed unique, so a lookup can return more than one event. Security Events and dashboard error analytics may use sampled data, so a single request may not appear; absence is not proof. The 52x codes are coarse: 522 can be emitted while TLS is pending, and 520 covers several unrelated origin behaviors. Plan-gated controls such as configurable proxy timeouts and some log retention paths are unavailable on smaller plans, so a runbook step may be untestable. Finally, nothing here observes the origin's internal state or the client's local network; both need their own logs.
Verification note. Product behavior, error definitions, header semantics, and limits were checked against Cloudflare documentation on 2026-11-05 (planning baseline 2026-11-02). No hosted exercise was executed, and no latency, error rate, or cost figure is presented as measured. Command syntax is standard curl, dig, and OpenSSL usage; confirm flags for your versions.
References.
- Cloudflare Ray ID: https://developers.cloudflare.com/fundamentals/reference/cloudflare-ray-id/
- HTTP headers, including
cf-ray: https://developers.cloudflare.com/fundamentals/reference/http-headers/ - Time to Live for DNS records: https://developers.cloudflare.com/dns/manage-dns-records/reference/ttl/
- Cache responses and
CF-Cache-Status: https://developers.cloudflare.com/cache/concepts/cache-responses/ - Cloudflare 5xx errors: https://developers.cloudflare.com/support/troubleshooting/http-status-codes/cloudflare-5xx-errors/
- Error 522: https://developers.cloudflare.com/support/troubleshooting/http-status-codes/cloudflare-5xx-errors/error-522/
- Error 524: https://developers.cloudflare.com/support/troubleshooting/http-status-codes/cloudflare-5xx-errors/error-524/
- Error 526: https://developers.cloudflare.com/support/troubleshooting/http-status-codes/cloudflare-5xx-errors/error-526/
- Connection limits and timeouts: https://developers.cloudflare.com/fundamentals/reference/connection-limits/
- Encryption modes: https://developers.cloudflare.com/ssl/origin-configuration/ssl-modes/
- Security Events: https://developers.cloudflare.com/waf/analytics/security-events/
- Workers Logs: https://developers.cloudflare.com/workers/observability/logs/workers-logs/
- Workers traces: https://developers.cloudflare.com/workers/observability/traces/
- Workers error codes: https://developers.cloudflare.com/workers/observability/errors/
- Gathering troubleshooting information: https://developers.cloudflare.com/support/troubleshooting/general-troubleshooting/gathering-information-for-troubleshooting-sites/
Next in the Series
In Manage Cloudflare With APIs and Infrastructure as Code, we'll explore Make permissions, ownership, state, and drift explicit.