内部流程已完成,未产生 1 个未完成元素的结果元素

Inner flow was completed without producing result elements for 1 outstanding elements

我有一个可用的游戏框架应用程序。我试图在应用程序上启用数据库进化支持。我通过添加以下设置

更改了 application.conf 文件
db.default.driver=org.postgresql.Driver
db.default.url="jdbc:postgresql://localhost:5432/scaladb"
db.default.username=scalauser
db.default.password=******
db.default.poolInitialSize=1
db.default.poolMaxSize=5
db.default.ConnectionTimeoutMillis=1000
play.evolutions.autoApply=true

数据库存在,我可以使用 sql -U scalauser -d scaladb

这样的命令连接到它

我将以下行添加到我的 AppLoader class 以设置数据库和 运行 迁移

val onStart = {
  applicationEvolutions
  DBs.setupAll()
}

applicationLifecycle.addStopHook{() => 
  DBs.closeAll()
  Future.successful(Unit)
}

但是现在当我 运行 我的 set run 申请时,我收到了这个神秘的错误消息,实际上没有任何意义。我什至不确定这是试图告诉我的框架

akka.http.impl.util.One2OneBidiFlow$OutputTruncationException: Inner flow was completed without producing result elements for 1 outstanding elements
at akka.http.impl.util.One2OneBidiFlow$OutputTruncationException$.apply(One2OneBidiFlow.scala:22)
at akka.http.impl.util.One2OneBidiFlow$OutputTruncationException$.apply(One2OneBidiFlow.scala:22)
at akka.http.impl.util.One2OneBidiFlow$One2OneBidi$$anon$$anon.onUpstreamFinish(One2OneBidiFlow.scala:97)
at akka.stream.impl.fusing.GraphInterpreter.processEvent(GraphInterpreter.scala:504)
at akka.stream.impl.fusing.GraphInterpreter.execute(GraphInterpreter.scala:378)
at akka.stream.impl.fusing.GraphInterpreterShell.runBatch(ActorGraphInterpreter.scala:588)
at akka.stream.impl.fusing.GraphInterpreterShell$AsyncInput.execute(ActorGraphInterpreter.scala:472)
at akka.stream.impl.fusing.GraphInterpreterShell.processEvent(ActorGraphInterpreter.scala:563)
at akka.stream.impl.fusing.ActorGraphInterpreter.akka$stream$impl$fusing$ActorGraphInterpreter$$processEvent(ActorGraphInterpreter.scala:

好的。我想到了。问题是配置文件格式不正确。行数

db.default.driver=org.postgresql.Driver
db.default.username=scalauser
db.default.password=******

应该写成

db.default.driver="org.postgresql.Driver"
db.default.username="scalauser"
db.default.password="password"

但有趣的是,应用程序 conf 文件丢失 " play framework 并没有抛出一个非常神秘的错误消息。

通过回答这个问题,我想突出显示对已接受答案的评论。

仔细检查application.conf文件中定义的环境变量。在我的例子中,我有一个未定义的环境变量。我的解决方案是在 kubernetes pod 配置 yaml 中添加定义。