chatGPT-discord-bot
chatGPT-discord-bot copied to clipboard
Error: Something went wrong, please try again later!
2023-02-11 11:40:19 INFO src.bot -> BOT-GPT#1462 is now running! 2023-02-11 11:40:30 INFO src.bot -> ReeceP#4529 : 'hi' (fba) 2023-02-11 11:40:31 ERROR src.bot -> Error while sending message: Error communicating with OpenAI Traceback (most recent call last):
Please help. It hasn't worked for a few days now. It was working fine then decided to not work anymore
I have tried using a different OpenAI login, changed discord server but still not having any luck Please help!
the API never work now. so, there is no solution
Does this mean that this bot will no longer work?
My bot is functioning normally, please provide your environment
Apologies, what do you mean by environment?
Your computer's operating system, network environment (if using VPN?), and python version
Processor Intel(R) Core(TM) i7-1065G7 CPU @ 1.30GHz 1.50 GHz Installed RAM 8.00 GB (7.68 GB usable) System type 64-bit operating system, x64-based processor Edition Windows 10 Home Version 21H2
Nord VPN - Connected to UK (still doesn't work when deactivated) (I'm from the UK)
Python 3.11.1
Is there anything else I can try?
I cannot reproduce this error, sorry
Could you provide more error messages?(If there are any)
2023-02-13 13:37:41 INFO src.bot -> GPT-BOT#8175 is now running!
2023-02-13 13:39:09 INFO src.bot -> ReeceP#4529 : 'hi' (fba)
**2023-02-13 13:39:10 ERROR src.bot -> Error while sending message: Error communicating with OpenAI
Traceback (most recent call last):
File "C:\Users\RPenn\AppData\Local\Programs\Python\Python311\Lib\site-packages\aiohttp\connector.py", line 980, in _wrap_create_connection
return await self._loop.create_connection(*args, **kwargs) # type: ignore[return-value] # noqa
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\RPenn\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 1106, in create_connection
transport, protocol = await self._create_connection_transport(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\RPenn\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 1139, in _create_connection_transport
await waiter
File "C:\Users\RPenn\AppData\Local\Programs\Python\Python311\Lib\asyncio\sslproto.py", line 574, in _on_handshake_complete
raise handshake_exc
File "C:\Users\RPenn\AppData\Local\Programs\Python\Python311\Lib\asyncio\sslproto.py", line 556, in _do_handshake
self._sslobj.do_handshake()
File "C:\Users\RPenn\AppData\Local\Programs\Python\Python311\Lib\ssl.py", line 979, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:992)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\RPenn\AppData\Local\Programs\Python\Python311\Lib\site-packages\openai\api_requestor.py", line 588, in arequest_raw
result = await session.request(**request_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\RPenn\AppData\Local\Programs\Python\Python311\Lib\site-packages\aiohttp\client.py", line 536, in _request
conn = await self._connector.connect(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\RPenn\AppData\Local\Programs\Python\Python311\Lib\site-packages\aiohttp\connector.py", line 540, in connect
proto = await self._create_connection(req, traces, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\RPenn\AppData\Local\Programs\Python\Python311\Lib\site-packages\aiohttp\connector.py", line 901, in _create_connection
_, proto = await self._create_direct_connection(req, traces, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\RPenn\AppData\Local\Programs\Python\Python311\Lib\site-packages\aiohttp\connector.py", line 1206, in _create_direct_connection
raise last_exc
File "C:\Users\RPenn\AppData\Local\Programs\Python\Python311\Lib\site-packages\aiohttp\connector.py", line 1175, in _create_direct_connection
transp, proto = await self._wrap_create_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\RPenn\AppData\Local\Programs\Python\Python311\Lib\site-packages\aiohttp\connector.py", line 982, in _wrap_create_connection
raise ClientConnectorCertificateError(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorCertificateError: Cannot connect to host api.openai.com:443 ssl:True [SSLCertVerificationError:
(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:992)')]
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\RPenn\OneDrive\Desktop\chatGPT-discord-bot-0.8.1\src\bot.py", line 31, in send_message
response = f"{response}{await responses.handle_response(user_message)}"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\RPenn\OneDrive\Desktop\chatGPT-discord-bot-0.8.1\src\responses.py", line 9, in handle_response
response = await chatbot.ask(message)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\RPenn\AppData\Local\Programs\Python\Python311\Lib\site-packages\revChatGPT\Official.py", line 215, in ask
completion = await self._get_completion(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\RPenn\AppData\Local\Programs\Python\Python311\Lib\site-packages\revChatGPT\Official.py", line 196, in _get_completion
return await openai.Completion.acreate(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\RPenn\AppData\Local\Programs\Python\Python311\Lib\site-packages\openai\api_resources\completion.py", line 45, in acreate return await super().acreate(*args, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\RPenn\AppData\Local\Programs\Python\Python311\Lib\site-packages\openai\api_resources\abstract\engine_api_resource.py", line 217, in acreate
response, _, api_key = await requestor.arequest(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\RPenn\AppData\Local\Programs\Python\Python311\Lib\site-packages\openai\api_requestor.py", line 301, in arequest
result = await self.arequest_raw(
^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\RPenn\AppData\Local\Programs\Python\Python311\Lib\site-packages\openai\api_requestor.py", line 605, in arequest_raw
raise error.APIConnectionError("Error communicating with OpenAI") from e
openai.error.APIConnectionError: Error communicating with OpenAI
CERTIFICATE_VERIFY_FAILED error might be caused by an outdated certifi package in Python Here's a relevant discussion: https://stackoverflow.com/questions/51925384/unable-to-get-local-issuer-certificate-when-using-requests-in-python
I got same errror Error: Something went wrong, please try again later!
So it works when I set to private / public. Just wont create an answer when I type /chat
CERTIFICATE_VERIFY_FAILED error might be caused by an outdated certifi package in Python Here's a relevant discussion: https://stackoverflow.com/questions/51925384/unable-to-get-local-issuer-certificate-when-using-requests-in-python
Have you tried the solution mentioned in here?
No, still isnt working :(
2023-02-20 08:10:40 INFO discord.client logging in using static token 2023-02-20 08:10:40 INFO discord.gateway Shard ID None has connected to Gateway (Session ID: 8e5853e1d65f2495a809c96a6869d0f1). 2023-02-20 08:10:42 INFO src.bot -> No Channel selected. Skip sending starting prompt. 2023-02-20 08:10:43 INFO src.bot -> GPT-BOT#8175 is now running!
This is what shows when first running the code
Hey Zero,
I have been attempting to assist with an issue on Discord, and I have determined that the problem is related to SSL. I have noticed that there have been recent issues with the text-davinci-003 model, as indicated on the status page. It is possible that the problem is due to a temporary SSL certificate issue on their end.
Have you tested your code with a different model?
Hey Zero,
I have been attempting to assist with an issue on Discord, and I have determined that the problem is related to SSL. I have noticed that there have been recent issues with the text-davinci-003 model, as indicated on the status page. It is possible that the problem is due to a temporary SSL certificate issue on their end.
Have you tested your code with a different model?
The issue is nothing to do with the model, it might be caused by some network problem communicating with the OpenAI server in particular network environment (usually happen when using VPN)
can also refer here for some solution: https://community.openai.com/t/ssl-certificate-verify-failed/32442/29
Might be a bug with aiohttp
package either, I can't fix it because I can't replicate the issue
@Pen-Ace I've never had an ssl issue so I don't think so.