openai.error.ServiceUnavailableError: The server is overloaded or not ready yet

Hi,
I have tried using text-davinci-003 and text-davinci-002.
I always get this error and my program stops after a few calls.
At the same time, text-ada-001 seems pretty fine.
It looks like a traffic issue for several days and I saw some similar posts as well.
I am just wondering how others deal with it or when will it be resolved.
Thanks so much!

3 Likes

Are you a free trial user?

if you are, have a read of the last couple of posts here

(Especially the usage table)

You may be going over the 20 requests a minute. Putting in a credit card may help (Even if you have credit left)

1 Like

Hi Raymond,
Thank you for your reply.
I am not a free user, I have a monthly rate of $300.
And I saw the program costs me some money and stops in the middle, it is actually quite upset since some money was wasted even though it was not a lot.
I also thought there might be some requests quota issue, so I tried to add a time.sleep(1) to stop 1 sec after each call, but not useful for me.

3 Likes

My initial approach would be trying to save after each call and resume running where it stops,
but it seems really painful to do it in such way that I have to monitor all the way especially when I want to make thousands of calls in one sequence.
So I am wondering how others deal with it.
Thank you so much!

I also started facing same issue.
Note: I am using async implementation, v 0.26.0 openai python libray that got released 4 days back.
@raymonddavey

Iā€™m running into the same issue with davinci-003 on a paid account making no more than 50 calls/min. I reported a bug for a similar issue where I hit a rate limit, will respond here if I hear back

I canā€™t get more than 5 calls/min, and Iā€™m a paid user. Not sure whatā€™s going on?

1 Like

Hi, did you hear any response?

Not yet, but I stopped receiving the error after a few hours.

Lots of outages in the past week, check out or subscribe to for the latest:

1 Like

:melting_face: Not sure why but I just tried and still have a lot these issues either showing:
openai.error.ServiceUnavailableError: The server is overloaded or not ready yet.
or
openai.error.RateLimitError: The server is currently overloaded with other requests. Sorry about that! You can retry your request, or contact us through our help center at help.openai.com if the error persists.

Any update on this? I can confirm issues with davinci-003 are still happenng.

This is happening to me too, are there any updates? At least give us some timeout rules to implement and ensure that the requests keep operative.

This is happening for last 1-2 weeks for us, despite being paid users (spending >$500 every month). This is impacting our first few set of clients, affecting our output quality and quite frustrating.

Would anyone know if there are any limits / min set by OpenAI? or some premium plans where this doesnā€™t happen. Wonder how bigger players (copywriting tools) are managing unless they have a dedicated server or using via Azure (which too is limited access).

Thanks

I have the same problem and it keeps occuring. At first it only appeared to happen when going over a 100 queries, but now I canā€™t get even 50 queries done before it errors out. Itā€™s a bit frustrating because I can see my usage increasing but getting nothing for it in return. Iā€™m running queries to export to CSV in a for loop. Iā€™m on a paid account. Swift resolve would be greatly appreciated.

Hi Chris,
Not sure if this solves your problem, but to me when I do a sequence of calls, it stops in the middle with nothing saved and money deducted. Looks like the service now is not very stable and there is no fix.
So I try to catch this error and recall by doing something like this:

            for i in range (100):
                flag = True
                while(flag):
                    try:
                        response = openai.Completion.create(
                       
                            model="text-davinci-003",

                        )
                        flag = False
                    except openai.error.OpenAIError as e:
                        print("Some error happened here.")

Running into similar problem today.

# originally 
openai.error.RateLimitError: The server is currently overloaded with other requests. Sor
ry about that! You can retry your request, or contact us through our help center at help
.openai.com if the error persists.

# latest
openai.error.ServiceUnavailableError: The server is overloaded or not ready yet.

Same script worked fine for loop performing 500+ requests (not async) several times yesterday.
There is plenty of credits left in the account.

I ended up adding a simple exponential back off. After 1ā€“2 seconds of delay, the repeated requests that errored usually succeeds on the second try.

for delay_secs in (2**x for x in range(0, 6)):
    try:
        # Call openai request such as text completion
        break
    
    except openai.OpenAIError as e:
         randomness_collision_avoidance = random.randint(0, 1000) / 1000.0
         sleep_dur = delay_secs + randomness_collision_avoidance
         print(f"Error: {e}. Retrying in {round(sleep_dur, 2)} seconds.")
         time.sleep(sleep_dur)
         continue
1 Like

Yes, exponential backoff seems to be the solution. I took advantage of Tenacity, as explained in Rate Limits - Error Mitigation.

I used the retry parameter and passed to retry_if_exception_type() the exceptions I wanted to be considered for exponential backoff.

from tenacity import (
    retry,
    stop_after_attempt,
    wait_random_exponential,
    retry_if_exception_type
)  # for exponential backoff

@retry(
    retry=retry_if_exception_type((openai.error.APIError, openai.error.APIConnectionError, openai.error.RateLimitError, openai.error.ServiceUnavailableError, openai.error.Timeout)), 
    wait=wait_random_exponential(multiplier=1, max=60), 
    stop=stop_after_attempt(10)
)
def chat_completion_with_backoff(**kwargs):
    return openai.ChatCompletion.create(**kwargs)

# [...]

response = chat_completion_with_backoff(
                model=model,
                messages=[
                    {"role": "system", "content": system_msg},
                    {"role": "user", "content": longtext},
                ],
                max_tokens=max_tokens,
            )
4 Likes

Thanks a ton! This really helped us out when we received this error using ā€œgpt-3.5-turbo-16kā€