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

Plugin returns "received message larger than max" error when sending payloads greater than 4194304 bytes #4957

Closed
broamski opened this issue Jul 19, 2018 · 6 comments · Fixed by #4958

Comments

@broamski
Copy link
Contributor

Describe the bug
When using a custom vault plugin and sending a payload greater than 4194304 bytes, the operation ends in failure due to the grpc default max receive message size of 1024 * 1024 * 4. This option does not appear to be configurable, so servicing larger requests is not possible.

To Reproduce
Steps to reproduce the behavior:

  1. Write payload to plugin vault write customplugin/action @large_28mb_payload
  2. See error: [ERROR] core: failed to run existence check: error="rpc error: code = ResourceExhausted desc = grpc: received message larger than max (28793489 vs. 4194304)"

Expected behavior
In plugin.Server, set the max receive size to a value similar to or the same as the max send size, which would align to the changes made for #4843.

Alternately, allow both the send and receive values to be configurable via plugin.ServeOpts.

Environment:

  • Vault Server Version (retrieve with vault status): 0.10.3
  • Vault CLI Version (retrieve with vault version): Vault v0.10.3 ('c69ae68faf2bf7fc1d78e3ec62655696a07454c7')
  • Server Operating System/Architecture: darwin, linux

Vault server configuration file(s): Running in -dev mode.

Additional context
This impacts the ability to perform cryptographic operations (similar to that of transit engine) on larger binary files.

grpc declares these constant values as:

defaultServerMaxReceiveMessageSize = 1024 * 1024 * 4
defaultServerMaxSendMessageSize    = math.MaxInt32
@jefferai
Copy link
Member

Would be super cool if you can test #4959

@jefferai
Copy link
Member

I mean, #4958

@broamski
Copy link
Contributor Author

Sure thing! I'll test this first thing tomorrow!

@broamski
Copy link
Contributor Author

Also, thanks for the fast response!

@broamski
Copy link
Contributor Author

I can confirm that this change does indeed allow payload sizes greater than 4194304 bytes to be successfully processed by a plugin. Thanks!

@jefferai
Copy link
Member

Great!

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

Successfully merging a pull request may close this issue.

2 participants