2

I am following WebSockets Spark Tutorial (https://sparktutorials.github.io/2015/11/08/spark-websocket-chat) and I manage to successfully build & deploy this in heroku using free account(free dyno) with this tutorial (https://sparktutorials.github.io/2015/08/24/spark-heroku).

It works fine in localhost but in heroku I get this Application Error or Code=H10.

These are the Logs.

2016-10-03T01:56:27.735673+00:00 app[web.1]: [Thread-0] INFO >spark.embeddedserver.jetty.EmbeddedJettyServer - >> Listening on 0.0.0.0:4567 2016-10-03T01:56:27.737870+00:00 app[web.1]: [Thread-0] INFO org.eclipse.jetty.server.Server - jetty-9.3.z-SNAPSHOT 2016-10-03T01:56:27.787960+00:00 app[web.1]: [Thread-0] INFO org.eclipse.jetty.server.handler.ContextHandler - Started o.e.j.s.ServletContextHandler@39939950{/,null,AVAILABLE} 2016-10-03T01:56:27.804573+00:00 app[web.1]: [Thread-0] INFO org.eclipse.jetty.server.ServerConnector - Started ServerConnector@3d87d5f9{HTTP/1.1,[http/1.1]}{0.0.0.0:4567} 2016-10-03T01:56:27.804799+00:00 app[web.1]: [Thread-0] INFO org.eclipse.jetty.server.Server - Started @441ms 2016-10-03T01:57:55.846764+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 90 seconds of launch 2016-10-03T01:57:55.846764+00:00 heroku[web.1]: Stopping process with SIGKILL 2016-10-03T01:57:55.955110+00:00 heroku[web.1]: Process exited with status 137 2016-10-03T01:57:55.964711+00:00 heroku[web.1]: State changed from starting to crashed 2016-10-03T06:29:08.525497+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=chatroom-herroku-example.herokuapp.com request_id=d5c85d5e-8e8e-4f14-b2b1-f4522ac671dc fwd="125.60.156.205" dyno= connect= service= status=503 bytes= 2016-10-03T06:29:11.463550+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=chatroom-herroku-example.herokuapp.com request_id=b697c22b-1b0c-47cb-9b08-d809b7627802 fwd="125.60.156.205" dyno= connect= service= status=503 bytes= 2016-10-03T07:03:55.810509+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=chatroom-herroku-example.herokuapp.com request_id=e2bcd981-974d-442a-949f-a4d97d7c60c3 fwd="125.60.156.205" dyno= connect= service= status=503 bytes= 2016-10-03T07:03:57.067606+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=chatroom-herroku-example.herokuapp.com request_id=a9ff3396-225e-4901-a1ae-cf6357c2f89a fwd="125.60.156.205" dyno= connect= service= status=503 bytes=

KiE
  • 21
  • 1
  • 3
  • Have you configured your database? Have you hard coded your Port? if so, it should be `process.env.PORT`. Try running the application from console that might detail the failure cause. – Thamilhan Oct 03 '16 at 08:50

1 Answers1

6

It looks like a R10 Error Boot Timeout. The error occurs due to the application unable to reach an external resource, like a database.

I would double check your DB connection because this error is likely due to an improperly configured database connection.

Did you provision a database connection using Heroku's Add-on's? If not, you will have to provision a database to fix the error. mLab is a free option but there are many others. I'll try to walk you through an example of how to do this.

Navigate to your Heroku app's dashboard. Click on Resources. In the add-on search box, type in the database service you'd like to provision. If you choose mLab, it will take you to the mLab GUI. Your URI connection string is at the top of the screen. (You want to choose the one labeled "Driver". ) Click on the 'add a user' tab at the center-bottom part of the screen. Add a username and password. Save. After that, copy the URI connection string above, then navigate back to your dashboard. Click on Settings, reveal config vars. Now paste the URI connection string in the text box, then add in your newly created user credentials to replace the <username> and <password> fields. Copy the config variable MONGODB_URI. Next, on your command line, set or export the MONGODB_URI environment variable. Finally, in your application, navigate to where you start your server, then replace the connection to your local host's database with the MONGODB_URI e.g. process.env.MONGODB_URI. Next, Add, commit, push to master then to Heroku. The R10 error should be gone. If it's not, see the links below.

Try adding this Heroku Forward

What's in your procfile? Type this in there: web: bundle exec thin start -p $PORT

Also, see THIS stack overflow answer regarding R10 error solutions.

Community
  • 1
  • 1
govgo
  • 625
  • 6
  • 18