lss233 / chatgpt-mirai-qq-bot

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

[BUG] 经常死机 #798

Open Wangs121 opened 1 year ago

Wangs121 commented 1 year ago

提交 issue 前,请先确认:

表现
运行一段时间就死机,报错代码如下

2023-05-11 12:42:20.575 | ERROR    | graia.amnesia.transport.rider:trigger_callbacks:37 - Bad Request
Traceback (most recent call last):

> File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\python3.11\Lib\site-packages\graia\ariadne\connection\ws.py", line 149, in _
    await io.extra(WSConnectionAccept)
          │  │     └ <graia.amnesia.transport.signature.TransportSignature object at 0x0000022B0211D090>
          │  └ <function AiohttpServerWebsocketIO.extra at 0x0000022B02125F80>
          └ <graia.amnesia.builtins.aiohttp.AiohttpServerWebsocketIO object at 0x0000022B051F6990>
  File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\python3.11\Lib\site-packages\graia\amnesia\builtins\aiohttp.py", line 393, in extra
    await self.websocket.prepare(self.request)
          │    │         │       │    └ <Request GET / >
          │    │         │       └ <graia.amnesia.builtins.aiohttp.AiohttpServerWebsocketIO object at 0x0000022B051F6990>
          │    │         └ <function WebSocketResponse.prepare at 0x0000022B021084A0>
          │    └ <WebSocketResponse Switching Protocols not prepared>
          └ <graia.amnesia.builtins.aiohttp.AiohttpServerWebsocketIO object at 0x0000022B051F6990>
  File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\python3.11\Lib\site-packages\aiohttp\web_ws.py", line 137, in prepare
    protocol, writer = self._pre_start(request)
                       │    │          └ <Request GET / >
                       │    └ <function WebSocketResponse._pre_start at 0x0000022B02108680>
                       └ <WebSocketResponse Switching Protocols not prepared>
  File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\python3.11\Lib\site-packages\aiohttp\web_ws.py", line 232, in _pre_start
    headers, protocol, compress, notakeover = self._handshake(request)                                              │    │          └ <Request GET / >
                                              │    └ <function WebSocketResponse._handshake at 0x0000022B02108540>
                                              └ <WebSocketResponse Switching Protocols not prepared>
  File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\python3.11\Lib\site-packages\aiohttp\web_ws.py", line 149, in _handshake
    raise HTTPBadRequest(
          └ <class 'aiohttp.web_exceptions.HTTPBadRequest'>

aiohttp.web_exceptions.HTTPBadRequest: Bad Request
2023-05-11 12:42:20.575 | INFO     | graia.ariadne.connection.ws:_:92 - Websocket connection closed
2023-05-11 12:42:20.575 | ERROR    | graia.ariadne.util:loguru_exc_callback:76 - Exception:
Traceback (most recent call last):

  File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\bot.py", line 49, in <module>
    loop.run_until_complete(asyncio.gather(*bots))
    │    │                  │       │       └ [<Task pending name='Task-5' coro=<start_task() running at C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2...
    │    │                  │       └ <function gather at 0x0000022B7F9AB420>
    │    │                  └ <module 'asyncio' from 'C:\\Users\\Administrator\\Desktop\\Windows-quickstart-refs.tags.v2.4.2\\chatgpt\\python3.11\\python31...
    │    └ <function BaseEventLoop.run_until_complete at 0x0000022B7F9D42C0>
    └ <ProactorEventLoop running=True closed=False debug=False>

  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 Task.task_wakeup(<_GatheringFu...result=[None]>)>

> File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\python3.11\Lib\site-packages\aiohttp\web_protocol.py", line 433, in _handle_request
    resp = await request_handler(request)
                 │               └ <Request GET / >
                 └ <bound method Application._handle of <Application 0x22b041063d0>>
  File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\python3.11\Lib\site-packages\aiohttp\web_app.py", line 504, in _handle
    resp = await handler(request)
                 │       └ <Request GET / >
                 └ <bound method AiohttpRouter.handle_websocket_request of <graia.amnesia.builtins.aiohttp.AiohttpRouter object at 0x0000022B04B...
  File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\python3.11\Lib\site-packages\graia\amnesia\builtins\aiohttp.py", line 468, in handle_websocket_request
    await websocket_io.close()
          │            └ <function AiohttpServerWebsocketIO.close at 0x0000022B021262A0>
          └ <graia.amnesia.builtins.aiohttp.AiohttpServerWebsocketIO object at 0x0000022B051F6990>
  File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\python3.11\Lib\site-packages\graia\amnesia\builtins\aiohttp.py", line 411, in close
    await self.websocket.close()
          │    │         └ <function WebSocketResponse.close at 0x0000022B02108EA0>
          │    └ <WebSocketResponse Switching Protocols not prepared>
          └ <graia.amnesia.builtins.aiohttp.AiohttpServerWebsocketIO object at 0x0000022B051F6990>
  File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\python3.11\Lib\site-packages\aiohttp\web_ws.py", line 337, in close
    raise RuntimeError("Call .prepare() first")

RuntimeError: Call .prepare() first
ERROR:aiohttp.server:Error handling request
2023-05-11 14:22:33.884 | INFO     | graia.ariadne.model:log:82 - 79223948: [RECV][Vanity(277668922)] -> 你好
2023-05-11 14:22:33.886 | DEBUG    | middlewares.concurrentlock:handle_request:40 - [Concurrent] 排队中,前面还有 0 个人!
2023-05-11 14:22:33.889 | DEBUG    | middlewares.concurrentlock:handle_request:42 - [Concurrent] 排到了!
2023-05-11 14:22:33.891 | DEBUG    | middlewares.timeout:create_timeout_task:55 - [Timeout] 开始计时……
2023-05-11 14:22:33.898 | DEBUG    | adapter.chatgpt.api:ask:89 - 清理 token,历史记录遗忘后使用 token 数:3350
2023-05-11 14:22:33.904 | DEBUG    | adapter.chatgpt.api:ask:89 - 清理 token,历史记录遗忘后使用 token 数:2910
2023-05-11 14:22:57.209 | ERROR    | universal:request:265 - Server disconnected without sending a response.
Traceback (most recent call last):

  File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\python3.11\Lib\site-packages\httpx\_transports\default.py", line 60, in map_httpcore_exceptions
    yield
  File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\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'POST']>
                 │    │     └ <function AsyncConnectionPool.handle_async_request at 0x0000022B02813100>
                 │    └ <httpcore.AsyncHTTPProxy object at 0x0000022B058DE010>
                 └ <httpx.AsyncHTTPTransport object at 0x0000022B053C0C10>
  File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\python3.11\Lib\site-packages\httpcore\_async\connection_pool.py", line 253, in handle_async_request
    raise exc
  File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\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'POST']>
                     │          └ <function AsyncTunnelHTTPConnection.handle_async_request at 0x0000022B02820180>
                     └ <AsyncTunnelHTTPConnection ['https://api.openai.com:443', HTTP/1.1, CLOSED, Request Count: 1]>
  File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\python3.11\Lib\site-packages\httpcore\_async\http_proxy.py", line 316, in handle_async_request
    return await self._connection.handle_async_request(request)
                 │    │           │                    └ <Request [b'POST']>
                 │    │           └ <function AsyncHTTP11Connection.handle_async_request at 0x0000022B02811620>
                 │    └ <AsyncHTTP11Connection ['https://api.openai.com:443', CLOSED, Request Count: 1]>
                 └ <AsyncTunnelHTTPConnection ['https://api.openai.com:443', HTTP/1.1, CLOSED, Request Count: 1]>
  File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\python3.11\Lib\site-packages\httpcore\_async\http11.py", line 112, in handle_async_request
    raise exc
  File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\python3.11\Lib\site-packages\httpcore\_async\http11.py", line 91, in handle_async_request
    ) = await self._receive_response_headers(**kwargs)
              │    │                           └ {'request': <Request [b'POST']>}
              │    └ <function AsyncHTTP11Connection._receive_response_headers at 0x0000022B028118A0>
              └ <AsyncHTTP11Connection ['https://api.openai.com:443', CLOSED, Request Count: 1]>
  File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\python3.11\Lib\site-packages\httpcore\_async\http11.py", line 155, in _receive_response_headers
    event = await self._receive_event(timeout=timeout)
                  │    │                      └ None
                  │    └ <function AsyncHTTP11Connection._receive_event at 0x0000022B028119E0>
                  └ <AsyncHTTP11Connection ['https://api.openai.com:443', CLOSED, Request Count: 1]>
  File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\python3.11\Lib\site-packages\httpcore\_async\http11.py", line 205, in _receive_event
    raise RemoteProtocolError(msg)
          │                   └ 'Server disconnected without sending a response.'
          └ <class 'httpcore.RemoteProtocolError'>

httpcore.RemoteProtocolError: Server disconnected without sending a response.

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

Traceback (most recent call last):

  File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\bot.py", line 49, in <module>
    loop.run_until_complete(asyncio.gather(*bots))
    │    │                  │       │       └ [<Task pending name='Task-5' coro=<start_task() running at C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2...
    │    │                  │       └ <function gather at 0x0000022B7F9AB420>
    │    │                  └ <module 'asyncio' from 'C:\\Users\\Administrator\\Desktop\\Windows-quickstart-refs.tags.v2.4.2\\chatgpt\\python3.11\\python31...
    │    └ <function BaseEventLoop.run_until_complete at 0x0000022B7F9D42C0>
    └ <ProactorEventLoop running=True closed=False debug=False>

  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 0x0000022B058DA740>()>

> File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\universal.py", line 228, in request
    async for rendered in task:
                          └ <async_generator object retry.<locals>.decorator.<locals>.wrapper at 0x0000022B04D835B0>

  File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\utils\retry.py", line 21, in wrapper
    async for result in func(*args, **kwargs):
                        │     │       └ {'prompt': '你好', 'chain': MessageChain([Plain(text='你好')]), 'name': 'Vanity'}
                        │     └ (<conversation.ConversationContext object at 0x0000022B053C0C50>,)
                        └ <function ConversationContext.ask at 0x0000022B04B41E40>

  File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\conversation.py", line 182, in ask
    async for item in self.adapter.ask(prompt):
                      │    │       │   └ '你好'
                      │    │       └ <function ChatGPTAPIAdapter.ask at 0x0000022B044ECA40>
                      │    └ <adapter.chatgpt.api.ChatGPTAPIAdapter object at 0x0000022B0538A750>
                      └ <conversation.ConversationContext object at 0x0000022B053C0C50>

  File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\adapter\chatgpt\api.py", line 95, in ask
    async for resp in self.bot.ask_stream_async(prompt=prompt, role=self.hashed_user_id, convo_id=self.session_id):
                      │    │   │                       │            │    │                        │    └ 'friend-277668922'
                      │    │   │                       │            │    │                        └ <adapter.chatgpt.api.ChatGPTAPIAdapter object at 0x0000022B0538A750>
                      │    │   │                       │            │    └ 'user-88ce11b7800c1cc7'
                      │    │   │                       │            └ <adapter.chatgpt.api.ChatGPTAPIAdapter object at 0x0000022B0538A750>
                      │    │   │                       └ '你好'
                      │    │   └ <function Chatbot.ask_stream_async at 0x0000022B044EC0E0>
                      │    └ <revChatGPT.V3.Chatbot object at 0x0000022B05912010>
                      └ <adapter.chatgpt.api.ChatGPTAPIAdapter object at 0x0000022B0538A750>

  File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\python3.11\Lib\site-packages\revChatGPT\V3.py", line 246, in ask_stream_async
    async with self.aclient.stream(
               │    │       └ <function AsyncClient.stream at 0x0000022B0283D6C0>
               │    └ <httpx.AsyncClient object at 0x0000022B058DEB90>
               └ <revChatGPT.V3.Chatbot object at 0x0000022B05912010>
  File "contextlib.py", line 204, in __aenter__

  File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\python3.11\Lib\site-packages\httpx\_client.py", line 1576, in stream
    response = await self.send(
                     │    └ <function AsyncClient.send at 0x0000022B0283D760>
                     └ <httpx.AsyncClient object at 0x0000022B058DEB90>
  File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\python3.11\Lib\site-packages\httpx\_client.py", line 1620, in send
    response = await self._send_handling_auth(
                     │    └ <function AsyncClient._send_handling_auth at 0x0000022B0283D800>
                     └ <httpx.AsyncClient object at 0x0000022B058DEB90>
  File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\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 0x0000022B0283D8A0>
                     └ <httpx.AsyncClient object at 0x0000022B058DEB90>
  File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\python3.11\Lib\site-packages\httpx\_client.py", line 1685, in _send_handling_redirects
    response = await self._send_single_request(request)
                     │    │                    └ <Request('POST', 'https://api.openai.com/v1/chat/completions')>
                     │    └ <function AsyncClient._send_single_request at 0x0000022B0283D940>
                     └ <httpx.AsyncClient object at 0x0000022B058DEB90>
  File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\python3.11\Lib\site-packages\httpx\_client.py", line 1722, in _send_single_request
    response = await transport.handle_async_request(request)
                     │         │                    └ <Request('POST', 'https://api.openai.com/v1/chat/completions')>
                     │         └ <function AsyncHTTPTransport.handle_async_request at 0x0000022B02822840>
                     └ <httpx.AsyncHTTPTransport object at 0x0000022B053C0C10>
  File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\python3.11\Lib\site-packages\httpx\_transports\default.py", line 352, in handle_async_request
    with map_httpcore_exceptions():
         └ <function map_httpcore_exceptions at 0x0000022B025A45E0>

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

  File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\python3.11\Lib\site-packages\httpx\_transports\default.py", line 77, in map_httpcore_exceptions
    raise mapped_exc(message) from exc
          │          └ 'Server disconnected without sending a response.'
          └ <class 'httpx.RemoteProtocolError'>

httpx.RemoteProtocolError: Server disconnected without sending a response.

运行环境:

复现步骤
运行一段时间就会这样

预期行为

机器人不回复,查看后台是这样

Wangs121 commented 1 year ago

今天是这样

2023-05-12 13:48:04.421 | INFO     | graia.ariadne.model:log:82 - 79223948: [RECV][367(597091206)] ▲    The sun(946195174) -> 说明你变正常了
2023-05-12 20:26:48.383 | ERROR    | graia.amnesia.transport.rider:trigger_callbacks:37 - Bad Request
Traceback (most recent call last):

> File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\python3.11\Lib\site-packages\graia\ariadne\connection\ws.py", line 149, in _
    await io.extra(WSConnectionAccept)
          │  │     └ <graia.amnesia.transport.signature.TransportSignature object at 0x000002800700CD90>
          │  └ <function AiohttpServerWebsocketIO.extra at 0x0000028007015F80>
          └ <graia.amnesia.builtins.aiohttp.AiohttpServerWebsocketIO object at 0x000002800A84C910>
  File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\python3.11\Lib\site-packages\graia\amnesia\builtins\aiohttp.py", line 393, in extra
    await self.websocket.prepare(self.request)
          │    │         │       │    └ <Request GET / >
          │    │         │       └ <graia.amnesia.builtins.aiohttp.AiohttpServerWebsocketIO object at 0x000002800A84C910>
          │    │         └ <function WebSocketResponse.prepare at 0x0000028006FF84A0>
          │    └ <WebSocketResponse Switching Protocols not prepared>
          └ <graia.amnesia.builtins.aiohttp.AiohttpServerWebsocketIO object at 0x000002800A84C910>
  File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\python3.11\Lib\site-packages\aiohttp\web_ws.py", line 137, in prepare
    protocol, writer = self._pre_start(request)
                       │    │          └ <Request GET / >
                       │    └ <function WebSocketResponse._pre_start at 0x0000028006FF8680>
                       └ <WebSocketResponse Switching Protocols not prepared>
  File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\python3.11\Lib\site-packages\aiohttp\web_ws.py", line 232, in _pre_start
    headers, protocol, compress, notakeover = self._handshake(request)
                                              │    │          └ <Request GET / >
                                              │    └ <function WebSocketResponse._handshake at 0x0000028006FF8540>
                                              └ <WebSocketResponse Switching Protocols not prepared>
  File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\python3.11\Lib\site-packages\aiohttp\web_ws.py", line 149, in _handshake
    raise HTTPBadRequest(
          └ <class 'aiohttp.web_exceptions.HTTPBadRequest'>

aiohttp.web_exceptions.HTTPBadRequest: Bad Request
2023-05-12 20:26:48.383 | INFO     | graia.ariadne.connection.ws:_:92 - Websocket connection closed
2023-05-12 20:26:48.399 | ERROR    | graia.ariadne.util:loguru_exc_callback:76 - Exception:
Traceback (most recent call last):

  File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\bot.py", line 49, in <module>
    loop.run_until_complete(asyncio.gather(*bots))
    │    │                  │       │       └ [<Task pending name='Task-5' coro=<start_task() running at C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2...
    │    │                  │       └ <function gather at 0x0000028005C9B420>
    │    │                  └ <module 'asyncio' from 'C:\\Users\\Administrator\\Desktop\\Windows-quickstart-refs.tags.v2.4.2\\chatgpt\\python3.11\\python31...
    │    └ <function BaseEventLoop.run_until_complete at 0x0000028005CC42C0>
    └ <ProactorEventLoop running=True closed=False debug=False>

  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 Task.task_wakeup(<_GatheringFu...result=[None]>)>

> File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\python3.11\Lib\site-packages\aiohttp\web_protocol.py", line 433, in _handle_request
    resp = await request_handler(request)
                 │               └ <Request GET / >
                 └ <bound method Application._handle of <Application 0x28007f4f690>>
  File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\python3.11\Lib\site-packages\aiohttp\web_app.py", line 504, in _handle
    resp = await handler(request)
                 │       └ <Request GET / >
                 └ <bound method AiohttpRouter.handle_websocket_request of <graia.amnesia.builtins.aiohttp.AiohttpRouter object at 0x00000280080...
  File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\python3.11\Lib\site-packages\graia\amnesia\builtins\aiohttp.py", line 468, in handle_websocket_request
    await websocket_io.close()
          │            └ <function AiohttpServerWebsocketIO.close at 0x00000280070162A0>
          └ <graia.amnesia.builtins.aiohttp.AiohttpServerWebsocketIO object at 0x000002800A84C910>
  File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\python3.11\Lib\site-packages\graia\amnesia\builtins\aiohttp.py", line 411, in close
    await self.websocket.close()
          │    │         └ <function WebSocketResponse.close at 0x0000028006FF8EA0>
          │    └ <WebSocketResponse Switching Protocols not prepared>
          └ <graia.amnesia.builtins.aiohttp.AiohttpServerWebsocketIO object at 0x000002800A84C910>
  File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\python3.11\Lib\site-packages\aiohttp\web_ws.py", line 337, in close
    raise RuntimeError("Call .prepare() first")

RuntimeError: Call .prepare() first
ERROR:aiohttp.server:Error handling request
2023-05-12 20:26:49.071 | ERROR    | graia.ariadne.util:loguru_exc_callback:76 - Exception:
Traceback (most recent call last):

  File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\bot.py", line 49, in <module>
    loop.run_until_complete(asyncio.gather(*bots))
    │    │                  │       │       └ [<Task pending name='Task-5' coro=<start_task() running at C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2...
    │    │                  │       └ <function gather at 0x0000028005C9B420>
    │    │                  └ <module 'asyncio' from 'C:\\Users\\Administrator\\Desktop\\Windows-quickstart-refs.tags.v2.4.2\\chatgpt\\python3.11\\python31...
    │    └ <function BaseEventLoop.run_until_complete at 0x0000028005CC42C0>
    └ <ProactorEventLoop running=True closed=False debug=False>

  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 1923, in _run_once

  File "asyncio\events.py", line 95, in _run
    info.append(_format_callback(self._callback, self._args))
                                 │               └ None
                                 └ None

  File "asyncio\proactor_events.py", line 324, in _loop_reading
    class _ProactorDuplexPipeTransport(_ProactorReadPipeTransport,
          │                            └ <class 'asyncio.proactor_events._ProactorReadPipeTransport'>
          └ <class 'asyncio.proactor_events._ProactorDuplexPipeTransport'>

  File "asyncio\proactor_events.py", line 274, in _data_received
    # we do this last since the callback is called immediately

> File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\python3.11\Lib\site-packages\aiohttp\web_protocol.py", line 332, in data_received
    messages, upgraded, tail = self._request_parser.feed_data(data)
    │         │                │    │                         └ bytearray(b'PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n')
    │         │                │    └ <member '_request_parser' of 'RequestHandler' objects>
    │         │                └ <RequestHandler connected>
    │         └ False
    └ <unprintable list object>
  File "aiohttp\_http_parser.pyx", line 551, in aiohttp._http_parser.HttpParser.feed_data
    raise ex

aiohttp.http_exceptions.BadHttpMessage: 400, message='Pause on PRI/Upgrade'
ERROR:aiohttp.server:Error handling request
2023-05-12 21:09:36.782 | ERROR    | graia.ariadne.util:loguru_exc_callback:76 - Exception:
Traceback (most recent call last):

  File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\bot.py", line 49, in <module>
    loop.run_until_complete(asyncio.gather(*bots))
    │    │                  │       │       └ [<Task pending name='Task-5' coro=<start_task() running at C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2...
    │    │                  │       └ <function gather at 0x0000028005C9B420>
    │    │                  └ <module 'asyncio' from 'C:\\Users\\Administrator\\Desktop\\Windows-quickstart-refs.tags.v2.4.2\\chatgpt\\python3.11\\python31...
    │    └ <function BaseEventLoop.run_until_complete at 0x0000028005CC42C0>
    └ <ProactorEventLoop running=True closed=False debug=False>

  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 1923, in _run_once

  File "asyncio\events.py", line 95, in _run
    info.append(_format_callback(self._callback, self._args))
                                 │               └ None
                                 └ None

  File "asyncio\proactor_events.py", line 324, in _loop_reading
    class _ProactorDuplexPipeTransport(_ProactorReadPipeTransport,
          │                            └ <class 'asyncio.proactor_events._ProactorReadPipeTransport'>
          └ <class 'asyncio.proactor_events._ProactorDuplexPipeTransport'>

  File "asyncio\proactor_events.py", line 274, in _data_received
    # we do this last since the callback is called immediately

> File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\python3.11\Lib\site-packages\aiohttp\web_protocol.py", line 332, in data_received
    messages, upgraded, tail = self._request_parser.feed_data(data)
    │         │                │    │                         └ bytearray(b'\x03\x00\x00/*\xe0\x00\x00\x00\x00\x00Cookie: mstshash=Administr\r\n\x01\x00\x08\x00\x03\x00\x00\x00')
    │         │                │    └ <member '_request_parser' of 'RequestHandler' objects>
    │         │                └ <RequestHandler connected>
    │         └ False
    └ <unprintable list object>
  File "aiohttp\_http_parser.pyx", line 551, in aiohttp._http_parser.HttpParser.feed_data
    raise ex

aiohttp.http_exceptions.BadStatusLine: 400, message="Bad status line 'Invalid method encountered'"
ERROR:aiohttp.server:Error handling request
2023-05-13 02:21:11.870 | ERROR    | graia.ariadne.util:loguru_exc_callback:76 - Exception:
Traceback (most recent call last):

  File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\bot.py", line 49, in <module>
    loop.run_until_complete(asyncio.gather(*bots))
    │    │                  │       │       └ [<Task pending name='Task-5' coro=<start_task() running at C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2...
    │    │                  │       └ <function gather at 0x0000028005C9B420>
    │    │                  └ <module 'asyncio' from 'C:\\Users\\Administrator\\Desktop\\Windows-quickstart-refs.tags.v2.4.2\\chatgpt\\python3.11\\python31...
    │    └ <function BaseEventLoop.run_until_complete at 0x0000028005CC42C0>
    └ <ProactorEventLoop running=True closed=False debug=False>

  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 1923, in _run_once

  File "asyncio\events.py", line 95, in _run
    info.append(_format_callback(self._callback, self._args))
                                 │               └ None
                                 └ None

  File "asyncio\proactor_events.py", line 324, in _loop_reading
    class _ProactorDuplexPipeTransport(_ProactorReadPipeTransport,
          │                            └ <class 'asyncio.proactor_events._ProactorReadPipeTransport'>
          └ <class 'asyncio.proactor_events._ProactorDuplexPipeTransport'>

  File "asyncio\proactor_events.py", line 274, in _data_received
    # we do this last since the callback is called immediately

> File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\python3.11\Lib\site-packages\aiohttp\web_protocol.py", line 332, in data_received
    messages, upgraded, tail = self._request_parser.feed_data(data)
    │         │                │    │                         └ bytearray(b'\x16\x03\x01\x00\xee\x01\x00\x00\xea\x03\x03qK\xb6J\xc0\x8a\x01\x02\x02\xcbP9j\x15\xef\x81\xcc\xbb\xe6\xc1\x84\x9...
    │         │                │    └ <member '_request_parser' of 'RequestHandler' objects>
    │         │                └ <RequestHandler connected>
    │         └ False
    └ <unprintable list object>
  File "aiohttp\_http_parser.pyx", line 551, in aiohttp._http_parser.HttpParser.feed_data
    raise ex

aiohttp.http_exceptions.BadStatusLine: 400, message="Bad status line 'Invalid method encountered'"
ERROR:aiohttp.server:Error handling request
2023-05-13 02:21:13.282 | ERROR    | graia.amnesia.transport.rider:trigger_callbacks:37 - Bad Request
Traceback (most recent call last):

> File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\python3.11\Lib\site-packages\graia\ariadne\connection\ws.py", line 149, in _
    await io.extra(WSConnectionAccept)
          │  │     └ <graia.amnesia.transport.signature.TransportSignature object at 0x000002800700CD90>
          │  └ <function AiohttpServerWebsocketIO.extra at 0x0000028007015F80>
          └ <graia.amnesia.builtins.aiohttp.AiohttpServerWebsocketIO object at 0x000002800A877DD0>
  File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\python3.11\Lib\site-packages\graia\amnesia\builtins\aiohttp.py", line 393, in extra
    await self.websocket.prepare(self.request)
          │    │         │       │    └ <Request GET / >
          │    │         │       └ <graia.amnesia.builtins.aiohttp.AiohttpServerWebsocketIO object at 0x000002800A877DD0>
          │    │         └ <function WebSocketResponse.prepare at 0x0000028006FF84A0>
          │    └ <WebSocketResponse Switching Protocols not prepared>
          └ <graia.amnesia.builtins.aiohttp.AiohttpServerWebsocketIO object at 0x000002800A877DD0>
  File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\python3.11\Lib\site-packages\aiohttp\web_ws.py", line 137, in prepare
    protocol, writer = self._pre_start(request)
                       │    │          └ <Request GET / >
                       │    └ <function WebSocketResponse._pre_start at 0x0000028006FF8680>
                       └ <WebSocketResponse Switching Protocols not prepared>
  File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\python3.11\Lib\site-packages\aiohttp\web_ws.py", line 232, in _pre_start
    headers, protocol, compress, notakeover = self._handshake(request)
                                              │    │          └ <Request GET / >
                                              │    └ <function WebSocketResponse._handshake at 0x0000028006FF8540>
                                              └ <WebSocketResponse Switching Protocols not prepared>
  File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\python3.11\Lib\site-packages\aiohttp\web_ws.py", line 149, in _handshake
    raise HTTPBadRequest(
          └ <class 'aiohttp.web_exceptions.HTTPBadRequest'>

aiohttp.web_exceptions.HTTPBadRequest: Bad Request
2023-05-13 02:21:13.298 | INFO     | graia.ariadne.connection.ws:_:92 - Websocket connection closed
2023-05-13 02:21:13.298 | ERROR    | graia.ariadne.util:loguru_exc_callback:76 - Exception:
Traceback (most recent call last):

  File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\bot.py", line 49, in <module>
    loop.run_until_complete(asyncio.gather(*bots))
    │    │                  │       │       └ [<Task pending name='Task-5' coro=<start_task() running at C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2...
    │    │                  │       └ <function gather at 0x0000028005C9B420>
    │    │                  └ <module 'asyncio' from 'C:\\Users\\Administrator\\Desktop\\Windows-quickstart-refs.tags.v2.4.2\\chatgpt\\python3.11\\python31...
    │    └ <function BaseEventLoop.run_until_complete at 0x0000028005CC42C0>
    └ <ProactorEventLoop running=True closed=False debug=False>

  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 Task.task_wakeup(<_GatheringFu...result=[None]>)>

> File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\python3.11\Lib\site-packages\aiohttp\web_protocol.py", line 433, in _handle_request
    resp = await request_handler(request)
                 │               └ <Request GET / >
                 └ <bound method Application._handle of <Application 0x28007f4f690>>
  File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\python3.11\Lib\site-packages\aiohttp\web_app.py", line 504, in _handle
    resp = await handler(request)
                 │       └ <Request GET / >
                 └ <bound method AiohttpRouter.handle_websocket_request of <graia.amnesia.builtins.aiohttp.AiohttpRouter object at 0x00000280080...
  File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\python3.11\Lib\site-packages\graia\amnesia\builtins\aiohttp.py", line 468, in handle_websocket_request
    await websocket_io.close()
          │            └ <function AiohttpServerWebsocketIO.close at 0x00000280070162A0>
          └ <graia.amnesia.builtins.aiohttp.AiohttpServerWebsocketIO object at 0x000002800A877DD0>
  File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\python3.11\Lib\site-packages\graia\amnesia\builtins\aiohttp.py", line 411, in close
    await self.websocket.close()
          │    │         └ <function WebSocketResponse.close at 0x0000028006FF8EA0>
          │    └ <WebSocketResponse Switching Protocols not prepared>
          └ <graia.amnesia.builtins.aiohttp.AiohttpServerWebsocketIO object at 0x000002800A877DD0>
  File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\python3.11\Lib\site-packages\aiohttp\web_ws.py", line 337, in close
    raise RuntimeError("Call .prepare() first")

RuntimeError: Call .prepare() first
ERROR:aiohttp.server:Error handling request
2023-05-13 02:21:13.689 | ERROR    | graia.amnesia.transport.rider:trigger_callbacks:37 - Bad Request
Traceback (most recent call last):

> File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\python3.11\Lib\site-packages\graia\ariadne\connection\ws.py", line 149, in _
    await io.extra(WSConnectionAccept)
          │  │     └ <graia.amnesia.transport.signature.TransportSignature object at 0x000002800700CD90>
          │  └ <function AiohttpServerWebsocketIO.extra at 0x0000028007015F80>
          └ <graia.amnesia.builtins.aiohttp.AiohttpServerWebsocketIO object at 0x000002800A8770D0>
  File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\python3.11\Lib\site-packages\graia\amnesia\builtins\aiohttp.py", line 393, in extra
    await self.websocket.prepare(self.request)
          │    │         │       │    └ <Request GET / >
          │    │         │       └ <graia.amnesia.builtins.aiohttp.AiohttpServerWebsocketIO object at 0x000002800A8770D0>
          │    │         └ <function WebSocketResponse.prepare at 0x0000028006FF84A0>
          │    └ <WebSocketResponse Switching Protocols not prepared>
          └ <graia.amnesia.builtins.aiohttp.AiohttpServerWebsocketIO object at 0x000002800A8770D0>
  File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\python3.11\Lib\site-packages\aiohttp\web_ws.py", line 137, in prepare
    protocol, writer = self._pre_start(request)
                       │    │          └ <Request GET / >
                       │    └ <function WebSocketResponse._pre_start at 0x0000028006FF8680>
                       └ <WebSocketResponse Switching Protocols not prepared>
  File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\python3.11\Lib\site-packages\aiohttp\web_ws.py", line 232, in _pre_start
    headers, protocol, compress, notakeover = self._handshake(request)
                                              │    │          └ <Request GET / >
                                              │    └ <function WebSocketResponse._handshake at 0x0000028006FF8540>
                                              └ <WebSocketResponse Switching Protocols not prepared>
  File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\python3.11\Lib\site-packages\aiohttp\web_ws.py", line 149, in _handshake
    raise HTTPBadRequest(
          └ <class 'aiohttp.web_exceptions.HTTPBadRequest'>

aiohttp.web_exceptions.HTTPBadRequest: Bad Request
2023-05-13 02:21:13.689 | INFO     | graia.ariadne.connection.ws:_:92 - Websocket connection closed
2023-05-13 02:21:13.704 | ERROR    | graia.ariadne.util:loguru_exc_callback:76 - Exception:
Traceback (most recent call last):

  File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\bot.py", line 49, in <module>
    loop.run_until_complete(asyncio.gather(*bots))
    │    │                  │       │       └ [<Task pending name='Task-5' coro=<start_task() running at C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2...
    │    │                  │       └ <function gather at 0x0000028005C9B420>
    │    │                  └ <module 'asyncio' from 'C:\\Users\\Administrator\\Desktop\\Windows-quickstart-refs.tags.v2.4.2\\chatgpt\\python3.11\\python31...
    │    └ <function BaseEventLoop.run_until_complete at 0x0000028005CC42C0>
    └ <ProactorEventLoop running=True closed=False debug=False>

  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 Task.task_wakeup(<_GatheringFu...result=[None]>)>

> File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\python3.11\Lib\site-packages\aiohttp\web_protocol.py", line 433, in _handle_request
    resp = await request_handler(request)
                 │               └ <Request GET / >
                 └ <bound method Application._handle of <Application 0x28007f4f690>>
  File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\python3.11\Lib\site-packages\aiohttp\web_app.py", line 504, in _handle
    resp = await handler(request)
                 │       └ <Request GET / >
                 └ <bound method AiohttpRouter.handle_websocket_request of <graia.amnesia.builtins.aiohttp.AiohttpRouter object at 0x00000280080...
  File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\python3.11\Lib\site-packages\graia\amnesia\builtins\aiohttp.py", line 468, in handle_websocket_request
    await websocket_io.close()
          │            └ <function AiohttpServerWebsocketIO.close at 0x00000280070162A0>
          └ <graia.amnesia.builtins.aiohttp.AiohttpServerWebsocketIO object at 0x000002800A8770D0>
  File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\python3.11\Lib\site-packages\graia\amnesia\builtins\aiohttp.py", line 411, in close
    await self.websocket.close()
          │    │         └ <function WebSocketResponse.close at 0x0000028006FF8EA0>
          │    └ <WebSocketResponse Switching Protocols not prepared>
          └ <graia.amnesia.builtins.aiohttp.AiohttpServerWebsocketIO object at 0x000002800A8770D0>
  File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\python3.11\Lib\site-packages\aiohttp\web_ws.py", line 337, in close
    raise RuntimeError("Call .prepare() first")

RuntimeError: Call .prepare() first
ERROR:aiohttp.server:Error handling request
2023-05-13 02:21:14.079 | ERROR    | graia.ariadne.util:loguru_exc_callback:76 - Exception:
Traceback (most recent call last):

  File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\bot.py", line 49, in <module>
    loop.run_until_complete(asyncio.gather(*bots))
    │    │                  │       │       └ [<Task pending name='Task-5' coro=<start_task() running at C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2...
    │    │                  │       └ <function gather at 0x0000028005C9B420>
    │    │                  └ <module 'asyncio' from 'C:\\Users\\Administrator\\Desktop\\Windows-quickstart-refs.tags.v2.4.2\\chatgpt\\python3.11\\python31...
    │    └ <function BaseEventLoop.run_until_complete at 0x0000028005CC42C0>
    └ <ProactorEventLoop running=True closed=False debug=False>

  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 1923, in _run_once

  File "asyncio\events.py", line 95, in _run
    info.append(_format_callback(self._callback, self._args))
                                 │               └ None
                                 └ None

  File "asyncio\proactor_events.py", line 324, in _loop_reading
    class _ProactorDuplexPipeTransport(_ProactorReadPipeTransport,
          │                            └ <class 'asyncio.proactor_events._ProactorReadPipeTransport'>
          └ <class 'asyncio.proactor_events._ProactorDuplexPipeTransport'>

  File "asyncio\proactor_events.py", line 274, in _data_received
    # we do this last since the callback is called immediately

> File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\python3.11\Lib\site-packages\aiohttp\web_protocol.py", line 332, in data_received
    messages, upgraded, tail = self._request_parser.feed_data(data)
    │         │                │    │                         └ bytearray(b'PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n\x00\x00\x18\x04\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x04\x00\x00Bh\x0...
    │         │                │    └ <member '_request_parser' of 'RequestHandler' objects>
    │         │                └ <RequestHandler connected>
    │         └ False
    └ <unprintable list object>
  File "aiohttp\_http_parser.pyx", line 551, in aiohttp._http_parser.HttpParser.feed_data
    raise ex

aiohttp.http_exceptions.BadHttpMessage: 400, message='Pause on PRI/Upgrade'
ERROR:aiohttp.server:Error handling request
2023-05-13 09:14:01.056 | INFO     | graia.ariadne.model:log:82 - 79223948: [RECV][Vanity(277668922)] -> 你好
2023-05-13 09:14:01.059 | DEBUG    | middlewares.concurrentlock:handle_request:40 - [Concurrent] 排队中,前面还有 0 个人!
2023-05-13 09:14:01.060 | DEBUG    | middlewares.concurrentlock:handle_request:42 - [Concurrent] 排到了!
2023-05-13 09:14:01.062 | DEBUG    | middlewares.timeout:create_timeout_task:55 - [Timeout] 开始计时……
2023-05-13 09:14:03.726 | DEBUG    | adapter.chatgpt.api:ask:98 - [ChatGPT-API:gpt-3.5-turbo] 响应:你好,有什么可以帮助你的吗?
2023-05-13 09:14:03.730 | DEBUG    | adapter.chatgpt.api:ask:99 - 使用 token 数:803
2023-05-13 09:14:03.731 | DEBUG    | middlewares.timeout:handle_respond:46 - [Timeout] 取消计时……
2023-05-13 09:15:47.478 | INFO     | graia.ariadne.model:log:82 - 79223948: [RECV][Vanity(277668922)] -> 你好
2023-05-13 09:15:51.172 | DEBUG    | middlewares.concurrentlock:handle_request:40 - [Concurrent] 排队中,前面还有 1 个人!

在群里聊天,没有人给机器人发消息它就出问题了,后台接收到消息了并且收到gpt回复了,但是qq不回复

lss233 commented 1 year ago

看样子是mirai的问题,你有mirai的日志吗

Wangs121 commented 1 year ago

现在又报错了,一直没有人给机器人发消息: chatgpt for qq

2023-05-13 09:20:51.616 | SUCCESS  | graia.ariadne.connection.ws:_:64 - Successfully got session key
2023-05-13 11:03:56.589 | ERROR    | graia.ariadne.util:loguru_exc_callback:76 - Exception:
Traceback (most recent call last):

  File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\bot.py", line 49, in <module>
    loop.run_until_complete(asyncio.gather(*bots))
    │    │                  │       │       └ [<Task pending name='Task-5' coro=<start_task() running at C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2...
    │    │                  │       └ <function gather at 0x0000023B7FA4B420>
    │    │                  └ <module 'asyncio' from 'C:\\Users\\Administrator\\Desktop\\Windows-quickstart-refs.tags.v2.4.2\\chatgpt\\python3.11\\python31...
    │    └ <function BaseEventLoop.run_until_complete at 0x0000023B7FA742C0>
    └ <ProactorEventLoop running=True closed=False debug=False>

  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 1923, in _run_once

  File "asyncio\events.py", line 95, in _run
    info.append(_format_callback(self._callback, self._args))
                                 │               └ None
                                 └ None

  File "asyncio\proactor_events.py", line 324, in _loop_reading
    class _ProactorDuplexPipeTransport(_ProactorReadPipeTransport,
          │                            └ <class 'asyncio.proactor_events._ProactorReadPipeTransport'>
          └ <class 'asyncio.proactor_events._ProactorDuplexPipeTransport'>

  File "asyncio\proactor_events.py", line 274, in _data_received
    # we do this last since the callback is called immediately

> File "C:\Users\Administrator\Desktop\Windows-quickstart-refs.tags.v2.4.2\chatgpt\python3.11\Lib\site-packages\aiohttp\web_protocol.py", line 332, in data_received
    messages, upgraded, tail = self._request_parser.feed_data(data)
    │         │                │    │                         └ bytearray(b'\x03\x00\x00/*\xe0\x00\x00\x00\x00\x00Cookie: mstshash=Administr\r\n\x01\x00\x08\x00\x03\x00\x00\x00')
    │         │                │    └ <member '_request_parser' of 'RequestHandler' objects>
    │         │                └ <RequestHandler connected>
    │         └ False
    └ <unprintable list object>
  File "aiohttp\_http_parser.pyx", line 551, in aiohttp._http_parser.HttpParser.feed_data
    raise ex

aiohttp.http_exceptions.BadStatusLine: 400, message="Bad status line 'Invalid method encountered'"
ERROR:aiohttp.server:Error handling request

mirai 一直没有报错,中间我重启gpt了,没有重启mirai mirai

2023-05-12 13:48:04 V/Bot.79223948: [367(597091206)] ▲    The sun(946195174) -> 说明你变正常了
2023-05-13 09:14:01 V/Bot.79223948: Vanity(277668922) -> 你好
2023-05-13 09:15:47 V/Bot.79223948: Vanity(277668922) -> 你好
2023-05-13 09:20:40 E/reverse-ws adapter: [reverse-ws] SocketException occurred: Connection reset
2023-05-13 09:20:40 W/reverse-ws adapter: [reverse-ws] Connection to localhost:8554/ interrupted. Trying reconnect in 5000 ms.
2023-05-13 09:20:46 W/reverse-ws adapter: [reverse-ws] Connection to localhost:8554/ interrupted. Trying reconnect in 5000 ms.
lss233 commented 1 year ago

很奇怪的错误,似乎是mirai api http协议的问题。升级到最新版试试看? 另外,请提供一下配置文件和mirai api http 的配置文件