jakstack
jakstack

Reputation: 2205

Akka app to Heroku getting error: Web process failed to bind to $PORT

Trying to deploy my Akka application to Heroku

In code I have:

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

In Procfile I have:

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

But I still get in logs:

Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch

  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

Upvotes: 0

Views: 311

Answers (1)

Gal Naor
Gal Naor

Reputation: 2397

You should replace localhost with 0.0.0.0.

Upvotes: 6

Related Questions