unexpected status 502 Bad Gateway - Errors Constantly from Toronto Canada
What version of Codex is running?
v0.80.0
What subscription do you have?
Team / Business
Which model were you using?
5.2
What platform is your computer?
Darwin 25.0.0 arm64 arm
What issue are you seeing?
- For a few weeks, am getting 502 errors from Cloudflare.
- Even if i exit codex cli and resume session, it does not fix things.
- BUT - it is session specific, some sessions work fine, some do not.
- It is like some cookies or token something that might steer to a specific sever gets cached and i can't fix fix.
- Once a session starts doing this it becomes unusable and unrecoverable.
- It is not always 100% failure! Sometimes after an hour a request might get through.
- Some requests pass, occasionally, but it hangs for like 16 minutes sometimes in a retry loop.
- I do not have any issues with any other sites and my internet speed/reachability seems happy/healthy.
Here are some examples:
■ unexpected status 502 Bad Gateway: <html>
<head><title>502 Bad Gateway</title></head>
<body>
<center><h1>502 Bad Gateway</h1></center>
<hr><center>cloudflare</center>
</body>
</html>
, request id: 9bcf27732f28ab39-YYZ
or
unexpected status 502 Bad Gateway: <html>
<head><title>502 Bad Gateway</title></head>
<body>
<center><h1>502 Bad Gateway</h1></center>
<hr><center>cloudflare</center>
</body>
</html>
, request id: 9bc882e92dec38e2-YYZ
but never via the web chat, only via CODEX CLI.
I am using Rogers ISP. Sometimes when i switch to mobile internet (Also Rogers) via my phone it works, but today that also did not work at all.
It destroys HOURS of productivity - I am basically dead in the water here.
Again - it does not affect all my CODEX sessions. I feel the more long-lived they are the higher chance of this happening.
What steps can reproduce the bug?
Using codex cli
What is the expected behavior?
Not getting Cloudflare 502 errors!
Additional information
_No response_
7 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Can you try to use the
/feedbackslash command and upload your logs and post the thread ID here? We've had one other report of this issue, but we've been unable to get any logs, and the problem is not showing up in our backend analytics.Thread ID is: 019bb4f8-6d4d-7663-8c64-8aec530a8ebe
Has been happening all day. my productivity is 1/2 at least due to it.
Apologies if you are affected by this issue. We continue to get a smattering of reports of this, but we're struggling to pin down the cause because 1) it seems to be happening to a very small number of users, 2) we're not seeing any evidence of it in our backend systems, and 3) users who hit this are unable to upload their logs using
/feedback.We suspect it's related to our Cloudflare gateway, but we need some additional clues to pin it down.
If you are experiencing this, here's how you can help us out:
npm i -g @openai/codex@0.82.0-alpha.2(note the dash: -alpha.2)
export RUST_LOG="warn,codex=trace"~/.codex/log/codex-tui.logand search for 502. On that line, find "headers={" and copy the HTTP headers.Important:
Also tell us:
This will let us correlate Cloudflare failures on their side.
Closing for lack of response.
Codex version: 26.513.11550, Windows app: