Exception in thread Thread-1 (run_bot_wrapper):
Traceback (most recent call last):
File "/home/ubunrabbit/mirai-repos/qcg/python/lib/python3.10/asyncio/unix_events.py", line 105, in add_signal_handler
signal.set_wakeup_fd(self._csock.fileno())
ValueError: set_wakeup_fd only works in main thread of the main interpreter
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/ubunrabbit/mirai-repos/qcg/python/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
self.run()
File "/home/ubunrabbit/mirai-repos/qcg/python/lib/python3.10/threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "/home/ubunrabbit/mirai-repos/qcg/QChatGPT/main.py", line 185, in run_bot_wrapper
raise e
File "/home/ubunrabbit/mirai-repos/qcg/QChatGPT/main.py", line 147, in run_bot_wrapper
qqbot.bot.run()
File "/home/ubunrabbit/mirai-repos/qcg/python/lib/python3.10/site-packages/mirai/bot.py", line 197, in run
MiraiRunner(self).run(host, port, asgi_server, **kwargs)
File "/home/ubunrabbit/mirai-repos/qcg/python/lib/python3.10/site-packages/mirai/bot.py", line 255, in run
if not asgi_serve(
File "/home/ubunrabbit/mirai-repos/qcg/python/lib/python3.10/site-packages/mirai/asgi.py", line 211, in asgi_serve
asyncio.run(serve(app, config), debug=True)
File "/home/ubunrabbit/mirai-repos/qcg/python/lib/python3.10/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/home/ubunrabbit/mirai-repos/qcg/python/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
return future.result()
File "/home/ubunrabbit/.local/lib/python3.10/site-packages/hypercorn/asyncio/__init__.py", line 49, in serve
await worker_serve(
File "/home/ubunrabbit/.local/lib/python3.10/site-packages/hypercorn/asyncio/run.py", line 67, in worker_serve
loop.add_signal_handler(getattr(signal, signal_name), _signal_handler)
File "/home/ubunrabbit/mirai-repos/qcg/python/lib/python3.10/asyncio/unix_events.py", line 107, in add_signal_handler
raise RuntimeError(str(exc))
RuntimeError: set_wakeup_fd only works in main thread of the main interpreter
运行环境
描述漏洞
在运行run-mirai后到登录一切正常,此时新开终端运行run-bot时出错。
完整报错信息