【问题标题】:Akka app to Heroku getting error: Web process failed to bind to $PORTHeroku 的 Akka 应用程序出现错误:Web 进程无法绑定到 $PORT
【发布时间】:2019-09-02 03:06:35
【问题描述】:

尝试将我的 Akka 应用程序部署到 Heroku

在我的代码中:

val httpPort = Properties.envOrElse("PORT", "8080").toInt
val serverBinding: Future[Http.ServerBinding] = Http().bindAndHandle(routes,
"localhost", httpPort)

在 Procfile 我有:

web: target/universal/stage/bin/hello-world -Dhttp.port=${PORT}

但我仍然进入日志:

错误 R10(启动超时)-> Web 进程在启动后 60 秒内未能绑定到 $PORT

  2019-04-11T11:22:30.239015+00:00 heroku[web.1]: Starting process with 
  command `target/universal/stage/bin/hello-world -Dhttp.port=${PORT}`
  2019-04-11T11:22:32.322727+00:00 app[web.1]: Setting JAVA_TOOL_OPTIONS 
  defaults based on dyno size. Custom settings will override them.
  2019-04-11T11:22:32.447725+00:00 app[web.1]: Picked up JAVA_TOOL_OPTIONS: - 
  Xmx300m -Xss512k -XX:CICompilerCount=2 -Dfile.encoding=UTF-8
  2019-04-11T11:22:35.729346+00:00 app[web.1]: Server online at 
  http://127.0.0.1:19702/
  2019-04-11T11:23:30.413620+00:00 heroku[web.1]: State changed from starting 
  to crashed
  2019-04-11T11:23:30.306939+00:00 heroku[web.1]: **Error R10 (Boot timeout) -> 
  Web process failed to bind to $PORT within 60 seconds of launch**
  2019-04-11T11:23:30.307058+00:00 heroku[web.1]: Stopping process with SIGKILL
  2019-04-11T11:23:30.395435+00:00 heroku[web.1]: Process exited with status 
  137
  2019-04-11T11:23:31.907600+00:00 heroku[router]: at=error code=H10 desc="App 
  crashed" method=GET path="/" host=word-list-app.herokuapp.com 
  request_id=b1d988e1-f53a-4409-9546-75404a9fcd5c fwd="94.199.129.189" dyno= 
  connect= service= status=503 bytes= protocol=https

【问题讨论】:

    标签: scala heroku akka


    【解决方案1】:

    您应该将localhost 替换为0.0.0.0

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-06-10
    • 2020-02-10
    • 1970-01-01
    • 1970-01-01
    • 2013-03-19
    • 2021-09-17
    相关资源
    最近更新 更多