RockChinQ / QChatGPT

😎高稳定性、🧩支持扩展、🦄多模态的 ChatGPT QQ / QQ频道 / One Bot 机器人🤖 | 支持 OpenAI GPT、GPT 4o、Claude、Gemini Pro、DeepSeek、Moonshot(Kimi)、gpt4free、One API、Ollama 的 QQ / QQ频道 / OneBot 机器人 / Agent 平台
https://q.rkcn.top
GNU Affero General Public License v3.0
4.21k stars 329 forks source link

[BUG]运行run-bot.sh报未知异常 #129

Closed KADGang closed 1 year ago

KADGang commented 1 year ago

运行环境

描述漏洞
在运行run-mirai后到登录一切正常,此时新开终端运行run-bot时出错。

完整报错信息

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
KADGang commented 1 year ago

已经找到原因,是由于机器上安装了hypercorn