I am recently getting error 502 Bad Gateway quite often. I am processing a file and batch calling ChatCompletion.create repeatedly. This works most of the time but since a few days, I have been getting the 502 error a lot.
I am looking for suggestion to handle this.
The Error codes page (OpenAI API) does not mention 502 so I thought to ask here what’s the best way to approach this.
ps. I will appreciate if someone can share example Python code to handle this to retry a few times when this error occurs.
Update: I was able to resolve this by using the try/except sample code provided on the error codes page. Now successfully processing batches with 1000+ api calls.
This is an ongoing issue for us, too.
Also, since the completion does execute on the server, we are getting billed quite a lot for things that never arrive.
It’s really not great.
So are there some news about this error ? Same as you guys, I make big requests that cost me a lot then it’s billed but it fails and I cannot get the result of my request …
As I am processing a lot of data, it is kind of a pain. I leave the computer to let the stuff process for some hours, to find out that it ran into some GatewayError after 10 minutes.
Just had a 502 and found this thread. Seems like people might be looking for code so wanted to share that I found some examples for exponential backoff in the docs under Rate limit increase.