Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PlayFramework 2.4.6 error 413 Request Entity Too Large

Tags:

I am using PlayFramework 2.4.6, trying to upload a multipart file (size 18M) and the server returns the following error:

For request 'POST /api/myEndpoint' [Request Entity Too Large] 

I have looked around and tried the following with out success:

  1. play.http.parser.maxMemoryBuffer=2000000K
  2. parsers.MultipartFormData.maxLength=1024000K
  3. play.http.parser.maxDiskBuffer=2000000K
  4. Action.async(parse.anyContent(Some(1024*200L)))

And none of them solves the problem.

Here is the Stacktrace as well:

14:57:33.128 [New I/O worker #2] [error] -     p.c.server.netty.RequestBodyHandler - Exception caught in RequestBodyHandler java.nio.channels.ClosedChannelException: null at org.jboss.netty.channel.socket.nio.AbstractNioWorker.setInterestOps(AbstractNioWorker.java:506) [netty-3.10.4.Final.jar:na] at org.jboss.netty.channel.socket.nio.AbstractNioWorker$1.run(AbstractNioWorker.java:455) [netty-3.10.4.Final.jar:na] at org.jboss.netty.channel.socket.ChannelRunnableWrapper.run(ChannelRunnableWrapper.java:40) [netty-3.10.4.Final.jar:na] at org.jboss.netty.channel.socket.nio.AbstractNioSelector.processTaskQueue(AbstractNioSelector.java:391) [netty-3.10.4.Final.jar:na] at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:315) [netty-3.10.4.Final.jar:na] at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:89) [netty-3.10.4.Final.jar:na] at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178) [netty-3.10.4.Final.jar:na] at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108) [netty-3.10.4.Final.jar:na] at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42) [netty-3.10.4.Final.jar:na] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_65] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_65] at java.lang.Thread.run(Thread.java:745) [na:1.8.0_65] 
like image 339
Gleeb Avatar asked Mar 29 '16 12:03

Gleeb


People also ask

What is meant by 413 Request Entity Too Large?

What does “413 Request Entity Too Large” mean? A 413 HTTP error code occurs when the size of a client's request exceeds the server's file size limit. This typically happens when a client attempts to upload a large file to a web server, and the server responds with a 413 error to alert the client.

What is a 413 server error?

The HTTP 413 Payload Too Large response status code indicates that the request entity is larger than limits defined by server; the server might close the connection or return a Retry-After header field.


1 Answers

Solved the problem with this:

play.http.parser.maxDiskBuffer = 100MB  parsers.anyContent.maxLength = 100MB 
like image 143
Gleeb Avatar answered Nov 13 '22 16:11

Gleeb