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

Plug.Parsers.RequestTooLargeError: the request is too large. If you are willing to process larger requests, please give a :length to... #1659

Open
sentry-io bot opened this issue Jul 22, 2020 · 4 comments

Comments

@sentry-io
Copy link

sentry-io bot commented Jul 22, 2020

Sentry Issue: ELIXIR-OMG-6M

Plug.Parsers.RequestTooLargeError: the request is too large. If you are willing to process larger requests, please give a :length to Plug.Parsers
  File "lib/plug/parsers.ex", line 322, in Plug.Parsers.reduce/8
  File "lib/web/endpoint.ex", line 15, in OMG.WatcherRPC.Web.Endpoint.plug_builder_call/2
  File "lib/web/endpoint.ex", line 15, in OMG.WatcherRPC.Web.Endpoint."call (overridable 3)"/2
  File "lib/web/endpoint.ex", line 15, in OMG.WatcherRPC.Web.Endpoint.call/2
  File "lib/plug/cowboy/handler.ex", line 18, in Plug.Adapters.Cowboy.Handler.upgrade/4
...
(1 additional frame(s) were not displayed)

(Plug.Parsers.RequestTooLargeError) the request is too large. If you are willing to process larger requests, please give a :length to Plug.Parsers
@arthurk
Copy link
Contributor

arthurk commented Jul 22, 2020

To reproduce:

dd if=/dev/urandom of=output.dat  bs=1m  count=100
curl -v --request POST 'https://watcher-info/status.get' -d @output.dat -H "Content-Type: application/json"

@ayrat555 ayrat555 assigned ayrat555 and unassigned ayrat555 Jul 29, 2020
@ayrat555
Copy link
Contributor

ayrat555 commented Jul 29, 2020

it seems it works as expected. the request size can be increased by passing larger length to Plug.Parsers plug

moreover, status.get does not accept any parameters

@ayrat555
Copy link
Contributor

Another option is to disable Plug.Parsers for status.get

@arthurk
Copy link
Contributor

arthurk commented Jul 30, 2020

I think I was just not expecting this to be an exception. If someone uploads a too-large file at 3AM it would page the on-call engineer which is not really necessary

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

3 participants