Random Error 1102 (“Worker exceeded resource limits”) but metrics show low CPU. How do I debug this?

Summary / context - Stack: hono + trpc serving a React Router 7 app. - I intermittently get Error 1102 when visiting the site: “Worker exceeded resource limits”. - I attached two screenshots: Worker metrics and the 1102 error page. - I read the CPU time docs (link: https://developers.cloudflare.com/workers/platform/limits/#cpu-time). What’s confusing - In Metrics/Logs I don’t see any request taking more than ~300–400 ms end-to-end. - CPU time percentiles look tiny: P50 ~62 ms, P90 ~104 ms, P99/P999 ~127 ms. - Wall/request duration is also low (median ~165 ms, P99 ~383 ms). - I can’t find a stack trace or any clear error log for the failing invocation. What I’ve tried - Looked for long/slow requests in Logs and Analytics → nothing stands out. - Searched code for obvious infinite loops or recursion; nothing obvious yet. - I don’t have a custom cpu_ms limit set (so default 30s). - I’m not sure how to correlate that Ray ID to a specific failing code path—logs seem to be missing for that run. Questions - What’s the best way to debug a single 1102 event? Can I reliably trace by Ray ID and see CPU/wall time per invocation even if the isolate was killed? - Are there common gotchas that cause 1102 despite low percentile metrics—e.g., self--fetch recursion due to routing, asset proxying, or SSR patterns? Any recommended checks to confirm/deny that? - Is there a way to enable per-invocation trace events or a CPU profile that survives termination? - Any other settings or Wrangler commands I should use to surface the failing branch (e.g., temporary low cpu_ms, specific logging flags)? Attachments - Screenshot 1: Worker metrics (CPU Time, Wall Time, Request duration showing the sub-400ms percentiles) - Screenshot 2: Error 1102 page with the Ray ID above Thanks in advance!
No description
No description
4 Replies
Walshy
Walshy3mo ago
are you on the free plan or paid?
Franco Romano Losada
free plan
Isaac McFadyen
Isaac McFadyen3mo ago
*10ms
Franco Romano Losada
Oh you are right, I never looked into the free plan limits about CPU time ha Leaving this for other people: https://developers.cloudflare.com/workers/platform/limits/#worker-limits Thank you all, will upgrade once I can go live 😄

Did you find this page helpful?