Jetty throws exception when creating a attachmentUrl to a video

Enonic version: 6.8.0
OS: OSX

I’m using the attachmentUrl in the portal lib creating a URL to a video like this:
<source src="[@attachmentUrl id=source._id /]" />

It works just as expected when visiting the site but in the log i get the following StackTrace :broken_heart:, am I doing it wrong or is it a bug in Enonic?
08:58:15.223 ERROR com.enonic.xp.web.jetty - Exception while processing request to /admin/portal/preview/draft/designmanualen/article/_/attachment/inline/4a943f1e-9667-4c45-bb50-95c50b42ab84:d9c01f602b6d2ded3ab28d9ae77b49385c5f8fbd/reklamefilm.m4v org.eclipse.jetty.io.EofException: null at org.eclipse.jetty.io.ChannelEndPoint.flush(ChannelEndPoint.java:197) ~[web-jetty-6.8.0.jar:6.8.0] at org.eclipse.jetty.io.WriteFlusher.flush(WriteFlusher.java:419) ~[web-jetty-6.8.0.jar:6.8.0] at org.eclipse.jetty.io.WriteFlusher.completeWrite(WriteFlusher.java:375) ~[web-jetty-6.8.0.jar:6.8.0] at org.eclipse.jetty.io.SelectChannelEndPoint$3.run(SelectChannelEndPoint.java:89) ~[web-jetty-6.8.0.jar:6.8.0] at org.eclipse.jetty.io.SelectChannelEndPoint.onSelected(SelectChannelEndPoint.java:177) ~[web-jetty-6.8.0.jar:6.8.0] at org.eclipse.jetty.io.ManagedSelector$SelectorProducer.processSelected(ManagedSelector.java:272) ~[web-jetty-6.8.0.jar:6.8.0] at org.eclipse.jetty.io.ManagedSelector$SelectorProducer.produce(ManagedSelector.java:170) ~[web-jetty-6.8.0.jar:6.8.0] at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:162) [web-jetty-6.8.0.jar:6.8.0] at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:147) [web-jetty-6.8.0.jar:6.8.0] at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654) [web-jetty-6.8.0.jar:6.8.0] at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572) [web-jetty-6.8.0.jar:6.8.0] at java.lang.Thread.run(Thread.java:745) [na:1.8.0_111] Caused by: java.io.IOException: Broken pipe at sun.nio.ch.FileDispatcherImpl.write0(Native Method) ~[na:1.8.0_111] at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:47) ~[na:1.8.0_111] at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:93) ~[na:1.8.0_111] at sun.nio.ch.IOUtil.write(IOUtil.java:65) ~[na:1.8.0_111] at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:471) ~[na:1.8.0_111] at org.eclipse.jetty.io.ChannelEndPoint.flush(ChannelEndPoint.java:175) ~[web-jetty-6.8.0.jar:6.8.0] ... 11 common frames omitted 08:58:15.224 WARN o.e.jetty.servlet.ServletHandler - /admin/portal/preview/draft/designmanualen/article/_/attachment/inline/4a943f1e-9667-4c45-bb50-95c50b42ab84:d9c01f602b6d2ded3ab28d9ae77b49385c5f8fbd/reklamefilm.m4v java.lang.IllegalStateException: Committed at org.eclipse.jetty.server.Response.resetBuffer(Response.java:1223) ~[web-jetty-6.8.0.jar:6.8.0] at javax.servlet.ServletResponseWrapper.resetBuffer(ServletResponseWrapper.java:241) ~[web-jetty-6.8.0.jar:6.8.0] at org.apache.felix.http.base.internal.dispatch.ServletResponseWrapper.sendError(ServletResponseWrapper.java:67) ~[web-jetty-6.8.0.jar:6.8.0] at org.apache.felix.http.base.internal.dispatch.ServletResponseWrapper.sendError(ServletResponseWrapper.java:61) ~[web-jetty-6.8.0.jar:6.8.0] at org.apache.felix.http.base.internal.dispatch.Dispatcher.dispatch(Dispatcher.java:133) ~[web-jetty-6.8.0.jar:6.8.0] at org.apache.felix.http.base.internal.DispatcherServlet.service(DispatcherServlet.java:61) ~[web-jetty-6.8.0.jar:6.8.0] at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) ~[web-jetty-6.8.0.jar:6.8.0] at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:821) ~[web-jetty-6.8.0.jar:6.8.0] at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:583) [web-jetty-6.8.0.jar:6.8.0] at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) [web-jetty-6.8.0.jar:6.8.0] at org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:437) [web-jetty-6.8.0.jar:6.8.0] at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226) [web-jetty-6.8.0.jar:6.8.0] at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1158) [web-jetty-6.8.0.jar:6.8.0] at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511) [web-jetty-6.8.0.jar:6.8.0] at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185) [web-jetty-6.8.0.jar:6.8.0] at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1090) [web-jetty-6.8.0.jar:6.8.0] at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) [web-jetty-6.8.0.jar:6.8.0] at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:119) [web-jetty-6.8.0.jar:6.8.0] at com.codahale.metrics.jetty9.InstrumentedHandler.handle(InstrumentedHandler.java:240) [metrics-jetty9-3.1.2.jar:3.1.2] at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:119) [web-jetty-6.8.0.jar:6.8.0] at org.eclipse.jetty.server.Server.handle(Server.java:517) [web-jetty-6.8.0.jar:6.8.0] at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:306) [web-jetty-6.8.0.jar:6.8.0] at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:242) [web-jetty-6.8.0.jar:6.8.0] at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:261) [web-jetty-6.8.0.jar:6.8.0] at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95) [web-jetty-6.8.0.jar:6.8.0] at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:75) [web-jetty-6.8.0.jar:6.8.0] at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:213) [web-jetty-6.8.0.jar:6.8.0] at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:147) [web-jetty-6.8.0.jar:6.8.0] at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654) [web-jetty-6.8.0.jar:6.8.0] at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572) [web-jetty-6.8.0.jar:6.8.0] at java.lang.Thread.run(Thread.java:745) [na:1.8.0_111] 08:58:15.225 WARN org.eclipse.jetty.server.HttpChannel - //localhost:8080/admin/portal/preview/draft/designmanualen/article/_/attachment/inline/4a943f1e-9667-4c45-bb50-95c50b42ab84:d9c01f602b6d2ded3ab28d9ae77b49385c5f8fbd/reklamefilm.m4v java.lang.IllegalStateException: Committed at org.eclipse.jetty.server.Response.resetBuffer(Response.java:1223) ~[web-jetty-6.8.0.jar:6.8.0] at javax.servlet.ServletResponseWrapper.resetBuffer(ServletResponseWrapper.java:241) ~[web-jetty-6.8.0.jar:6.8.0] at org.apache.felix.http.base.internal.dispatch.ServletResponseWrapper.sendError(ServletResponseWrapper.java:67) ~[web-jetty-6.8.0.jar:6.8.0] at org.apache.felix.http.base.internal.dispatch.ServletResponseWrapper.sendError(ServletResponseWrapper.java:61) ~[web-jetty-6.8.0.jar:6.8.0] at org.apache.felix.http.base.internal.dispatch.Dispatcher.dispatch(Dispatcher.java:133) ~[web-jetty-6.8.0.jar:6.8.0] at org.apache.felix.http.base.internal.DispatcherServlet.service(DispatcherServlet.java:61) ~[web-jetty-6.8.0.jar:6.8.0] at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) ~[web-jetty-6.8.0.jar:6.8.0] at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:821) ~[web-jetty-6.8.0.jar:6.8.0] at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:583) ~[web-jetty-6.8.0.jar:6.8.0] at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) ~[web-jetty-6.8.0.jar:6.8.0] at org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:437) ~[web-jetty-6.8.0.jar:6.8.0] at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226) ~[web-jetty-6.8.0.jar:6.8.0] at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1158) ~[web-jetty-6.8.0.jar:6.8.0] at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511) ~[web-jetty-6.8.0.jar:6.8.0] at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185) ~[web-jetty-6.8.0.jar:6.8.0] at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1090) ~[web-jetty-6.8.0.jar:6.8.0] at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) ~[web-jetty-6.8.0.jar:6.8.0] at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:119) ~[web-jetty-6.8.0.jar:6.8.0] at com.codahale.metrics.jetty9.InstrumentedHandler.handle(InstrumentedHandler.java:240) ~[metrics-jetty9-3.1.2.jar:3.1.2] at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:119) ~[web-jetty-6.8.0.jar:6.8.0] at org.eclipse.jetty.server.Server.handle(Server.java:517) ~[web-jetty-6.8.0.jar:6.8.0] at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:306) ~[web-jetty-6.8.0.jar:6.8.0] at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:242) [web-jetty-6.8.0.jar:6.8.0] at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:261) [web-jetty-6.8.0.jar:6.8.0] at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95) [web-jetty-6.8.0.jar:6.8.0] at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:75) [web-jetty-6.8.0.jar:6.8.0] at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:213) [web-jetty-6.8.0.jar:6.8.0] at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:147) [web-jetty-6.8.0.jar:6.8.0] at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654) [web-jetty-6.8.0.jar:6.8.0] at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572) [web-jetty-6.8.0.jar:6.8.0] at java.lang.Thread.run(Thread.java:745) [na:1.8.0_111]

I think this might be the browser making a request to the video URL and closing it directly. If I remember correctly they do this some times to find out the length of the file, and as soon as they get the length in the header they close the connection. That’s what causes the exception.

They do this for video/audio files to try to use byte serving and not loading the whole file at once.

If you look in the network tab on the browser there is probably 2 connections made to the .m4v file, the first one is closed immediately and then comes another one with a “Range” header.

So you are not doing anything wrong, but the exception may create some noise in the logs

3 Likes