Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
RemSynch opened this issue May 3, 2024 · 2 comments

Comments

@RemSynch
Copy link

RemSynch commented May 3, 2024

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
Copy link

环境

- 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
Copy link
Author

RemSynch commented May 8, 2024

环境

- 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写的😋

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants