wechaty / python-wechaty

Python Wechaty is a Conversational RPA SDK for Chatbot Makers written in Python
https://wechaty.readthedocs.io/zh_CN/latest/
Apache License 2.0
1.66k stars 233 forks source link

[Bug]: 发送大小为29.9MB的文件报错 'Received message larger than max (41907119 vs. 4194304) #425

Open RemSynch opened 7 months ago

RemSynch commented 7 months ago

Environment

- wechaty:0.10.7
- wechaty-puppet: 0.4.23
- wechaty-puppet-service: 0.8.10
- wechaty-plugin-contrib: 
- token type: i think i am using PuppetPuppeteer,but i dn know the type
- the version of wechaty docker container: my server was started with `wechaty gateway --token $WECHATY_PUPPET_SERVICE_TOKEN --port $WECHATY_PUPPET_SERVER_PORT --puppet wechaty-puppet-wechat`
the package.json on my server:

{
  "dependencies": {
    "wechaty": "^1.20.2",
    "wechaty-puppet-wechat": "^1.18.4"
  }
}

### Description

```Markdown
发送文件的代码为:
`file = FileBox.from_file(data)`
发送的文件是一个flac的音频文件,大小为29.9MB。
报错日志:
`Wechaty - ERROR - internal error <(<Status.RESOURCE_EXHAUSTED: 8>, 'Received message larger than max (43183569 vs. 4194304)', None)>`

经查是因为`grpc默认消息体大小是4M,大于4M则会抛出该异常`
但是我没有找到应该如何修改wechaty的客户端与服务端的grpc参数。

Minimum reproducible code

file = FileBox.from_file(data)

aqpmzngldh commented 7 months ago

环境

- wechaty:0.10.7
- wechaty-puppet: 0.4.23
- wechaty-puppet-service: 0.8.10
- wechaty-plugin-contrib: 
- token type: i think i am using PuppetPuppeteer,but i dn know the type
- the version of wechaty docker container: my server was started with `wechaty gateway --token $WECHATY_PUPPET_SERVICE_TOKEN --port $WECHATY_PUPPET_SERVER_PORT --puppet wechaty-puppet-wechat`
the package.json on my server:

{
  "dependencies": {
    "wechaty": "^1.20.2",
    "wechaty-puppet-wechat": "^1.18.4"
  }
}

### Description

```Markdown
发送文件的代码为:
`file = FileBox.from_file(data)`
发送的文件是一个flac的音频文件,大小为29.9MB。
报错日志:
`Wechaty - ERROR - internal error <(<Status.RESOURCE_EXHAUSTED: 8>, 'Received message larger than max (43183569 vs. 4194304)', None)>`

经查是因为`grpc默认消息体大小是4M,大于4M则会抛出该异常`
但是我没有找到应该如何修改wechaty的客户端与服务端的grpc参数。

最小可重现代码

file = FileBox.from_file(data)

哪里都有你啊

RemSynch commented 7 months ago

环境

- wechaty:0.10.7
- wechaty-puppet: 0.4.23
- wechaty-puppet-service: 0.8.10
- wechaty-plugin-contrib: 
- token type: i think i am using PuppetPuppeteer,but i dn know the type
- the version of wechaty docker container: my server was started with `wechaty gateway --token $WECHATY_PUPPET_SERVICE_TOKEN --port $WECHATY_PUPPET_SERVER_PORT --puppet wechaty-puppet-wechat`
the package.json on my server:

{
  "dependencies": {
    "wechaty": "^1.20.2",
    "wechaty-puppet-wechat": "^1.18.4"
  }
}

### Description

```Markdown
发送文件的代码为:
`file = FileBox.from_file(data)`
发送的文件是一个flac的音频文件,大小为29.9MB。
报错日志:
`Wechaty - ERROR - internal error <(<Status.RESOURCE_EXHAUSTED: 8>, 'Received message larger than max (43183569 vs. 4194304)', None)>`

经查是因为`grpc默认消息体大小是4M,大于4M则会抛出该异常`
但是我没有找到应该如何修改wechaty的客户端与服务端的grpc参数。

最小可重现代码

file = FileBox.from_file(data)

哪里都有你啊

这是因为我的项目就是用py写的😋