Akka-Http Entity Stream Truncation

1,425 views
Skip to first unread message

Michael Pisula

unread,
Jul 10, 2017, 3:01:00 AM7/10/17
to Akka User List
Hi guys,

Long time no see :-)

We seeing a strange exception in the logs of our new Akka Http app in production. The Exception is an EntityStreamException with the cause message "entity stream truncation". I could not find any helpful information regarding that exception here in the list or in the github issues. As far as I saw from the source code, it could point to a problem with header parsing, but I am not exactly sure what could cause the problem. Would be really grateful for a pointer.

Cheers,
Michael

johannes...@lightbend.com

unread,
Jul 10, 2017, 10:55:55 AM7/10/17
to Akka User List
Hi Michael,


On Monday, July 10, 2017 at 9:01:00 AM UTC+2, Michael Pisula wrote:
As far as I saw from the source code, it could point to a problem with header parsing, but I am not exactly sure what could cause the problem.

The place in the code is actually misleading, as it the error is only prepared at that place after all headers have been read. The error will only be reported, however, only later on if the connection is closed while there's still data expected on the connection. That will be the case if a `Content-Length` was specified but less than the given number of bytes was read before the connection was closed, or if `chunked` transfer encoding was used, if the connection was closed before the final empty chunk was sent.

You could set `akka.http.server.log-unencrypted-network-bytes = 1000` to see all data that was sent on the connection which might help with debugging the issue.

Michael Pisula

unread,
Jul 10, 2017, 12:08:29 PM7/10/17
to Akka User List
Hi Johannes,
perfect, thanks for the insight. I think we can work with that.

Cheers,
Michael

Dusan Stanojevic

unread,
Sep 14, 2017, 7:53:11 PM9/14/17
to Akka User List
Hi,

I saw this exception happen in production with Play 2.6.x but could not replicate it.
After reading your post I turned throttling on, made a request and killed the tab before it was done sending data and got the exception on localhost.

Thank you,
Dusan
Reply all
Reply to author
Forward
0 new messages