-
Notifications
You must be signed in to change notification settings - Fork 346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: 初始化后出现base.py (43) - [ERROR]异常 #609
Comments
我正在考虑是否需要将3.10降到3.9 |
mirai端口冲突,解决办法 #22 |
mirai成功运行没有问题,mirai的控制台中,有: |
你mirai-api-http版本不对或者没有配置ws连接方式,可能是因为安装器操作失败。你可以按照文档的手动部署方式自己重新部署一下mirai和mirai-api-http。或者考虑换用go-cqhttp。 |
我重新配置了ws,是识别码输错了,机器人启动成功了,谢谢! |
我在pycharm试图调试时,(未更改任何代码)运行main.py,之前的报错消失了。而我在重新给机器人发送消息时,pycharm控制台显示: 若是不在pycharm运行而是直接运行bat的话,仍然是err:BaseClient.build_request() got an unexpected keyword argument 'timeout' |
部署方式
安装器部署
登录框架
Mirai
系统环境
Windows Server 2019
Python环境
Python 3.10
异常情况
在mirai登录后,我启动了机器人,初始化一直失败,提示有库缺失,我在补充并安装了所需库之后,重新运行了机器人。初始化成功了,但是登录失败,控制台出现“404”的字样,此前控制台曾提示websockets库版本不对,我更新了版本之后就这样了。其实虽然更新了版本,但是websockets与yiri-mirai其实不兼容,而与yiri-mirai兼容的websockets版本又不支持python3.10。于是在运行中,出现了报错。
报错信息
C:\Users\Administrator\Desktop\bot\QChatGPT>..\python\python.exe main.py
[2023-11-21 23:47:12.983] main.py (118) - [INFO] : 检查config模块完整性.
[2023-11-21 23:47:12.984] main.py (151) - [INFO] : 检查tips模块完整性.
Database initialized.
[2023-11-21 23:47:13.816] keymgr.py (78) - [INFO] : 使用api-key:default
[2023-11-21 23:47:13.841] manager.py (239) - [INFO] : 加载禁用列表: person: [2854196310], group: [204785790, 691226829]
[2023-11-21 23:47:13.844] settings.py (98) - [INFO] : 已全局启用内容函数。
[2023-11-21 23:47:13.845] host.py (135) - [INFO] : 初始化插件
[2023-11-21 23:47:13.845] host.py (152) - [INFO] : 以下插件已初始化:
[2023-11-21 23:47:15.847] main.py (334) - [INFO] : 您正在使用Windows系统,若命令行窗口处于“选择”模式,程序可能会被暂停,此时请右键点击窗口空白区域使其取消选择模式。
2023-11-21 23:47:23 - ERROR
[2023-11-21 23:47:23.849] base.py (43) - [ERROR] :
Traceback (most recent call last):
File "C:\Users\Administrator\Desktop\bot\python\lib\site-packages\websockets\legacy\client.py", line 659, in await_impl
await protocol.handshake(
File "C:\Users\Administrator\Desktop\bot\python\lib\site-packages\websockets\legacy\client.py", line 328, 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 "C:\Users\Administrator\Desktop\bot\python\lib\site-packages\websockets\legacy\client.py", line 668, 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 "C:\Users\Administrator\Desktop\bot\QChatGPT\main.py", line 273, in run_bot_wrapper
qqbot.adapter.run_sync()
File "C:\Users\Administrator\Desktop\bot\QChatGPT.\pkg\qqbot\sources\yirimirai.py", line 120, in run_sync
loop.run_until_complete(MiraiRunner(self.bot)._run())
File "asyncio\base_events.py", line 649, in run_until_complete
File "C:\Users\Administrator\Desktop\bot\python\lib\site-packages\mirai\bot.py", line 238, in _run
await self.startup()
File "C:\Users\Administrator\Desktop\bot\python\lib\site-packages\mirai\bot.py", line 226, in startup
await asyncio.gather(*coros)
File "C:\Users\Administrator\Desktop\bot\python\lib\site-packages\mirai\bot.py", line 135, in startup
await self._adapter.login(self.qq)
File "C:\Users\Administrator\Desktop\bot\python\lib\site-packages\mirai\adapters\base.py", line 35, in wrapped
return await func(self, *args, **kwargs)
File "C:\Users\Administrator\Desktop\bot\python\lib\site-packages\mirai\adapters\websocket.py", line 187, in login
self.connection = await connect(self.host_name, extra_headers=headers)
File "C:\Users\Administrator\Desktop\bot\python\lib\site-packages\websockets\legacy\client.py", line 650, 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
[2023-11-21 23:47:23.873] main.py (310) - [ERROR] : 捕捉到未知异常:, 请前往 https://github.com/RockChinQ/QChatGPT/issues 查找或提issue
Exception in thread Thread-2 (run_bot_wrapper):
Traceback (most recent call last):
File "C:\Users\Administrator\Desktop\bot\python\lib\site-packages\websockets\legacy\client.py", line 659, in await_impl
await protocol.handshake(
File "C:\Users\Administrator\Desktop\bot\python\lib\site-packages\websockets\legacy\client.py", line 328, 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 "C:\Users\Administrator\Desktop\bot\python\lib\site-packages\websockets\legacy\client.py", line 668, 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 "C:\Users\Administrator\Desktop\bot\QChatGPT\main.py", line 313, in run_bot_wrapper
raise e
File "C:\Users\Administrator\Desktop\bot\QChatGPT\main.py", line 273, in run_bot_wrapper
qqbot.adapter.run_sync()
File "C:\Users\Administrator\Desktop\bot\QChatGPT.\pkg\qqbot\sources\yirimirai.py", line 120, in run_sync
loop.run_until_complete(MiraiRunner(self.bot)._run())
File "asyncio\base_events.py", line 649, in run_until_complete
File "C:\Users\Administrator\Desktop\bot\python\lib\site-packages\mirai\bot.py", line 238, in _run
await self.startup()
File "C:\Users\Administrator\Desktop\bot\python\lib\site-packages\mirai\bot.py", line 226, in startup
await asyncio.gather(*coros)
File "C:\Users\Administrator\Desktop\bot\python\lib\site-packages\mirai\bot.py", line 135, in startup
await self._adapter.login(self.qq)
File "C:\Users\Administrator\Desktop\bot\python\lib\site-packages\mirai\adapters\base.py", line 35, in wrapped
return await func(self, *args, **kwargs)
File "C:\Users\Administrator\Desktop\bot\python\lib\site-packages\mirai\adapters\websocket.py", line 187, in login
self.connection = await connect(self.host_name, extra_headers=headers)
File "C:\Users\Administrator\Desktop\bot\python\lib\site-packages\websockets\legacy\client.py", line 650, 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
The text was updated successfully, but these errors were encountered: