Sunny0101
Sunny0101

Reputation: 476

Heroku not showing my app at the end of the build

I have tried to use Heroku for my Continuous Intergration/Deployment on a project. I tried to follow a simple youtube video for uploading my node.JS application, I got right to the end where you click on view app via Heroku and I got a huge error log (as seen below), which I have no idea where to start debugging, can anyone shed some light?

Kayleighs-MBP:SOFT355-HangMan Kayleigh$ heroku logs --tail
 ›   Warning: heroku update available from 7.35.0 to 7.35.1.
2020-01-04T14:05:16.981790+00:00 app[api]: Enable Logplex by user [email protected]
2020-01-04T14:05:16.822338+00:00 app[api]: Release v1 created by user [email protected]
2020-01-04T14:05:16.981790+00:00 app[api]: Release v2 created by user [email protected]
2020-01-04T14:05:16.822338+00:00 app[api]: Initial release by user [email protected]
2020-01-04T14:18:46.000000+00:00 app[api]: Build started by user [email protected]
2020-01-04T14:19:18.680353+00:00 app[api]: Release v3 created by user [email protected]
2020-01-04T14:19:18.680353+00:00 app[api]: Deploy ff30f369 by user [email protected]
2020-01-04T14:19:18.695708+00:00 app[api]: Scaled to web@1:Free by user [email protected]
2020-01-04T14:19:20.000000+00:00 app[api]: Build succeeded
2020-01-04T14:19:22.117990+00:00 heroku[web.1]: Starting process with command `npm start`
2020-01-04T14:19:25.409179+00:00 app[web.1]: 
2020-01-04T14:19:25.409202+00:00 app[web.1]: > [email protected] start /app
2020-01-04T14:19:25.409204+00:00 app[web.1]: > node hangman-server.js
2020-01-04T14:19:25.409205+00:00 app[web.1]: 
2020-01-04T14:19:56.058173+00:00 app[web.1]: (node:23) UnhandledPromiseRejectionWarning: MongoTimeoutError: Server selection timed out after 30000 ms
2020-01-04T14:19:56.058209+00:00 app[web.1]: at Timeout._onTimeout (/app/node_modules/mongodb/lib/core/sdam/server_selection.js:308:9)
2020-01-04T14:19:56.058212+00:00 app[web.1]: at listOnTimeout (internal/timers.js:531:17)
2020-01-04T14:19:56.058214+00:00 app[web.1]: at processTimers (internal/timers.js:475:7)
2020-01-04T14:19:56.058439+00:00 app[web.1]: (node:23) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
2020-01-04T14:19:56.058598+00:00 app[web.1]: (node:23) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
2020-01-04T14:20:22.338538+00:00 heroku[web.1]: State changed from starting to crashed
2020-01-04T14:20:22.407927+00:00 heroku[web.1]: State changed from crashed to starting
2020-01-04T14:20:22.219187+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2020-01-04T14:20:22.219426+00:00 heroku[web.1]: Stopping process with SIGKILL
2020-01-04T14:20:22.325559+00:00 heroku[web.1]: Process exited with status 137
2020-01-04T14:20:25.204227+00:00 heroku[web.1]: Starting process with command `npm start`
2020-01-04T14:20:27.500815+00:00 app[web.1]: 
2020-01-04T14:20:27.500828+00:00 app[web.1]: > [email protected] start /app
2020-01-04T14:20:27.500830+00:00 app[web.1]: > node hangman-server.js
2020-01-04T14:20:27.500831+00:00 app[web.1]: 
2020-01-04T14:20:38.708137+00:00 heroku[router]: at=error code=H20 desc="App boot timeout" method=GET path="/" host=soft355-hangman-heroku.herokuapp.com request_id=15d0e236-af32-44ae-aae8-5a6cb342c260 fwd="90.200.113.10" dyno= connect= service= status=503 bytes= protocol=https
2020-01-04T14:20:57.961209+00:00 app[web.1]: (node:23) UnhandledPromiseRejectionWarning: MongoTimeoutError: Server selection timed out after 30000 ms
2020-01-04T14:20:57.961225+00:00 app[web.1]: at Timeout._onTimeout (/app/node_modules/mongodb/lib/core/sdam/server_selection.js:308:9)
2020-01-04T14:20:57.961228+00:00 app[web.1]: at listOnTimeout (internal/timers.js:531:17)
2020-01-04T14:20:57.961229+00:00 app[web.1]: at processTimers (internal/timers.js:475:7)
2020-01-04T14:20:57.961471+00:00 app[web.1]: (node:23) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
2020-01-04T14:20:57.961541+00:00 app[web.1]: (node:23) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
2020-01-04T14:21:25.939157+00:00 heroku[web.1]: State changed from starting to crashed
2020-01-04T14:21:25.848388+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2020-01-04T14:21:25.848490+00:00 heroku[web.1]: Stopping process with SIGKILL
2020-01-04T14:21:25.924978+00:00 heroku[web.1]: Process exited with status 137
2020-01-04T14:21:28.031213+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=soft355-hangman-heroku.herokuapp.com request_id=84fc9ea0-a4e9-4c65-8357-2ef4218f2054 fwd="90.200.113.10" dyno= connect= service= status=503 bytes= protocol=https
2020-01-04T14:21:28.670209+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=soft355-hangman-heroku.herokuapp.com request_id=ab8bb069-da76-4766-830f-e81a80dce8d3 fwd="90.200.113.10" dyno= connect= service= status=503 bytes= protocol=https
2020-01-04T14:21:29.277077+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=soft355-hangman-heroku.herokuapp.com request_id=66dbc233-0e2f-4c39-ba98-3cae75ae03b7 fwd="90.200.113.10" dyno= connect= service= status=503 bytes= protocol=https
2020-01-04T14:24:34.028234+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=soft355-hangman-heroku.herokuapp.com request_id=3fb5fa25-9a46-4b11-b5b0-5df9483c1eed fwd="90.200.113.10" dyno= connect= service= status=503 bytes= protocol=https

Upvotes: 0

Views: 60

Answers (1)

Beppe C
Beppe C

Reputation: 13903

Here is where you start:

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

Do you hardcode the port or use a default (8080)? Heroku runtime provides you with an Environment variable PORT, which is the one you should use to bind your application and accept incoming requests.

Upvotes: 1

Related Questions