Got a lot of Bad Gateway exception lately

Anyone run into the same issue like us? We got a lot of Bad Gateway exception lately. Even when we run just only one request within few hours.

error: Bad gateway. {"error":{"code":502,"message":"Bad gateway.","param":null,"type":"cf_bad_gateway"}} 502 {'error': {'code': 502, 'message': 'Bad gateway.', 'param': None, 'type': 'cf_bad_gateway'}} {'Date': 'Tue, 29 Aug 2023 16:39:39 GMT', 'Content-Type': 'application/json', 'Content-Length': '84', 'Connection': 'keep-alive', 'X-Frame-Options': 'SAMEORIGIN', 'Referrer-Policy': 'same-origin', 'Cache-Control': 'private, max-age=0, no-store, no-cache, must-revalidate, post-check=0, pre-check=0', 'Expires': 'Thu, 01 Jan 1970 00:00:01 GMT', 'Server': 'cloudflare', 'CF-RAY': '7fe632c2cd77987f-SJC', 'alt-svc': 'h3=":443"; ma=86400'}
1 Like

Hi, this seemed an issue a few hours ago, it should all be sorted now, are you still having issues?

Could be coincidental, but the gateway error is a sign that an intermediate relay server is having problems along the route from you to the OpenAI endpoint, not typically an API failure.

1 Like

Hi, I am still getting the same error message in the last 2h or so.
Anyone got the same thing?

Yes I am also getting 502 error, sometimes everything works fine but most of the times i get 502

Bad Gateway issue - anyone else having the same?

The web server reported a bad gateway error.

  • Ray ID: 8523f5648fc56aab
  • Your IP address: 82.9.104.206
  • Error reference number: 502
  • Cloudflare Location: Manchester

This error means “temporary overload or error on the OpenAI side.”
If you wait a little bit, it will almost certainly go away.
And then come back sometime later.
You have essentially no control over this, other than waiting and trying again after a bit. (Use exponential back-off if you do this in a loop.)

I’ve hit this a few times lately during rapid embedding