usememos / memos

An open source, lightweight note-taking service. Easily capture and share your great thoughts.
https://usememos.com
MIT License
30.29k stars 2.27k forks source link

grpc:received message larger than #3893

Open Mask-Vip opened 2 weeks ago

Mask-Vip commented 2 weeks ago

Describe the bug

grpc: received message larger than max (185093557 vs. 104857600)

Steps to reproduce

  1. Set the maximum upload size to 1024m.
  2. Upload attachments over 100m
  3. Error report: GRPC: received message larger than max (185093557 vs. 104857600)

The version of Memos you're using.

0.22.5

Screenshots or additional context

screenshot-1725729626494 screenshot-1725729626494

RoccoSmit commented 2 weeks ago

Are you referring to the content length limit being set above? image From what I understand this setting is related to how much text can be added to a memo

The amount of data that can be sent per request is hardcoded to 100mb and does not have a setting to change it. Note: images uploaded are resources linked to memos so gets sent on a separate network request https://github.com/usememos/memos/blob/044d46c36d5c36608cfb8c9ad3d81d9f416532d0/server/router/api/v1/v1.go#L68

Mask-Vip commented 2 weeks ago

您指的是上面设置的内容长度限制吗? 图像据我了解,此设置与可以添加到备忘录中的文本数量有关

每个请求可发送的数据量被硬编码为 100mb,并且没有用于更改它的设置。注意:上传的图像是链接到 memo 的资源,因此会通过单独的网络请求发送

https://github.com/usememos/memos/blob/044d46c36d5c36608cfb8c9ad3d81d9f416532d0/server/router/api/v1/v1.go#L68

Thank you for answering my doubts. The maximum upload size I said is in Settings > > Storage Settings > > Maximum Upload Size, and the recommended size is 32mib. (At least in the Chinese version, it means to control the upload size) screenshot-1725826274082 screenshot-1725826274082

RoccoSmit commented 2 weeks ago

I believe this will still run into the same issue. The value set in the settings screen (2048mb) is used as input validation once the data gets to the server, the grpc limit (100mb) determines how much data you can send to the server so the request gets blocked before the input validation can run.

Not sure why the 2 values arent linked. Someone with more context will need to answer.