lss233 / chatgpt-mirai-qq-bot

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

[BUG] 登录出错,提示Server error '500 Internal Server Error' for url 'https://bypass.duti.tech/api/conversations? #407

Closed timeance closed 1 year ago

timeance commented 1 year ago

提交 issue 前,请先确认:

表现
登录失败

运行环境:

复现步骤
顺利运行了两天,今天重启一下发现突然登录不了,报错如下图所示

预期行为
能够正常使用

截图
主要报错:

2023-03-22 18:00:23.121 | INFO     | manager.bot:__login_V1:235 - 尝试使用 access_token 登录中...
2023-03-22 18:00:24.838 | ERROR    | manager.bot:login_openai:149 - 未知错误:
2023-03-22 18:00:24.840 | ERROR    | manager.bot:login_openai:150 - Server error '500 Internal Server Error' for url 'https://bypass.duti.tech/api/conversations?offset=0&limit=1'
For more information check: https://httpstatuses.com/500
Traceback (most recent call last):

完整报错

2023-03-22 18:00:21.429 | ERROR    | config:scan_presets:305 - 检查预设:正常 <==> presets/default.txt [失败:文件不存在]
2023-03-22 18:00:21.432 | SUCCESS  | config:scan_presets:303 - 检查预设:猫娘 <==> presets/catgirl.txt [成功]
2023-03-22 18:00:21.434 | SUCCESS  | config:scan_presets:316 - 注册预设:catgirl <==> ./presets/catgirl.txt [成功]
2023-03-22 18:00:21.435 | SUCCESS  | config:scan_presets:316 - 注册预设:预设模板 <==> ./presets/预设模板.txt [成功]
2023-03-22 18:00:21.437 | INFO     | __main__:<module>:11 - 检测到 Onebot 配置,将以 Onebot 模式启动……
2023-03-22 18:00:22.004 | ERROR    | utils.text_to_img:<module>:49 - 未检测到 wkhtmltoimage,无法进行 Markdown 渲染!
 * Serving Quart app ''
 * Environment: production
 * Please use an ASGI server (e.g. Hypercorn) directly in production
 * Debug mode: False
 * Running on http://127.0.0.1:8556 (CTRL + C to quit)
2023-03-22 18:00:22.022 | INFO     | manager.bot:login_openai:119 - 正在登录第 1 个 OpenAI 账号
2023-03-22 18:00:22.025 | INFO     | manager.bot:__login_V1:211 - 模式:无浏览器登录
2023-03-22 18:00:22.029 | INFO     | manager.bot:__check_proxy:183 - [代理测试] 正在检查代理配置:http://127.0.0.1:17890
2023-03-22 18:00:23.119 | SUCCESS  | manager.bot:__check_proxy:191 - [代理测试] 连接成功!
2023-03-22 18:00:23.121 | INFO     | manager.bot:__login_V1:235 - 尝试使用 access_token 登录中...
2023-03-22 18:00:24.838 | ERROR    | manager.bot:login_openai:149 - 未知错误:
2023-03-22 18:00:24.840 | ERROR    | manager.bot:login_openai:150 - Server error '500 Internal Server Error' for url 'https://bypass.duti.tech/api/conversations?offset=0&limit=1'
For more information check: https://httpstatuses.com/500
Traceback (most recent call last):

  File "C:\Users\Administrator\Desktop\Bot_zar\chatgpt-mirai-qq-bot\bot.py", line 12, in <module>
    import onebot_bot

  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed

  File "C:\Users\Administrator\Desktop\Bot_zar\chatgpt-mirai-qq-bot\onebot_bot.py", line 232, in <module>
    bot.run(host=config.onebot.reverse_ws_host, port=config.onebot.reverse_ws_port)
    │   │        │      │      │                     │      │      └ 8556
    │   │        │      │      │                     │      └ Onebot(qq=123456, manager_qq=123456, reverse_ws_host='127.0.0.1', reverse_ws_port=8556)
    │   │        │      │      │                     └ Config(onebot=Onebot(qq=123456, manager_qq=123456, reverse_ws_host='127.0.0.1', reverse_ws_port=8556), mirai=None, tel...
    │   │        │      │      └ '127.0.0.1'
    │   │        │      └ Onebot(qq=123456, manager_qq=123456, reverse_ws_host='127.0.0.1', reverse_ws_port=8556)
    │   │        └ Config(onebot=Onebot(qq=123456, manager_qq=123456, reverse_ws_host='127.0.0.1', reverse_ws_port=8556), mirai=None, tel...
    │   └ <function CQHttp.run at 0x0000022459162E80>
    └ <aiocqhttp.CQHttp object at 0x0000022457081950>

  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\aiocqhttp\__init__.py", line 222, in run
    self._server_app.run(host=host, port=port, *args, **kwargs)
    │    │           │        │          │      │       └ {'use_reloader': False}
    │    │           │        │          │      └ ()
    │    │           │        │          └ 8556
    │    │           │        └ '127.0.0.1'
    │    │           └ <function Quart.run at 0x000002245914CAE0>
    │    └ <Quart ''>
    └ <aiocqhttp.CQHttp object at 0x0000022457081950>
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\quart\app.py", line 1423, in run
    loop.run_until_complete(asyncio.gather(*tasks))
    │    │                  │       │       └ [<Task pending name='Task-1' coro=<serve() running at C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site...
    │    │                  │       └ <function gather at 0x00000224549FD6C0>
    │    │                  └ <module 'asyncio' from 'C:\\Users\\Administrator\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\asyncio\\__init__.py'>
    │    └ <function BaseEventLoop.run_until_complete at 0x0000022454A16480>
    └ <ProactorEventLoop running=True closed=False debug=False>
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 640, in run_until_complete
    self.run_forever()
    │    └ <function ProactorEventLoop.run_forever at 0x0000022454EEE340>
    └ <ProactorEventLoop running=True closed=False debug=False>
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\asyncio\windows_events.py", line 321, in run_forever
    super().run_forever()
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 607, in run_forever
    self._run_once()
    │    └ <function BaseEventLoop._run_once at 0x0000022454A1C220>
    └ <ProactorEventLoop running=True closed=False debug=False>
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 1922, in _run_once
    handle._run()
    │      └ <function Handle._run at 0x000002245318E2A0>
    └ <Handle <TaskStepMethWrapper object at 0x000002245954D510>()>
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\asyncio\events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
    │    │            │    │           │    └ <member '_args' of 'Handle' objects>
    │    │            │    │           └ <Handle <TaskStepMethWrapper object at 0x000002245954D510>()>
    │    │            │    └ <member '_callback' of 'Handle' objects>
    │    │            └ <Handle <TaskStepMethWrapper object at 0x000002245954D510>()>
    │    └ <member '_context' of 'Handle' objects>
    └ <Handle <TaskStepMethWrapper object at 0x000002245954D510>()>
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\hypercorn\asyncio\lifespan.py", line 43, in handle_lifespan
    await self.app(
          │    └ <hypercorn.app_wrappers.ASGIWrapper object at 0x000002245709FD90>
          └ <hypercorn.asyncio.lifespan.Lifespan object at 0x0000022459487450>
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\hypercorn\app_wrappers.py", line 33, in __call__
    await self.app(scope, receive, send)
          │    │   │      │        └ <bound method Lifespan.asgi_send of <hypercorn.asyncio.lifespan.Lifespan object at 0x0000022459487450>>
          │    │   │      └ <bound method Lifespan.asgi_receive of <hypercorn.asyncio.lifespan.Lifespan object at 0x0000022459487450>>
          │    │   └ {'type': 'lifespan', 'asgi': {'spec_version': '2.0', 'version': '3.0'}}
          │    └ <Quart ''>
          └ <hypercorn.app_wrappers.ASGIWrapper object at 0x000002245709FD90>
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\quart\app.py", line 1902, in __call__
    await self.asgi_app(scope, receive, send)
          │    │        │      │        └ <bound method Lifespan.asgi_send of <hypercorn.asyncio.lifespan.Lifespan object at 0x0000022459487450>>
          │    │        │      └ <bound method Lifespan.asgi_receive of <hypercorn.asyncio.lifespan.Lifespan object at 0x0000022459487450>>
          │    │        └ {'type': 'lifespan', 'asgi': {'spec_version': '2.0', 'version': '3.0'}}
          │    └ <function Quart.asgi_app at 0x000002245914D940>
          └ <Quart ''>
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\quart\app.py", line 1928, in asgi_app
    await asgi_handler(receive, send)
          │            │        └ <bound method Lifespan.asgi_send of <hypercorn.asyncio.lifespan.Lifespan object at 0x0000022459487450>>
          │            └ <bound method Lifespan.asgi_receive of <hypercorn.asyncio.lifespan.Lifespan object at 0x0000022459487450>>
          └ <quart.asgi.ASGILifespan object at 0x00000224594A0C50>
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\quart\asgi.py", line 311, in __call__
    await self.app.startup()
          │    │   └ <function Quart.startup at 0x000002245914D9E0>
          │    └ <Quart ''>
          └ <quart.asgi.ASGILifespan object at 0x00000224594A0C50>
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\quart\app.py", line 1936, in startup
    await self.ensure_async(func)()
          │    │            └ <function startup at 0x0000022459495DA0>
          │    └ <function Quart.ensure_async at 0x000002245914C5E0>
          └ <Quart ''>

  File "C:\Users\Administrator\Desktop\Bot_zar\chatgpt-mirai-qq-bot\onebot_bot.py", line 229, in startup
    await botManager.login()
          │          └ <function BotManager.login at 0x0000022458664F40>
          └ <manager.bot.BotManager object at 0x000002245833D6D0>

  File "C:\Users\Administrator\Desktop\Bot_zar\chatgpt-mirai-qq-bot\manager\bot.py", line 81, in login
    await self.login_openai()
          │    └ <function BotManager.login_openai at 0x0000022458665080>
          └ <manager.bot.BotManager object at 0x000002245833D6D0>

> File "C:\Users\Administrator\Desktop\Bot_zar\chatgpt-mirai-qq-bot\manager\bot.py", line 125, in login_openai
    bot = await self.__login_V1(account)
                │               └ OpenAIEmailAuth(mode='browserless', proxy='http://127.0.0.1:17890', driver_exec_path=None, browser_exec_path=None, conversati...
                └ <manager.bot.BotManager object at 0x000002245833D6D0>

  File "C:\Users\Administrator\Desktop\Bot_zar\chatgpt-mirai-qq-bot\manager\bot.py", line 238, in __login_V1
    if await __V1_check_auth():

  File "C:\Users\Administrator\Desktop\Bot_zar\chatgpt-mirai-qq-bot\manager\bot.py", line 226, in __V1_check_auth
    await bot.get_conversations(0, 1)
          │   └ <function AsyncChatbot.get_conversations at 0x0000022456C69BC0>
          └ <revChatGPT.V1.AsyncChatbot object at 0x000002245925E4D0>

  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\revChatGPT\V1.py", line 811, in get_conversations
    self.__check_response(response)
    │                     └ <Response [500 Internal Server Error]>
    └ <revChatGPT.V1.AsyncChatbot object at 0x000002245925E4D0>
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\revChatGPT\V1.py", line 886, in __check_response
    response.raise_for_status()
    │        └ <function Response.raise_for_status at 0x0000022456381D00>
    └ <Response [500 Internal Server Error]>
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\httpx\_models.py", line 749, in raise_for_status
    raise HTTPStatusError(message, request=request, response=self)
          │               │                │                 └ <Response [500 Internal Server Error]>
          │               │                └ <Request('GET', 'https://bypass.duti.tech/api/conversations?offset=0&limit=1')>
          │               └ "Server error '500 Internal Server Error' for url 'https://bypass.duti.tech/api/conversations?offset=0&limit=1'\nFor more inf...
          └ <class 'httpx.HTTPStatusError'>

httpx.HTTPStatusError: Server error '500 Internal Server Error' for url 'https://bypass.duti.tech/api/conversations?offset=0&limit=1'
For more information check: https://httpstatuses.com/500
2023-03-22 18:00:24.920 | SUCCESS  | manager.bot:login_openai:153 - 成功登录 0/1 个 OpenAI 账号!
2023-03-22 18:00:24.923 | ERROR    | manager.bot:login:84 - 没有登录成功的账号,程序无法启动!
ERROR:asyncio:_GatheringFuture exception was never retrieved
future: <_GatheringFuture finished exception=CancelledError()>
Traceback (most recent call last):
  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "C:\Users\Administrator\Desktop\Bot_zar\chatgpt-mirai-qq-bot\onebot_bot.py", line 232, in <module>
    bot.run(host=config.onebot.reverse_ws_host, port=config.onebot.reverse_ws_port)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\aiocqhttp\__init__.py", line 222, in run
    self._server_app.run(host=host, port=port, *args, **kwargs)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\quart\app.py", line 1423, in run
    loop.run_until_complete(asyncio.gather(*tasks))
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 640, in run_until_complete
    self.run_forever()
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\asyncio\windows_events.py", line 321, in run_forever
    super().run_forever()
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 607, in run_forever
    self._run_once()
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 1922, in _run_once
    handle._run()
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\asyncio\events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\hypercorn\asyncio\lifespan.py", line 43, in handle_lifespan
    await self.app(
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\hypercorn\app_wrappers.py", line 33, in __call__
    await self.app(scope, receive, send)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\quart\app.py", line 1902, in __call__
    await self.asgi_app(scope, receive, send)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\quart\app.py", line 1928, in asgi_app
    await asgi_handler(receive, send)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\quart\asgi.py", line 311, in __call__
    await self.app.startup()
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\quart\app.py", line 1936, in startup
    await self.ensure_async(func)()
  File "C:\Users\Administrator\Desktop\Bot_zar\chatgpt-mirai-qq-bot\onebot_bot.py", line 229, in startup
    await botManager.login()
  File "C:\Users\Administrator\Desktop\Bot_zar\chatgpt-mirai-qq-bot\manager\bot.py", line 85, in login
    exit(-2)
  File "<frozen _sitebuiltins>", line 26, in __call__
SystemExit: -2

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\asyncio\tasks.py", line 466, in wait_for
    await waiter
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\hypercorn\asyncio\__init__.py", line 49, in serve
    await worker_serve(
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\hypercorn\asyncio\run.py", line 77, in worker_serve
    await lifespan.wait_for_startup()
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\hypercorn\asyncio\lifespan.py", line 76, in wait_for_startup
    await asyncio.wait_for(self.startup.wait(), timeout=self.config.startup_timeout)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\asyncio\tasks.py", line 469, in wait_for
    return fut.result()
           ^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\asyncio\locks.py", line 213, in wait
    await fut
asyncio.exceptions.CancelledError
ERROR:asyncio:Task exception was never retrieved
future: <Task finished name='Task-3' coro=<Lifespan.handle_lifespan() done, defined at C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\hypercorn\asyncio\lifespan.py:31> exception=SystemExit(-2)>
Traceback (most recent call last):
  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "C:\Users\Administrator\Desktop\Bot_zar\chatgpt-mirai-qq-bot\onebot_bot.py", line 232, in <module>
    bot.run(host=config.onebot.reverse_ws_host, port=config.onebot.reverse_ws_port)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\aiocqhttp\__init__.py", line 222, in run
    self._server_app.run(host=host, port=port, *args, **kwargs)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\quart\app.py", line 1423, in run
    loop.run_until_complete(asyncio.gather(*tasks))
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 640, in run_until_complete
    self.run_forever()
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\asyncio\windows_events.py", line 321, in run_forever
    super().run_forever()
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 607, in run_forever
    self._run_once()
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 1922, in _run_once
    handle._run()
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\asyncio\events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\hypercorn\asyncio\lifespan.py", line 43, in handle_lifespan
    await self.app(
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\hypercorn\app_wrappers.py", line 33, in __call__
    await self.app(scope, receive, send)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\quart\app.py", line 1902, in __call__
    await self.asgi_app(scope, receive, send)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\quart\app.py", line 1928, in asgi_app
    await asgi_handler(receive, send)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\quart\asgi.py", line 311, in __call__
    await self.app.startup()
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\quart\app.py", line 1936, in startup
    await self.ensure_async(func)()
  File "C:\Users\Administrator\Desktop\Bot_zar\chatgpt-mirai-qq-bot\onebot_bot.py", line 229, in startup
    await botManager.login()
  File "C:\Users\Administrator\Desktop\Bot_zar\chatgpt-mirai-qq-bot\manager\bot.py", line 85, in login
    exit(-2)
  File "<frozen _sitebuiltins>", line 26, in __call__
SystemExit: -2
请按任意键继续. . .

其他内容
另外,严格按照教程cfworker搭建搭建endpoint,报错如下:

2023-03-22 18:09:15.098 | ERROR    | manager.bot:login_openai:149 - 未知错误:
2023-03-22 18:09:15.100 | ERROR    | manager.bot:login_openai:150 - Server error '526 ' for url 'https://gpt.test.top/api/conversations?offset=0&limit=1'
For more information check: https://httpstatuses.com/526
Traceback (most recent call last):

请问这该如何解决呢

bai-piao commented 1 year ago

请问能否指路endpoint搭建教程,感谢

timeance commented 1 year ago

确实是endpoint的问题,更换后顺利运行