AstrBot icon indicating copy to clipboard operation
AstrBot copied to clipboard

[Bug] 日志提示gemini key有问题

Open hellowlc opened this issue 1 year ago • 0 comments

发生了什么

[12:11:52] [Core] [ERRO] [method.llm_request:257]: Traceback (most recent call last): File "/AstrBot/astrbot/core/pipeline/process_stage/method/llm_request.py", line 196, in requesting final_llm_response = await provider.text_chat( File "/AstrBot/astrbot/core/provider/sources/gemini_source.py", line 500, in text_chat return await self._query(payloads, func_tool) File "/AstrBot/astrbot/core/provider/sources/gemini_source.py", line 362, in _query if result.candidates[0].finish_reason == types.FinishReason.RECITATION: TypeError: 'NoneType' object is not subscriptable

[12:11:53] [Core] [ERRO] [respond.stage:187]: Traceback (most recent call last): File "/AstrBot/astrbot/core/pipeline/respond/stage.py", line 185, in process await event.send(result) File "/AstrBot/astrbot/core/platform/sources/weixin_official_account/weixin_offacc_event.py", line 90, in send self.client.message.send_text(message_obj.sender.user_id, chunk) File "/usr/local/lib/python3.10/site-packages/wechatpy/client/api/message.py", line 51, in send_text return self._send_custom_message(data, account=account) File "/usr/local/lib/python3.10/site-packages/wechatpy/client/api/message.py", line 21, in _send_custom_message return self._post( File "/usr/local/lib/python3.10/site-packages/wechatpy/client/api/base.py", line 19, in _post return self._client.post(url, **kwargs) File "/usr/local/lib/python3.10/site-packages/wechatpy/client/base.py", line 182, in post return self._request( File "/usr/local/lib/python3.10/site-packages/wechatpy/client/base.py", line 101, in _request return self._handle_result( File "/usr/local/lib/python3.10/site-packages/wechatpy/client/base.py", line 158, in _handle_result raise WeChatClientException( wechatpy.exceptions.WeChatClientException: Error code: 48001, message: api unauthorized rid: 682d5289-44a2b704-333d8202

[12:11:53] [Core] [ERRO] [respond.stage:188]: 发送消息失败: Error code: 48001, message: api unauthorized rid: 682d5289-44a2b704-333d8202 chain: [Plain(type='Plain', text="AstrBot 请求失败。\n错误类型: TypeError\n错误信息: 'NoneType' object is not subscriptable", convert=True)]

如何复现?

key试过可以正常调用 服务器是美国的 也不存在代理问题 错误日志里还是有48001代码 难道不认证的公众号还是不行?

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

.11最新版本

操作系统

Linux

报错日志

wechatpy.exceptions.WeChatClientException: Error code: 48001, message: api unauthorized rid: 682d5289-44a2b704-333d8202

你愿意提交 PR 吗?

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

Code of Conduct

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

hellowlc avatar May 21 '25 04:05 hellowlc