Significant-Gravitas / AutoGPT

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
https://agpt.co
Other
168.08k stars 44.35k forks source link

API Error: The server had an error while processing your request. #2553

Closed LecJackS closed 1 year ago

LecJackS commented 1 year ago

⚠️ Search for existing issues first ⚠️

Which Operating System are you using?

Linux

GPT-3 or GPT-4?

GPT-3.5

Steps to reproduce 🕹

This happened on the Stable branch.

Hard to reproduce: Need to wait for OpenAI servers to reply with an error.

Current behavior 😯

My Auto-GPT was doing great until everything got interrupted by an OpenAI server error.

Expected behavior 🤔

Exception handling so the bot execution is not interrupted.

Your prompt 📝

# Bot learning the good stuff about life, until suddenly...

Your Logs 📒

# ...
NEXT ACTION:  COMMAND = evaluate_code ARGUMENTS = {'code': "# some-generated-code"}
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/home/jack/Auto-GPT/autogpt/__main__.py", line 53, in <module>
    main()
  File "/home/jack/Auto-GPT/autogpt/__main__.py", line 49, in main
    agent.start_interaction_loop()
  File "/home/jack/Auto-GPT/autogpt/agent/agent.py", line 170, in start_interaction_loop
    self.memory.add(memory_to_add)
  File "/home/jack/Auto-GPT/autogpt/memory/local.py", line 76, in add
    embedding = create_embedding_with_ada(text)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jack/Auto-GPT/autogpt/llm_utils.py", line 137, in create_embedding_with_ada
    return openai.Embedding.create(
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jack/miniconda3/envs/autogpt/lib/python3.11/site-packages/openai/api_resources/embedding.py", line 33, in create
    response = super().create(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jack/miniconda3/envs/autogpt/lib/python3.11/site-packages/openai/api_resources/abstract/engine_api_resource.py", line 153, in create
    response, _, api_key = requestor.request(
                           ^^^^^^^^^^^^^^^^^^
  File "/home/jack/miniconda3/envs/autogpt/lib/python3.11/site-packages/openai/api_requestor.py", line 226, in request
    resp, got_stream = self._interpret_response(result, stream)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jack/miniconda3/envs/autogpt/lib/python3.11/site-packages/openai/api_requestor.py", line 619, in _interpret_response
    self._interpret_response_line(
  File "/home/jack/miniconda3/envs/autogpt/lib/python3.11/site-packages/openai/api_requestor.py", line 682, in _interpret_response_line
    raise self.handle_error_response(
openai.error.APIError: The server had an error while processing your request. Sorry about that! You can retry your request, or contact us through our help center at help.openai.com if the error persists. (Please include the request ID b6236f221e359a59794964 in your message.) {
  "error": {
    "message": "The server had an error while processing your request. Sorry about that! You can retry your request, or contact us through our help center at help.openai.com if the error persists. (Please include the request ID 1db62cf736f2e365e597949 in your message.)",
    "type": "server_error",
    "param": null,
    "code": null
  }
}
 500 {'error': {'message': 'The server had an error while processing your request. Sorry about that! You can retry your request, or contact us through our help center at help.openai.com if the error persists. (Please include the request ID 1dcf736f2265e59a5997794 in your message.)', 'type': 'server_error', 'param': None, 'code': None}} {'Date': 'Wed, 19 Apr 2023 15:43:21 GMT', 'Content-Type': 'application/json', 'Content-Length': '366', 'Connection': 'keep-alive', 'access-control-allow-origin': '*', 'openai-organization': 'user-qojwgdpc5dsm6xmgn2', 'openai-processing-ms': '30015', 'openai-version': '2020-10-01', 'strict-transport-security': 'max-age=15724800; includeSubDomains', 'x-ratelimit-limit-requests': '60', 'x-ratelimit-remaining-requests': '59', 'x-ratelimit-reset-requests': '1s', 'x-request-id': '1db62cf736f221e365e59a5997794964', 'CF-Cache-Status': 'DYNAMIC', 'Server': 'cloudflare', 'CF-RAY': '7ba6428469d4ba74-EZE', 'alt-svc': 'h3=":443"; ma=86400, h3-29=":443"; ma=86400'}
(autogpt) jack@pc:~/Auto-GPT$  
Drlordbasil commented 1 year ago

It seems to be an API issues, I've had to rerun multiple times. could be servers being updated or overloaded. I've noticed it only happened rarely before, now it's a bit more prevelent, but it's not the script.

dturton commented 1 year ago

Same thing happening to me several times already.

Drlordbasil commented 1 year ago

Yea, it's just server lag imo with the usage of GPT apis going up with this

On Wed, Apr 19, 2023 at 12:16 PM David Turton @.***> wrote:

Same thing happening to me several times already.

— Reply to this email directly, view it on GitHub https://github.com/Significant-Gravitas/Auto-GPT/issues/2553#issuecomment-1515011325, or unsubscribe https://github.com/notifications/unsubscribe-auth/A6G5RBAREGB4RMIE7EIG7KLXCAFWPANCNFSM6AAAAAAXEJAF5U . You are receiving this because you commented.Message ID: @.***>

JanKuehne commented 1 year ago

same thing here

djancan commented 1 year ago

Then should the script out put a Time-Out from server. Auto Retry in (from 1 to 30 sec) seconds ??? Hit Return to stop or system will retry 10 times before giving up.

BoccheseGiacomo commented 1 year ago

It would be useful to add some Try-except blocks to handle api connection errors and automatical retry

Drlordbasil commented 1 year ago

It would be useful to add some Try-except blocks to handle api connection errors and automatical retry

thatd be a nice addition for qol

shierro commented 1 year ago

yep, would be nice to catch this specific error and have a retry logic. is there anyone currently working on this and is it something that the maintainers are OK with? Would like to help in any way

ntindle commented 1 year ago

Duplicate of https://github.com/Significant-Gravitas/Auto-GPT/issues/2399; related: https://github.com/Significant-Gravitas/Auto-GPT/pull/214

ntindle commented 1 year ago

Duplicate of https://github.com/Significant-Gravitas/Auto-GPT/issues/2399; related: https://github.com/Significant-Gravitas/Auto-GPT/pull/214