[2.3.7-java] ClosedChannelException - not sure what's causing it

1,458 views
Skip to first unread message

Aaron Cohn

unread,
Jan 7, 2015, 2:20:24 AM1/7/15
to play-fr...@googlegroups.com
I'm getting the following exception while running my app in production on an EC2 server, and I don't understand what's causing it. The error happens infrequently, maybe once or twice a day, or every few days. It doesn't seem to depend on application usage. I have logging set up to report clients using the application, and so far I've seen plenty of these exceptions with no client usage in between. Any idea what's causing it and how to deal with it?

I'm running Play 2.3.7, Java 1.8.0_25, Amazon Linux AMI 2014.09

Exception caught in RequestBodyHandler
java.nio.channels.ClosedChannelException: null
        at org.jboss.netty.channel.socket.nio.AbstractNioWorker.cleanUpWriteBuffer(AbstractNioWorker.java:433) ~[io.netty.netty-3.9.2.Final.jar:na]
        at org.jboss.netty.channel.socket.nio.AbstractNioWorker.close(AbstractNioWorker.java:373) ~[io.netty.netty-3.9.2.Final.jar:na]
        at org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.handleAcceptedSocket(NioServerSocketPipelineSink.java:81) ~[io.netty.netty-3.9.2.Final.jar:na]
        at org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.eventSunk(NioServerSocketPipelineSink.java:36) ~[io.netty.netty-3.9.2.Final.jar:na]
        at org.jboss.netty.handler.codec.oneone.OneToOneEncoder.handleDownstream(OneToOneEncoder.java:54) ~[io.netty.netty-3.9.2.Final.jar:na]
        at com.typesafe.netty.http.pipelining.HttpPipeliningHandler.handleDownstream(HttpPipeliningHandler.java:88) ~[com.typesafe.netty.netty-http-pipelining-1.1.2.jar:na]
        at play.core.server.netty.NettyResultStreamer$$anonfun$sendResult$1.apply(NettyResultStreamer.scala:84) ~[com.typesafe.play.play_2.11-2.3.1.jar:2.3.1]
        at play.core.server.netty.NettyResultStreamer$$anonfun$sendResult$1.apply(NettyResultStreamer.scala:76) ~[com.typesafe.play.play_2.11-2.3.1.jar:2.3.1]
        at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32) ~[org.scala-lang.scala-library-2.11.1.jar:na]
        at play.api.libs.iteratee.Execution$trampoline$.execute(Execution.scala:46) ~[com.typesafe.play.play-iteratees_2.11-2.3.1.jar:2.3.1]
        at scala.concurrent.impl.CallbackRunnable.executeWithValue(Promise.scala:40) ~[org.scala-lang.scala-library-2.11.1.jar:na]
        at scala.concurrent.impl.Promise$DefaultPromise.tryComplete(Promise.scala:248) ~[org.scala-lang.scala-library-2.11.1.jar:na]
        at scala.concurrent.Promise$class.complete(Promise.scala:55) ~[org.scala-lang.scala-library-2.11.1.jar:na]
        at scala.concurrent.impl.Promise$DefaultPromise.complete(Promise.scala:153) ~[org.scala-lang.scala-library-2.11.1.jar:na]
        at scala.concurrent.Promise$class.success(Promise.scala:89) ~[org.scala-lang.scala-library-2.11.1.jar:na]
        at scala.concurrent.impl.Promise$DefaultPromise.success(Promise.scala:153) ~[org.scala-lang.scala-library-2.11.1.jar:na]
        at play.core.server.netty.NettyFuture$ToScala$$anon$1.operationComplete(NettyFuture.scala:26) ~[com.typesafe.play.play_2.11-2.3.1.jar:2.3.1]
        at org.jboss.netty.channel.DefaultChannelFuture.notifyListener(DefaultChannelFuture.java:427) ~[io.netty.netty-3.9.2.Final.jar:na]
        at org.jboss.netty.channel.DefaultChannelFuture.notifyListeners(DefaultChannelFuture.java:413) ~[io.netty.netty-3.9.2.Final.jar:na]
        at org.jboss.netty.channel.DefaultChannelFuture.setSuccess(DefaultChannelFuture.java:362) ~[io.netty.netty-3.9.2.Final.jar:na]
        at org.jboss.netty.channel.socket.nio.AbstractNioWorker.write0(AbstractNioWorker.java:220) ~[io.netty.netty-3.9.2.Final.jar:na]
        at org.jboss.netty.channel.socket.nio.AbstractNioWorker.writeFromTaskLoop(AbstractNioWorker.java:151) ~[io.netty.netty-3.9.2.Final.jar:na]
        at org.jboss.netty.channel.socket.nio.AbstractNioChannel$WriteTask.run(AbstractNioChannel.java:335) ~[io.netty.netty-3.9.2.Final.jar:na]
        at org.jboss.netty.channel.socket.nio.AbstractNioSelector.processTaskQueue(AbstractNioSelector.java:372) ~[io.netty.netty-3.9.2.Final.jar:na]
        at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:296) ~[io.netty.netty-3.9.2.Final.jar:na]
        at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:89) ~[io.netty.netty-3.9.2.Final.jar:na]
        at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178) ~[io.netty.netty-3.9.2.Final.jar:na]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_25]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_25]
        at java.lang.Thread.run(Thread.java:745) [na:1.8.0_25]

James Roper

unread,
Jan 7, 2015, 7:13:08 PM1/7/15
to play-framework
It just means that a connection was closed while a request body was being uploaded.  This is quite normal on the internet, it could be caused by all sorts of things, for example, maybe the user closed their browser tab mid way through submitting a form, or maybe it's a mobile user with a dodgy connection that only managed to upload half the request before dropping out.

We should probably not log these errors at error - a while ago we started logging a lot more errors that were previously ignored, we've gradually being finding the places where the errors should be considered normal and making them log at a lower debug level than normal.

--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
James Roper
Software Engineer

Typesafe – Build reactive apps!
Twitter: @jroper

Aaron Cohn

unread,
Jan 7, 2015, 8:26:22 PM1/7/15
to play-fr...@googlegroups.com
Thanks so much for the helpful reply, James. Now that I know I can safely ignore the error, I will try to do so in my log settings.

-Aaron


On Wednesday, January 7, 2015 4:13:08 PM UTC-8, James Roper wrote:
It just means that a connection was closed while a request body was being uploaded.  This is quite normal on the internet, it could be caused by all sorts of things, for example, maybe the user closed their browser tab mid way through submitting a form, or maybe it's a mobile user with a dodgy connection that only managed to upload half the request before dropping out.

We should probably not log these errors at error - a while ago we started logging a lot more errors that were previously ignored, we've gradually being finding the places where the errors should be considered normal and making them log at a lower debug level than normal.

tsuyoshi yoshizawa

unread,
Aug 18, 2015, 3:29:14 AM8/18/15
to play-framework
Play team, do you have any plan for this?

Play 2.4 still have same problem, the log is noise in day-to-day operations.
I hope the log level will be changed to debug.

This issue was same report, but you said we need to discuss more on here.
Reply all
Reply to author
Forward
0 new messages