lss233 / chatgpt-mirai-qq-bot

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

[BUG] 请填写标题出现故障!如果这个问题持续出现,请和我说“重置会话” 来开启一段新的会话,或者发送 “回滚对话” 来回溯到上一条对话,你上一条说的我就当作没看见。 原因:list index out of range #1206

Open Hu-Junge opened 1 year ago

Hu-Junge commented 1 year ago

提交 issue 前,请先确认:

表现
描述 BUG 的表现情况 提示list index out of range

运行环境:

复现步骤
描述你是如何触发这个 BUG 的

  1. 按照步骤正常操作
  2. 仅仅删除过配置文件重新生成

截图
image 2023-09-24 11:36:59.016 | ERROR | middlewares.timeout:handle_request:36 - 发生错误: list index out of range 2023-09-24 11:36:59.017 | ERROR | universal:handle_message:297 - list index out of range Traceback (most recent call last):

File "D:\QQ_ChatGpt\Windows-quickstart-go-cqhttp-refs.tags.v2.5.3\chatgpt-mirai-qq-bot\bot.py", line 58, in loop.run_until_complete(asyncio.gather(*bots)) │ │ │ │ └ [<Task pending name='Task-2' coro=<start_task() running at D:\QQ_ChatGpt\Windows-quickstart-go-cqhttp-refs.tags.v2.5.3\chatgp... │ │ │ └ <function gather at 0x00000205858C4EE0> │ │ └ <module 'asyncio' from 'C:\Users\Lenovo\Miniconda3\envs\chatgpt\lib\asyncio\init.py'> │ └ <function BaseEventLoop.run_until_complete at 0x00000205858D5B40> └

File "C:\Users\Lenovo\Miniconda3\envs\chatgpt\lib\asyncio\base_events.py", line 636, in run_until_complete self.run_forever() │ └ <function ProactorEventLoop.run_forever at 0x000002058712EC20> └

File "C:\Users\Lenovo\Miniconda3\envs\chatgpt\lib\asyncio\windows_events.py", line 321, in run_forever super().run_forever()

File "C:\Users\Lenovo\Miniconda3\envs\chatgpt\lib\asyncio\base_events.py", line 603, in run_forever self._run_once() │ └ <function BaseEventLoop._run_once at 0x00000205858D75B0> └

File "C:\Users\Lenovo\Miniconda3\envs\chatgpt\lib\asyncio\base_events.py", line 1909, in _run_once handle._run() │ └ <function Handle._run at 0x0000020585866680> └ <Handle Task.task_wakeup()>

File "C:\Users\Lenovo\Miniconda3\envs\chatgpt\lib\asyncio\events.py", line 80, in _run self._context.run(self._callback, *self._args) │ │ │ │ │ └ <member '_args' of 'Handle' objects> │ │ │ │ └ <Handle Task.task_wakeup()> │ │ │ └ <member '_callback' of 'Handle' objects> │ │ └ <Handle Task.task_wakeup()> │ └ <member '_context' of 'Handle' objects> └ <Handle Task.task_wakeup()>

File "D:\QQ_ChatGpt\Windows-quickstart-go-cqhttp-refs.tags.v2.5.3\chatgpt-mirai-qq-bot\platforms\onebotbot.py", line 151, in await handle_message( └ <function handle_message at 0x00000205B10ED1B0>

File "D:\QQ_ChatGpt\Windows-quickstart-go-cqhttp-refs.tags.v2.5.3\chatgpt-mirai-qq-bot\universal.py", line 271, in handle_message await action(session_id, message.strip(), conversation_context, respond) │ │ │ │ │ └ <function handle_message..respond at 0x00000205B121F7F0> │ │ │ │ └ None │ │ │ └ <method 'strip' of 'str' objects> │ │ └ '你好' │ └ 'friend-1805824390' └ <function handle_message..wrap_request..call at 0x00000205B10EF6D0>

File "D:\QQ_ChatGpt\Windows-quickstart-go-cqhttp-refs.tags.v2.5.3\chatgpt-mirai-qq-bot\universal.py", line 53, in call await m.handle_request(session_id, message, respond, conversation_context, n) │ │ │ │ │ │ └ <function handle_message..wrap_request..call at 0x00000205B10EF130> │ │ │ │ │ └ None │ │ │ │ └ <function handle_message..respond at 0x00000205B121F7F0> │ │ │ └ '你好' │ │ └ 'friend-1805824390' │ └ <function MiddlewareConcurrentLock.handle_request at 0x00000205B10ED7E0> └ <middlewares.concurrentlock.MiddlewareConcurrentLock object at 0x00000205B10E6050>

File "D:\QQ_ChatGpt\Windows-quickstart-go-cqhttp-refs.tags.v2.5.3\chatgpt-mirai-qq-bot\middlewares\concurrentlock.py", line 43, in handle_request await action(session_id, prompt, conversation_context, respond) │ │ │ │ └ <function handle_message..respond at 0x00000205B121F7F0> │ │ │ └ None │ │ └ '你好' │ └ 'friend-1805824390' └ <function handle_message..wrap_request..call at 0x00000205B10EF130>

File "D:\QQ_ChatGpt\Windows-quickstart-go-cqhttp-refs.tags.v2.5.3\chatgpt-mirai-qq-bot\universal.py", line 53, in call await m.handle_request(session_id, message, respond, conversation_context, n) │ │ │ │ │ │ └ <function handle_message..wrap_request..call at 0x00000205B10EF7F0> │ │ │ │ │ └ None │ │ │ │ └ <function handle_message..respond at 0x00000205B121F7F0> │ │ │ └ '你好' │ │ └ 'friend-1805824390' │ └ <function Middleware.handle_request at 0x00000205B10EC940> └ <middlewares.baiducloud.MiddlewareBaiduCloud object at 0x00000205B10E5150>

File "D:\QQ_ChatGpt\Windows-quickstart-go-cqhttp-refs.tags.v2.5.3\chatgpt-mirai-qq-bot\middlewares\middleware.py", line 9, in handle_request await action(session_id, prompt, conversation_context, respond) │ │ │ │ └ <function handle_message..respond at 0x00000205B121F7F0> │ │ │ └ None │ │ └ '你好' │ └ 'friend-1805824390' └ <function handle_message..wrap_request..call at 0x00000205B10EF7F0>

File "D:\QQ_ChatGpt\Windows-quickstart-go-cqhttp-refs.tags.v2.5.3\chatgpt-mirai-qq-bot\universal.py", line 53, in call await m.handle_request(session_id, message, respond, conversation_context, n) │ │ │ │ │ │ └ <function handle_message..wrap_request..call at 0x00000205B10EF490> │ │ │ │ │ └ None │ │ │ │ └ <function handle_message..respond at 0x00000205B121F7F0> │ │ │ └ '你好' │ │ └ 'friend-1805824390' │ └ <function MiddlewareRatelimit.handle_request at 0x00000205B10ECB80> └ <middlewares.ratelimit.MiddlewareRatelimit object at 0x00000205B10E5120>

File "D:\QQ_ChatGpt\Windows-quickstart-go-cqhttp-refs.tags.v2.5.3\chatgpt-mirai-qq-bot\middlewares\ratelimit.py", line 23, in handle_request await action(session_id, prompt, conversation_context, respond) │ │ │ │ └ <function handle_message..respond at 0x00000205B121F7F0> │ │ │ └ None │ │ └ '你好' │ └ 'friend-1805824390' └ <function handle_message..wrap_request..call at 0x00000205B10EF490>

File "D:\QQ_ChatGpt\Windows-quickstart-go-cqhttp-refs.tags.v2.5.3\chatgpt-mirai-qq-bot\universal.py", line 53, in call await m.handle_request(session_id, message, respond, conversation_context, n) │ │ │ │ │ │ └ <function handle_message..request at 0x00000205B121F880> │ │ │ │ │ └ None │ │ │ │ └ <function handle_message..respond at 0x00000205B121F7F0> │ │ │ └ '你好' │ │ └ 'friend-1805824390' │ └ <function MiddlewareTimeout.handle_request at 0x00000205B10ED900> └ <middlewares.timeout.MiddlewareTimeout object at 0x00000205B10E50F0>

File "D:\QQ_ChatGpt\Windows-quickstart-go-cqhttp-refs.tags.v2.5.3\chatgpt-mirai-qq-bot\middlewares\timeout.py", line 40, in handle_request raise e

File "D:\QQ_ChatGpt\Windows-quickstart-go-cqhttp-refs.tags.v2.5.3\chatgpt-mirai-qq-bot\middlewares\timeout.py", line 27, in handle_request await asyncio.wait_for(coro_task, config.response.max_timeout) │ │ │ │ │ └ 600.0 │ │ │ │ └ Response(mode='mixed', buffer_delay=15, default_ai='bard', error_format='出现故障!如果这个问题持续出现,请和我说“重置会话” 来开启一段新的会话,或者发送 “回滚对话” 来回溯... │ │ │ └ Config(onebot=Onebot(manager_qq=1805824390, reverse_ws_host='0.0.0.0', reverse_ws_port=8566), mirai=None, telegram=None, disc... │ │ └ <Task finished name='Task-136' coro=<handle_message..request() done, defined at D:\QQ_ChatGpt\Windows-quickstart-go-c... │ └ <function wait_for at 0x00000205858C49D0> └ <module 'asyncio' from 'C:\Users\Lenovo\Miniconda3\envs\chatgpt\lib\asyncio\init.py'>

File "C:\Users\Lenovo\Miniconda3\envs\chatgpt\lib\asyncio\tasks.py", line 445, in wait_for return fut.result() │ └ <method 'result' of '_asyncio.Task' objects> └ <Task finished name='Task-136' coro=<handle_message..request() done, defined at D:\QQ_ChatGpt\Windows-quickstart-go-c...

File "D:\QQ_ChatGpt\Windows-quickstart-go-cqhttp-refs.tags.v2.5.3\chatgpt-mirai-qq-bot\universal.py", line 224, in request async for rendered in task: └ <async_generator object retry..decorator..wrapper at 0x00000205B128EF40>

File "D:\QQ_ChatGpt\Windows-quickstart-go-cqhttp-refs.tags.v2.5.3\chatgpt-mirai-qq-bot\utils\retry.py", line 21, in wrapper async for result in func(*args, **kwargs): │ │ └ {'prompt': '你好', 'chain': MessageChain([Plain(text='你好')]), 'name': '大吉'} │ └ (<conversation.ConversationContext object at 0x00000205B11EDC90>,) └ <function ConversationContext.ask at 0x00000205B10EC280>

File "D:\QQ_ChatGpt\Windows-quickstart-go-cqhttp-refs.tags.v2.5.3\chatgpt-mirai-qq-bot\conversation.py", line 195, in ask async for item in self.adapter.ask(prompt): │ │ │ └ '你好' │ │ └ <function BardAdapter.ask at 0x00000205AFFAA950> │ └ <adapter.google.bard.BardAdapter object at 0x00000205B11EDCC0> └ <conversation.ConversationContext object at 0x00000205B11EDC90>

File "D:\QQ_ChatGpt\Windows-quickstart-go-cqhttp-refs.tags.v2.5.3\chatgpt-mirai-qq-bot\adapter\google\bard.py", line 59, in ask await self.get_at_token() │ └ <function BardAdapter.get_at_token at 0x00000205AFFAA7A0> └ <adapter.google.bard.BardAdapter object at 0x00000205B11EDCC0>

File "D:\QQ_ChatGpt\Windows-quickstart-go-cqhttp-refs.tags.v2.5.3\chatgpt-mirai-qq-bot\adapter\google\bard.py", line 44, in get_at_token self.at = quote(response.text.split('"SNlM0e":"')[1].split('","')[0]) │ │ │ │ └ <property object at 0x0000020588ABF330> │ │ │ └ <Response [200 OK]> │ │ └ <function quote at 0x00000205852E48B0> │ └ None └ <adapter.google.bard.BardAdapter object at 0x00000205B11EDCC0>

IndexError: list index out of range 2023-09-24 11:36:59.033 | DEBUG | platforms.onebot_bot:respond:112 - [OneBot] 尝试发送消息:出现故障!如果这个问题持续出现,请和我说“重置会 话” 来开启一段新的会话,或者发送 “回滚对话” 来回溯到上一条对话,你上一条说的我就当作没看见。 原因:list index out of range

Hu-Junge commented 1 year ago

使用的是google的Bard

thomashooo commented 1 year ago

我是cookie失效啦,重新用chrome获取一下

p1aintiff commented 1 year ago

我是cookie失效啦,重新用chrome获取一下

重新获取未解决问题

thomashooo commented 1 year ago

SEARCH_SAMESITE=CgQIgpkB; SID=agjimgYa3lpITrBGXs7I3y8FHiFNsJITjtq1blPw6RbSXVf2xn9fD3nAPYSy8QJ0-fE81g.; Secure-3PSID=agjimgYa3lpITrBGXs7I3y8FHiFNsJITjtq1blPw6RbSXVf2tyZJIvTfKO9l_TeECovnUA.; Secure-1PSID=agjimgYa3lpITrBGXs7I3y8FHiFNsJITjtq1blPw6RbSXVf2bbnqoa5sMzz4YUKuFmbtQg.; HSID=AfXNbQAOg9P3vv5JI; SSID=AVqWGzIxbv_KGdsyY; APISID=tEVc5IILB35U56MK/AoAMAmHy0gsi6oEXl; SAPISID=wg7S-iNAt_BZsgP6/AaFCSw9HqqwAESe96; Secure-3PAPISID=wg7S-iNAt_BZsgP6/AaFCSw9HqqwAESe96; Secure-1PAPISID=wg7S-iNAt_BZsgP6/AaFCSw9HqqwAESe96; _ga=GA1.1.1838308273.1695609962; __Secure-1PSIDTS=sidts-CjEB3e41hU1MKfiAZVdD3TvgejP_Oc141PvExaLCjvgwV-W6xKWM6diEqWFlKNAf9C4tEAA; Secure-3PSIDTS=sidts-CjEB3e41hU1MKfiAZVdD3TvgejP_Oc141PvExaLCjvgwV-W6xKWM6diEqWFlKNAf9C4tEAA; 1P_JAR=2023-09-26-11; AEC=Ackid1SBATP5r9_OlNfAmXxYJ1wZ5Hmd7TDGzWbyR3hHmVUItWdDVqSGPSE; NID=511=JqERHU9WWbvQPrHkczA3bntLHWVWdYYmFk2nYUalPXMa3tdzEC39hA090XJ0P4l84HrLsQAa1mUaA7A2yRa8Yhydg3mQzqSYTA2PjC5qOAWmoKP5Y_0bATbsZufPK0tzQ8sU8j9QYHau8dQQm1uZDQoDX3kWOAPT-ziHUM2DMre9SnSjqTMqeaYvG9SQ6V4uuscvlfuR5aFOk1cinww2i_gs-VijZmaukzsJyyT3VSeLhD8ZB7VGkSY2Bb2D6-xkvXgY77wseYNjlFyXgzPvIXrVq1WFDPjmDjqXPEwMBQfjF7ZSNKE0HCVskqjbHtvX80JDf_zc1iz6ICAGB157falCoeCnywVoUB0rGIqN3zYWfVZtkM7621_yyLywtRNRpw; _ga_WC57KJ50ZZ=GS1.1.1695726326.6.0.1695726335.0.0.0; SIDCC=ACA-OxNJ19_E1Be1YCJbVrQti3IPW5CD-ZIAeFOSxejZPqkzT1LFm6mxClJsb1oq9HwLp-gJr58k; Secure-1PSIDCC=ACA-OxMJ5Fq27_qwVB5uHoOCHe_imvoJZc-VoDXso6oagrejGj8vN1OR04RlMn4am0jQdRKpR48-; __Secure-3PSIDCC=ACA-OxMGO5vk4KrKSymbgn4Su6O1jQndwpBOvK_0Pg8IMgly1NBpsOb1jf39nZwg0RLrQTU03Gg9

刚获取的,能用,一会就过期了,你看一下格式。

我是cookie失效啦,重新用chrome获取一下

重新获取未解决问题

2595001965 commented 1 year ago

同样的问题。

TobinF commented 9 months ago

使用这个cookies可解决 image