AstrBot icon indicating copy to clipboard operation
AstrBot copied to clipboard

[Bug]Error: 400, message

Open TLS-802 opened this issue 8 months ago • 2 comments

发生了什么

调用函数工具可能导致400错误

如何复现?

AstrBot3.5.4时是正常的 Image

AstrBot 版本、部署方式(如 Windows Docker Desktop 部署)、使用的提供商、使用的消息平台适配器

AstrBot:3.5.5 Linux Docker部署 提供商:硅基流动 deepseek 消息平台:Gewe

操作系统

Linux

报错日志

[06:58:53] [Core] [INFO] [core.event_bus:50]: [webchat] Zxr112553438/Zxr112553438: /今日新闻
[06:58:53] [Core] [INFO] [respond.stage:211]: AstrBot -> Zxr112553438/Zxr112553438: [引用消息] 正在获取今日新闻...
[06:58:54] [Core] [ERRO] [respond.stage:208]: Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/aiohttp/client_proto.py", line 92, in connection_lost uncompleted = self._parser.feed_eof() File "aiohttp/_http_parser.pyx", line 508, in aiohttp._http_parser.HttpParser.feed_eof aiohttp.http_exceptions.TransferEncodingError: 400, message: Not enough data for satisfy transfer length header.

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/AstrBot/astrbot/core/pipeline/respond/stage.py", line 206, in process await event.send(result) File "/AstrBot/astrbot/core/platform/sources/webchat/webchat_event.py", line 98, in send await WebChatMessageEvent._send(message, session_id=self.session_id) File "/AstrBot/astrbot/core/platform/sources/webchat/webchat_event.py", line 54, in _send await download_image_by_url(comp.file, path=path) File "/AstrBot/astrbot/core/utils/io.py", line 118, in download_image_by_url raise e File "/AstrBot/astrbot/core/utils/io.py", line 104, in download_image_by_url f.write(await resp.read()) File "/usr/local/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 1218, in read self._body = await self.content.read() File "/usr/local/lib/python3.10/site-packages/aiohttp/streams.py", line 418, in read block = await self.readany() File "/usr/local/lib/python3.10/site-packages/aiohttp/streams.py", line 440, in readany await self._wait("readany") File "/usr/local/lib/python3.10/site-packages/aiohttp/streams.py", line 347, in _wait await waiter aiohttp.client_exceptions.ClientPayloadError: Response payload is not completed: <TransferEncodingError: 400, message='Not enough data for satisfy transfer length header.'>

[06:58:54] [Core] [ERRO] [respond.stage:209]: 发送消息失败: Response payload is not completed: <TransferEncodingError: 400, message='Not enough data for satisfy transfer length header.'> chain: [Reply(type='Reply', id='5791fb7d-5ad8-467d-a0fe-a83783eccbe6', chain=[], sender_id=0, sender_nickname='', time=0, message_str='', sender_str='', text='', qq=0, seq=0), Image(type='Image', file='https://v.api.aa1.cn/api/60s-v3/', subType=0, url='', cache=True, id=40000, c=2, path='', file_unique='')]

你愿意提交 PR 吗?

  • [x] 是的,我愿意提交 PR!

Code of Conduct

  • [x] 我已阅读并同意遵守该项目的 行为准则

TLS-802 avatar Apr 29 '25 07:04 TLS-802