首页 文章

Akka Http错误:InvalidContentLengthException

提问于
浏览
0

我们有一个Akka HTTP Server在AWS上提供一些scala JS内容 . 我们've noticed that after some time, the server starts throwing the error below in the logs and although, the certain URL'工作,但是在浏览器中出现 Failed to load resource: net::ERR_CONTENT_LENGTH_MISMATCH 错误时,某些文件无法正确下载 . 服务器日志如下所示(在所有实例中都是完全相同的错误):

[ERROR] [09/29/2016 21:29:22.150] [designer-actor-system-akka.actor.default-dispatcher-56831] [akka.actor.ActorSystemImpl(designer-actor-system)]传出响应流错误akka.http.scaladsl.model.InvalidContentLengthException:HTTP消息已声明Content-Length 997但实体数据流在akka.http.scaladsl.model.InvalidContentLengthException $ .apply(ErrorInfo.scala:50)atkka中减少了164个字节.http.impl.engine.rendering.RenderSupport $ checkContentLengthTransformer $$ anon $ 2.onUpstreamFinish(RenderSupport.scala:130)at akka.stream.impl.fusing.GraphInterpreter.processEvent(GraphInterpreter.scala:732)at akka.stream.impl .fusing.GraphInterpreter.execute(GraphInterpreter.scala:616)at akka.stream.impl.fusing.GraphInterpreterShell.runBatch(ActorGraphInterpreter.scala:471)at akka.stream.impl.fusing.GraphInterpreterShell.receive(ActorGraphInterpreter.scala:433) )at akka.stream.impl.fusing.ActorGraphInterpreter.akka $ stream $ impl $ fusing $ ActorGraphInterpreter $$ processEvent(Ac torGraphInterpreter.scala:603)at akka.stream.impl.fusing.ActorGraphInterpreter $$ anonfun $ receive $ 1.applyOrElse(ActorGraphInterpreter.scala:618)at akka.actor.Actor $ class.aroundReceive(Actor.scala:484)at akka atkka.ampl.fusing.ActorGraphInterpreter.aroundReceive(ActorGraphInterpreter.scala:529)at akka.actor.ActorCell.receiveMessage(ActorCell.scala:526)akka.actor.ActorCell.invoke(ActorCell.scala:495)at akka . dispatch.Mailbox.processMailbox(Mailbox.scala:257)at akka.dispatch.Mailbox.run(Mailbox.scala:224)at akka.dispatch.Mailbox.exec(Mailbox.scala:234)at scala.concurrent.forkjoin.ForkJoinTask .doExec(ForkJoinTask.java:260)scala.concurrent.forkjoin.ForkJoinPool $ WorkQueue.runTask(ForkJoinPool.java:1339)scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)scala.concurrent . forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)

我们正在运行Akka版本2.4.7和OpenJDK版本1.8.0_101-b13 . 如果我们重新启动Akka HTTP服务器,错误就会消失,但几小时后会再次出现 .

不确定是什么导致了这个问题 . 任何帮助将不胜感激 .

1 回答

  • 2

    我想我弄明白是什么导致了它 . 我们有一个自动部署过程,可以将HTML / CSS / Javascript文件部署到Akka服务器 . 似乎Akka服务器缓存内容大小,如果静态文件更新而不重新启动,它将给出 InvalidContentLengthException . 我们将重新启动作为部署过程的一部分包括在内,问题似乎已得到解决 .

相关问题