RockChinQ / qcg-installer

ChatGPT QQ 机器人的自动安装器,自动化部署,适用于QChatGPT项目: https://github.com/RockChinQ/QChatGPT
GNU Affero General Public License v3.0
355 stars 19 forks source link

运行run-bot.bat捕捉到未知异常 #31

Closed DaneelW closed 1 year ago

DaneelW commented 1 year ago

运行环境

描述漏洞

运行run-bot.bat报错

完整报错信息

2023-02-20 14:53:06 - WARNING  未找到可用的 ASGI 服务,反向 WebSocket 和 WebHook 上报将不可用。
仅 HTTP 轮询与正向 WebSocket 可用。
建议安装 ASGI 服务器,如 uvicorn 或 hypercorn。
在命令行键入:
    pip install uvicorn
或者
    pip install hypercorn
[2023-02-20 14:53:06.693] bot.py (260) - [WARNING] : 未找到可用的 ASGI 服务,反向 WebSocket 和 WebHook 上报将不可用。
仅 HTTP 轮询与正向 WebSocket 可用。
建议安装 ASGI 服务器,uvicorn或hypercorn。
在命令行键入:
    pip install uvicorn
或者
    pip install hypercorn
2023-02-20 14:53:16 - ERROR
[2023-02-20 14:53:16.709] base.py (43) - [ERROR] :
[2023-02-20 14:53:16.712] main.py (184) - [ERROR] : 捕捉到未知异常:, 请前往 https://github.com/RockChinQ/QChatGPT/issues 查找或提issue
Exception in thread Thread-1 (run_bot_wrapper):
Traceback (most recent call last):
  File "E:\桌面文件\do\python\lib\site-packages\websockets\legacy\client.py", line 666, in __await_impl__
    await protocol.handshake(
  File "E:\桌面文件\do\python\lib\site-packages\websockets\legacy\client.py", line 332, in handshake
    raise InvalidStatusCode(status_code, response_headers)
websockets.exceptions.InvalidStatusCode: server rejected WebSocket connection: HTTP 404

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "E:\桌面文件\do\python\lib\site-packages\websockets\legacy\client.py", line 680, in __await_impl__
    await protocol.wait_closed()
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "asyncio\tasks.py", line 456, in wait_for
asyncio.exceptions.CancelledError

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

Traceback (most recent call last):
  File "threading.py", line 1016, in _bootstrap_inner
  File "threading.py", line 953, in run
  File "E:\桌面文件\do\QChatGPT\main.py", line 187, in run_bot_wrapper
    raise e
  File "E:\桌面文件\do\QChatGPT\main.py", line 149, in run_bot_wrapper
    qqbot.bot.run()
  File "E:\桌面文件\do\python\lib\site-packages\mirai\bot.py", line 197, in run
    MiraiRunner(self).run(host, port, asgi_server, **kwargs)
  File "E:\桌面文件\do\python\lib\site-packages\mirai\bot.py", line 274, in run
    asyncio.run(self._run())
  File "asyncio\runners.py", line 44, in run
  File "asyncio\base_events.py", line 649, in run_until_complete
  File "E:\桌面文件\do\python\lib\site-packages\mirai\bot.py", line 238, in _run
    await self.startup()
  File "E:\桌面文件\do\python\lib\site-packages\mirai\bot.py", line 226, in startup
    await asyncio.gather(*coros)
  File "E:\桌面文件\do\python\lib\site-packages\mirai\bot.py", line 135, in startup
    await self._adapter.login(self.qq)
  File "E:\桌面文件\do\python\lib\site-packages\mirai\adapters\base.py", line 35, in wrapped
    return await func(self, *args, **kwargs)
  File "E:\桌面文件\do\python\lib\site-packages\mirai\adapters\websocket.py", line 187, in login
    self.connection = await connect(self.host_name, extra_headers=headers)
  File "E:\桌面文件\do\python\lib\site-packages\websockets\legacy\client.py", line 659, in __await_impl_timeout__
    return await asyncio.wait_for(self.__await_impl__(), self.open_timeout)
  File "asyncio\tasks.py", line 458, in wait_for
asyncio.exceptions.TimeoutError
RockChinQ commented 1 year ago

RockChinQ/QChatGPT#22

1227925230 commented 1 year ago

RockChinQ/QChatGPT#22

修改端口后还是出现了这个问题

WARNING: pip is being invoked by an old script wrapper. This will fail in a futu re version of pip. Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the unde rlying issue. To avoid this problem you can invoke Python with '-m pip' instead of running pip directly. Looking in indexes: https://pypi.douban.com/simple/ Requirement already satisfied: openai in c:\users\administrator\desktop\ai\pytho n\lib\site-packages (0.27.0) Requirement already satisfied: Pillow in c:\users\administrator\desktop\ai\pytho n\lib\site-packages (9.4.0) Requirement already satisfied: aiohttp in c:\users\administrator\desktop\ai\pyth on\lib\site-packages (from openai) (0.22.5) Requirement already satisfied: requests>=2.20 in c:\users\administrator\desktop\ ai\python\lib\site-packages (from openai) (2.28.2) Requirement already satisfied: tqdm in c:\users\administrator\desktop\ai\python\ lib\site-packages (from openai) (4.65.0) Requirement already satisfied: idna<4,>=2.5 in c:\users\administrator\desktop\ai \python\lib\site-packages (from requests>=2.20->openai) (3.4) Requirement already satisfied: certifi>=2017.4.17 in c:\users\administrator\desk top\ai\python\lib\site-packages (from requests>=2.20->openai) (2022.12.7) Requirement already satisfied: charset-normalizer<4,>=2 in c:\users\administrato r\desktop\ai\python\lib\site-packages (from requests>=2.20->openai) (3.1.0) Requirement already satisfied: urllib3<1.27,>=1.21.1 in c:\users\administrator\d esktop\ai\python\lib\site-packages (from requests>=2.20->openai) (1.26.14) Requirement already satisfied: chardet in c:\users\administrator\desktop\ai\pyth on\lib\site-packages (from aiohttp->openai) (5.1.0) Requirement already satisfied: multidict<2,>=1.2.2 in c:\users\administrator\des ktop\ai\python\lib\site-packages (from aiohttp->openai) (1.2.2) Requirement already satisfied: colorama in c:\users\administrator\desktop\ai\pyt hon\lib\site-packages (from tqdm->openai) (0.4.6) [2023-03-09 21:10:14.325] main.py (261) - [INFO] : 程序启动完成,如长时间未显示 ”成功登录到账号xxxxx“ ,并且不回复消息,请查看 https://github.com/RockChinQ/QCha tGPT/issues/37 Traceback (most recent call last): File "C:\Users\Administrator\Desktop\ai\QChatGPT\main.py", line 360, in <modul e> qqbot = main(True) File "C:\Users\Administrator\Desktop\ai\QChatGPT\main.py", line 178, in main import pkg.openai.manager File "C:\Users\Administrator\Desktop\ai\QChatGPT.\pkg\openai\manager.py", lin e 3, in import openai File "C:\Users\Administrator\Desktop\ai\python\lib\site-packages\openai__init .py", line 9, in from openai.api_resources import ( File "C:\Users\Administrator\Desktop\ai\python\lib\site-packages\openai\api_re sources\init.py", line 1, in from openai.api_resources.audio import Audio # noqa: F401 File "C:\Users\Administrator\Desktop\ai\python\lib\site-packages\openai\api_re sources\audio.py", line 4, in from openai import api_requestor, util File "C:\Users\Administrator\Desktop\ai\python\lib\site-packages\openai\api_re questor.py", line 21, in import aiohttp File "C:\Users\Administrator\Desktop\ai\python\lib\site-packages\aiohttp\ini t__.py", line 10, in from .protocol import * # noqa File "C:\Users\Administrator\Desktop\ai\python\lib\site-packages\aiohttp\proto col.py", line 17, in from .helpers import reify File "C:\Users\Administrator\Desktop\ai\python\lib\site-packages\aiohttp\helpe rs.py", line 26 ensure_future = asyncio.async ^^^^^ SyntaxError: invalid syntax

C:\Users\Administrator\Desktop\ai\QChatGPT>pause