AstrBot icon indicating copy to clipboard operation
AstrBot copied to clipboard

[Bug] Gewechat 的api调用报错 不知是Gewechat 那边已经不更新的问题 还是自己的配置的问题

Open jian19941201 opened this issue 1 year ago • 6 comments

发生了什么

[2025-02-25 15:52:00 +0800] [30556] [INFO] Running on http://0.0.0.0:6185 (CTRL + C to quit) [15:52:00] [INFO ] [client.py:65]: 获取到 Gewechat Token: b60a11c2b613448f849860b0a3d38bc3 [15:52:00] [ERROR] [manager.py:75]: ------- 任务 gwchat_platform 发生错误: 获取二维码失败: {'ret': 500, 'msg': '创建设备失败', 'data': {'code': '-1', 'msg': 'unexpected EOF'}} [15:52:00] [ERROR] [manager.py:77]: | Traceback (most recent call last): [15:52:00] [ERROR] [manager.py:77]: | File "D:\work\AstrBot-master\AstrBot-master\astrbot\core\platform\manager.py", line 70, in _task_wrapper [15:52:00] [ERROR] [manager.py:77]: | await task [15:52:00] [ERROR] [manager.py:77]: | File "D:\work\AstrBot-master\AstrBot-master\astrbot\core\platform\sources\gewechat\gewechat_platform_adapter.py", line 75, in _run [15:52:00] [ERROR] [manager.py:77]: | await self.client.login() [15:52:00] [ERROR] [manager.py:77]: | File "D:\work\AstrBot-master\AstrBot-master\astrbot\core\platform\sources\gewechat\client.py", line 295, in login [15:52:00] [ERROR] [manager.py:77]: | raise Exception(f"获取二维码失败: {json_blob}") [15:52:00] [ERROR] [manager.py:77]: | Exception: 获取二维码失败: {'ret': 500, 'msg': '创建设备失败', 'data': {'code': '-1', 'msg': 'unexpected EOF'}} [15:52:00] [ERROR] [manager.py:77]: |
[15:52:00] [ERROR] [manager.py:78]: -------

如何复现?

使用win11 dockerdesktop
1、拉取镜像

docker pull registry.cn-hangzhou.aliyuncs.com/gewe/gewe:latest

docker tag registry.cn-hangzhou.aliyuncs.com/gewe/gewe gewe 2、运行镜像容器

mkdir -p /root/temp docker run -itd -v /root/temp:/root/temp -p 2531:2531 -p 2532:2532 --privileged=true --name=gewe gewe /usr/sbin/init 端口配置跟教程

AstrBot 版本与部署方式

ide 直接运行最新版本 项目

操作系统

Windows

额外信息

Image

你愿意提交 PR 吗?

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

Code of Conduct

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

jian19941201 avatar Feb 25 '25 07:02 jian19941201

已经解决二维码的错误的问题 是使用了代理网络的原因 扫码登录之后 出现新的错误 [16:11:51] [INFO ] [client.py:349]: 绿泡泡平台登录成功: 小美人 [16:11:51] [INFO ] [client.py:360]: 已保存 APPID: [2025-02-25 16:11:51 +0800] [30436] [INFO] Running on http://0.0.0.0:11451 (CTRL + C to quit) [16:11:51] [INFO ] [client.py:210]: 设置回调,请等待... [16:11:54] [INFO ] [client.py:222]: 设置回调结果: {'ret': 500, 'msg': 'http://localhost:11451/astrbot-gewechat/callback push msg err'} Exception in thread Thread-1 (run): Traceback (most recent call last): File "D:\Anaconda3\envs\AstrBot\lib\threading.py", line 1016, in _bootstrap_inner self.run() File "D:\Anaconda3\envs\AstrBot\lib\threading.py", line 953, in run self._target(*self._args, **self._kwargs) File "D:\Anaconda3\envs\AstrBot\lib\asyncio\runners.py", line 44, in run return loop.run_until_complete(main) File "D:\Anaconda3\envs\AstrBot\lib\asyncio\base_events.py", line 649, in run_until_complete return future.result() File "D:\work\AstrBot-master\AstrBot-master\astrbot\core\platform\sources\gewechat\client.py", line 224, in _set_callback_url raise Exception(f"设置回调失败: {json_blob}") Exception: 设置回调失败: {'ret': 500, 'msg': 'http://localhost:11451/astrbot-gewechat/callback push msg err'}

jian19941201 avatar Feb 25 '25 08:02 jian19941201

您好,这个应该是配置问题。host不要填写localhost,请填写局域网ip或者 host.docker.internal

Soulter avatar Feb 26 '25 16:02 Soulter

host.docker.internal

Image 这里使用host.docker.internal 还是报错了

tonysun03 avatar Mar 06 '25 06:03 tonysun03

Exception in thread Thread-1 (run): Traceback (most recent call last): File "/usr/local/lib/python3.10/threading.py", line 1016, in _bootstrap_inner self.run() File "/usr/local/lib/python3.10/threading.py", line 953, in run self._target(*self._args, **self._kwargs) File "/usr/local/lib/python3.10/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "/usr/local/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete return future.result() File "/AstrBot/astrbot/core/platform/sources/gewechat/client.py", line 255, in _set_callback_url raise Exception(f"设置回调失败: {json_blob}") Exception: 设置回调失败: {'ret': 500, 'msg': 'http://host.docker.internal:11451/astrbot-gewechat/callback push msg err'}

设置回调失败诶

SonyaCCC avatar Mar 06 '25 10:03 SonyaCCC

@SonyaCCC @tonysun03 请参考文档 Image

Soulter avatar Mar 13 '25 13:03 Soulter

找到容器astrbot的网络 astrbot_astrbot_network | 172.18.0.3 | 172.18.0.1

Image

MUxiaokalami avatar Apr 22 '25 01:04 MUxiaokalami