lss233 / chatgpt-mirai-qq-bot

🚀 一键部署!真正的 AI 聊天机器人!支持ChatGPT、文心一言、讯飞星火、Bing、Bard、ChatGLM、POE,多账号,人设调教,虚拟女仆、图片渲染、语音发送 | 支持 QQ、Telegram、Discord、微信 等平台
GNU Affero General Public License v3.0
13.37k stars 1.57k forks source link

[BUG] OpenAI使用access_token登录失败 #855

Closed singularity2000 closed 1 year ago

singularity2000 commented 1 year ago

提交 issue 前,请先确认:

表现
ChatGPT网页版能正常使用,但机器人ChatGPT端无法登录OpenAI账号。

运行环境:

复现步骤
描述你是如何触发这个 BUG 的

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

预期行为
描述你认为正常情况下应该看见的情况

截图
2023-05-21 16:26:55.468 | INFO | manager.bot:login_openai:299 - 正在登录第 1 个 OpenAI 账号 2023-05-21 16:26:55.469 | INFO | manager.bot:login_V1:389 - 模式:无浏览器登录 2023-05-21 16:26:55.470 | INFO | manager.bot:__check_proxy:363 - [代理测试] 正在检查代理配置:http://127.0.0.1:7890 2023-05-21 16:26:55.517 | SUCCESS | manager.bot:check_proxy:371 - [代理测试] 连接成功! 2023-05-21 16:26:55.519 | INFO | manager.bot:__login_V1:414 - 尝试使用 access_token 登录中... 2023-05-21 16:26:55.673 | ERROR | manager.bot:login_openai:328 - 未知错误: 2023-05-21 16:26:55.679 | ERROR | manager.bot:login_openai:329 - Traceback (most recent call last):

File "E:\AI\Windows-quickstart-go-cqhttp-refs.tags.v2.5.1\python3.11\Lib\site-packages\anyio\streams\tls.py", line 130, in _call_sslobject_method result = func(*args) │ └ () └ <bound method SSLObject.do_handshake of <ssl.SSLObject object at 0x000001B601A88810>>

File "ssl.py", line 979, in do_handshake

ssl.SSLSyscallError: Some I/O error occurred (_ssl.c:992)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):

File "E:\AI\Windows-quickstart-go-cqhttp-refs.tags.v2.5.1\python3.11\Lib\site-packages\httpcore_exceptions.py", line 10, in map_exceptions yield File "E:\AI\Windows-quickstart-go-cqhttp-refs.tags.v2.5.1\python3.11\Lib\site-packages\httpcore\backends\asyncio.py", line 78, in start_tls raise exc File "E:\AI\Windows-quickstart-go-cqhttp-refs.tags.v2.5.1\python3.11\Lib\site-packages\httpcore\backends\asyncio.py", line 69, in start_tls ssl_stream = await anyio.streams.tls.TLSStream.wrap( │ │ │ │ └ <classmethod(<function TLSStream.wrap at 0x000001B601A25E40>)> │ │ │ └ <class 'anyio.streams.tls.TLSStream'> │ │ └ <module 'anyio.streams.tls' from 'E:\AI\Windows-quickstart-go-cqhttp-refs.tags.v2.5.1\python3.11\Lib\site-packages\anyi... │ └ <module 'anyio.streams' from 'E:\AI\Windows-quickstart-go-cqhttp-refs.tags.v2.5.1\python3.11\Lib\site-packages\anyio\s... └ <module 'anyio' from 'E:\AI\Windows-quickstart-go-cqhttp-refs.tags.v2.5.1\python3.11\Lib\site-packages\anyio\init.... File "E:\AI\Windows-quickstart-go-cqhttp-refs.tags.v2.5.1\python3.11\Lib\site-packages\anyio\streams\tls.py", line 122, in wrap await wrapper._call_sslobject_method(ssl_object.do_handshake) │ │ │ └ <function SSLObject.do_handshake at 0x000001B67CCDE160> │ │ └ <ssl.SSLObject object at 0x000001B601A88810> │ └ <function TLSStream._call_sslobject_method at 0x000001B601A25EE0> └ TLSStream(transport_stream=<anyio._backends._asyncio.SocketStream object at 0x000001B601A7BED0>, standardcompatible=False, ... File "E:\AI\Windows-quickstart-go-cqhttp-refs.tags.v2.5.1\python3.11\Lib\site-packages\anyio\streams\tls.py", line 151, in _call_sslobject_method raise BrokenResourceError from exc └ <class 'anyio.BrokenResourceError'>

anyio.BrokenResourceError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "E:\AI\Windows-quickstart-go-cqhttp-refs.tags.v2.5.1\python3.11\Lib\site-packages\httpx_transports\default.py", line 60, in map_httpcore_exceptions yield File "E:\AI\Windows-quickstart-go-cqhttp-refs.tags.v2.5.1\python3.11\Lib\site-packages\httpx_transports\default.py", line 353, in handle_async_request resp = await self._pool.handle_async_request(req) │ │ │ └ <Request [b'GET']> │ │ └ <function AsyncConnectionPool.handle_async_request at 0x000001B67FF747C0> │ └ <httpcore.AsyncHTTPProxy object at 0x000001B6019B0AD0> └ <httpx.AsyncHTTPTransport object at 0x000001B6019B0A10> File "E:\AI\Windows-quickstart-go-cqhttp-refs.tags.v2.5.1\python3.11\Lib\site-packages\httpcore_async\connection_pool.py", line 253, in handle_async_request raise exc File "E:\AI\Windows-quickstart-go-cqhttp-refs.tags.v2.5.1\python3.11\Lib\site-packages\httpcore_async\connection_pool.py", line 237, in handle_async_request response = await connection.handle_async_request(request) │ │ └ <Request [b'GET']> │ └ <function AsyncTunnelHTTPConnection.handle_async_request at 0x000001B67FF758A0> └ <AsyncTunnelHTTPConnection ['http://127.0.0.1:7890', HTTP/1.1, ACTIVE, Request Count: 1]> File "E:\AI\Windows-quickstart-go-cqhttp-refs.tags.v2.5.1\python3.11\Lib\site-packages\httpcore_async\http_proxy.py", line 289, in handle_async_request stream = await stream.start_tls(**kwargs) │ │ └ {'ssl_context': <ssl.SSLContext object at 0x000001B6008E74A0>, 'server_hostname': 'chatgpt-proxy.lss233.com', 'timeout': 5.0} │ └ <function AsyncIOStream.start_tls at 0x000001B601A85120> └ <httpcore.backends.asyncio.AsyncIOStream object at 0x000001B601A7B790> File "E:\AI\Windows-quickstart-go-cqhttp-refs.tags.v2.5.1\python3.11\Lib\site-packages\httpcore\backends\asyncio.py", line 66, in start_tls with map_exceptions(exc_map): │ └ {<class 'TimeoutError'>: <class 'httpcore.ConnectTimeout'>, <class 'anyio.BrokenResourceError'>: <class 'httpcore.ConnectErro... └ <function map_exceptions at 0x000001B67FDE1DA0>

File "contextlib.py", line 155, in exit

File "E:\AI\Windows-quickstart-go-cqhttp-refs.tags.v2.5.1\python3.11\Lib\site-packages\httpcore_exceptions.py", line 14, in map_exceptions raise to_exc(exc) └ <class 'httpcore.ConnectError'>

httpcore.ConnectError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):

File "E:\AI\Windows-quickstart-go-cqhttp-refs.tags.v2.5.1\chatgpt\bot.py", line 17, in loop.run_until_complete(botManager.login()) │ │ │ └ <function BotManager.login at 0x000001B6007D4B80> │ │ └ <manager.bot.BotManager object at 0x000001B60083E250> │ └ <function BaseEventLoop.run_until_complete at 0x000001B67E512520> └

File "asyncio\base_events.py", line 640, in run_until_complete sock.setblocking(False)

File "asyncio\windows_events.py", line 321, in run_forever

File "asyncio\base_events.py", line 607, in run_forever sock.close()

File "asyncio\base_events.py", line 1922, in _run_once

File "asyncio\events.py", line 80, in _run self._loop = loop │ └ <member '_loop' of 'Handle' objects> └ <Handle <TaskStepMethWrapper object at 0x000001B601A66EC0>()>

File "E:\AI\Windows-quickstart-go-cqhttp-refs.tags.v2.5.1\chatgpt\manager\bot.py", line 136, in login await self.login_openai() │ └ <function BotManager.login_openai at 0x000001B6007D5260> └ <manager.bot.BotManager object at 0x000001B60083E250>

File "E:\AI\Windows-quickstart-go-cqhttp-refs.tags.v2.5.1\chatgpt\manager\bot.py", line 305, in login_openai bot = await self.__login_V1(account) │ └ OpenAIAccessTokenAuth(mode='browserless', proxy='http://127.0.0.1:7890', driver_exec_path=None, browser_exec_path=None, conve... └ <manager.bot.BotManager object at 0x000001B60083E250>

File "E:\AI\Windows-quickstart-go-cqhttp-refs.tags.v2.5.1\chatgpt\manager\bot.py", line 417, in __login_V1 if await __V1_check_auth():

File "E:\AI\Windows-quickstart-go-cqhttp-refs.tags.v2.5.1\chatgpt\manager\bot.py", line 404, in __V1_check_auth await bot.get_conversations(0, 1) │ └ <function AsyncChatbot.get_conversations at 0x000001B6007A6D40> └ <revChatGPT.V1.AsyncChatbot object at 0x000001B60083DF50>

File "E:\AI\Windows-quickstart-go-cqhttp-refs.tags.v2.5.1\python3.11\Lib\site-packages\revChatGPT\V1.py", line 1097, in get_conversations response = await self.session.get(url) │ │ │ └ 'https://chatgpt-proxy.lss233.com/api/conversations?offset=0&limit=1' │ │ └ <function AsyncClient.get at 0x000001B6000132E0> │ └ <httpx.AsyncClient object at 0x000001B601987650> └ <revChatGPT.V1.AsyncChatbot object at 0x000001B60083DF50> File "E:\AI\Windows-quickstart-go-cqhttp-refs.tags.v2.5.1\python3.11\Lib\site-packages\httpx_client.py", line 1757, in get return await self.request( │ └ <function AsyncClient.request at 0x000001B600012E80> └ <httpx.AsyncClient object at 0x000001B601987650> File "E:\AI\Windows-quickstart-go-cqhttp-refs.tags.v2.5.1\python3.11\Lib\site-packages\httpx_client.py", line 1533, in request return await self.send(request, auth=auth, follow_redirects=follow_redirects) │ │ │ │ └ <httpx._client.UseClientDefault object at 0x000001B60000A750> │ │ │ └ <httpx._client.UseClientDefault object at 0x000001B60000A750> │ │ └ <Request('GET', 'https://chatgpt-proxy.lss233.com/api/conversations?offset=0&limit=1')> │ └ <function AsyncClient.send at 0x000001B600013060> └ <httpx.AsyncClient object at 0x000001B601987650> File "E:\AI\Windows-quickstart-go-cqhttp-refs.tags.v2.5.1\python3.11\Lib\site-packages\httpx_client.py", line 1620, in send response = await self._send_handling_auth( │ └ <function AsyncClient._send_handling_auth at 0x000001B600013100> └ <httpx.AsyncClient object at 0x000001B601987650> File "E:\AI\Windows-quickstart-go-cqhttp-refs.tags.v2.5.1\python3.11\Lib\site-packages\httpx_client.py", line 1648, in _send_handling_auth response = await self._send_handling_redirects( │ └ <function AsyncClient._send_handling_redirects at 0x000001B6000131A0> └ <httpx.AsyncClient object at 0x000001B601987650> File "E:\AI\Windows-quickstart-go-cqhttp-refs.tags.v2.5.1\python3.11\Lib\site-packages\httpx_client.py", line 1685, in _send_handling_redirects response = await self._send_single_request(request) │ │ └ <Request('GET', 'https://chatgpt-proxy.lss233.com/api/conversations?offset=0&limit=1')> │ └ <function AsyncClient._send_single_request at 0x000001B600013240> └ <httpx.AsyncClient object at 0x000001B601987650> File "E:\AI\Windows-quickstart-go-cqhttp-refs.tags.v2.5.1\python3.11\Lib\site-packages\httpx_client.py", line 1722, in _send_single_request response = await transport.handle_async_request(request) │ │ └ <Request('GET', 'https://chatgpt-proxy.lss233.com/api/conversations?offset=0&limit=1')> │ └ <function AsyncHTTPTransport.handle_async_request at 0x000001B6000100E0> └ <httpx.AsyncHTTPTransport object at 0x000001B6019B0A10> File "E:\AI\Windows-quickstart-go-cqhttp-refs.tags.v2.5.1\python3.11\Lib\site-packages\httpx_transports\default.py", line 352, in handle_async_request with map_httpcore_exceptions(): └ <function map_httpcore_exceptions at 0x000001B67FDD3BA0>

File "contextlib.py", line 155, in exit

File "E:\AI\Windows-quickstart-go-cqhttp-refs.tags.v2.5.1\python3.11\Lib\site-packages\httpx_transports\default.py", line 77, in map_httpcore_exceptions raise mapped_exc(message) from exc │ └ '' └ <class 'httpx.ConnectError'>

httpx.ConnectError 2023-05-21 16:26:55.733 | SUCCESS | manager.bot:login_openai:332 - 成功登录 0/1 个 OpenAI 账号!

其他内容
ChatGPT网页端能从浏览器正常访问。问题从今天下午开始出现。本人还有1个必应和1个文心一言账号,都能正常登录。此前3个AI都能正常登录并使用。

singularity2000 commented 1 year ago

后续:更换节点地区到日本后能正常登录了。此前节点网页ChatGPT能正常用,而且发消息有回复。请教大佬问题出在哪里