omgnetwork / elixir-omg

OMG-Network repository of Watcher and Watcher Info
https://omg.network
Apache License 2.0
211 stars 59 forks source link

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 4 years ago

sentry-io[bot] commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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

arthurk commented 4 years ago

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