Heroku deployment not working with postgresql api - node.js

I am working on a nodejs api found on https://www.taniarascia.com/node-express-postgresql-heroku/
it uses postgresql so it requires you to download the postgresql add-on to your app on heroku witch I did, but when I open the app it says cannot get / like expected but I go to the /books and it gives me the heroku error. When I do:
heroku logs -t -a node-api-with-books
it gives me this error:
2021-03-03T03:25:31.515099+00:00 app[web.1]: code: 'ECONNREFUSED',
2021-03-03T03:25:31.515099+00:00 app[web.1]: syscall: 'connect',
2021-03-03T03:25:31.515099+00:00 app[web.1]: address: '127.0.0.1',
2021-03-03T03:25:31.515100+00:00 app[web.1]: port: 5432
2021-03-03T03:25:31.515100+00:00 app[web.1]: }
2021-03-03T03:25:31.542497+00:00 heroku[router]: at=error code=H13 desc="Connection closed without response" method=GET path="/books" host=node-api-with-books.herokuapp.com request_id=83db8d38-c206-484a-8bca-a273ed8be8bd fwd="66.7.125.54" dyno=web.1 connect=5002ms service=95ms status=503 bytes=0 protocol=https
2021-03-03T03:25:31.578446+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2021-03-03T03:25:31.579040+00:00 app[web.1]: npm ERR! errno 1
2021-03-03T03:25:31.653173+00:00 app[web.1]: npm ERR! working-rest-api#1.0.0 start: `node index.js`
2021-03-03T03:25:31.653743+00:00 app[web.1]: npm ERR! Exit status 1
2021-03-03T03:25:31.656417+00:00 app[web.1]: npm ERR!
2021-03-03T03:25:31.656729+00:00 app[web.1]: npm ERR! Failed at the working-rest-api#1.0.0 start script.
2021-03-03T03:25:31.657018+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2021-03-03T03:25:31.693198+00:00 app[web.1]:
2021-03-03T03:25:31.700905+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2021-03-03T03:25:31.701084+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2021-03-03T03_25_31_668Z-debug.log
2021-03-03T03:25:31.868076+00:00 heroku[web.1]: Process exited with status 1
2021-03-03T03:25:32.005535+00:00 heroku[web.1]: State changed from up to crashed
2021-03-03T03:25:32.847159+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=node-api-with-books.herokuapp.com request_id=d669a8bb-5c76-4007-8e20-2323df702196 fwd="66.7.125.54" dyno=web.1 connect=1ms service= status=503 bytes= protocol=https
2021-03-03T03:57:13.968272+00:00 heroku[web.1]: State changed from crashed to starting
2021-03-03T03:57:19.191432+00:00 heroku[web.1]: Starting process with command `npm start`
2021-03-03T03:57:23.003539+00:00 app[web.1]:
2021-03-03T03:57:23.003564+00:00 app[web.1]: > working-rest-api#1.0.0 start /app
2021-03-03T03:57:23.003565+00:00 app[web.1]: > node index.js
2021-03-03T03:57:23.003565+00:00 app[web.1]:
2021-03-03T03:57:23.514091+00:00 app[web.1]: Server listening
2021-03-03T03:57:23.596725+00:00 heroku[web.1]: State changed from starting to up
2021-03-03T04:31:59.242314+00:00 heroku[web.1]: Idling
2021-03-03T04:31:59.270196+00:00 heroku[web.1]: State changed from up to down
2021-03-03T04:32:00.860211+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2021-03-03T04:32:01.033002+00:00 heroku[web.1]: Process exited with status 143
2021-03-04T23:41:06.257484+00:00 heroku[web.1]: Unidling
2021-03-04T23:41:06.279151+00:00 heroku[web.1]: State changed from down to starting
2021-03-04T23:41:09.533736+00:00 heroku[web.1]: Starting process with command `npm start`
2021-03-04T23:41:13.424801+00:00 app[web.1]:
2021-03-04T23:41:13.424844+00:00 app[web.1]: > working-rest-api#1.0.0 start /app
2021-03-04T23:41:13.424844+00:00 app[web.1]: > node index.js
2021-03-04T23:41:13.424844+00:00 app[web.1]:
2021-03-04T23:41:13.856750+00:00 app[web.1]: Server listening
2021-03-04T23:41:14.426074+00:00 heroku[web.1]: State changed from starting to up
2021-03-04T23:41:15.345417+00:00 heroku[router]: at=info method=GET path="/" host=node-api-with-books.herokuapp.com request_id=1fafdcec-9742-41d6-a530-a15755f7f0cc fwd="66.7.125.54" dyno=web.1 connect=1ms service=11ms status=404 bytes=415 protocol=https
2021-03-04T23:41:20.464200+00:00 app[web.1]: /app/index.js:12
2021-03-04T23:41:20.464217+00:00 app[web.1]: throw err;
2021-03-04T23:41:20.464218+00:00 app[web.1]: ^
2021-03-04T23:41:20.464218+00:00 app[web.1]:
2021-03-04T23:41:20.464219+00:00 app[web.1]: Error: connect ECONNREFUSED 127.0.0.1:5432
2021-03-04T23:41:20.464222+00:00 app[web.1]: at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16) {
2021-03-04T23:41:20.464223+00:00 app[web.1]: errno: -111,
2021-03-04T23:41:20.464223+00:00 app[web.1]: code: 'ECONNREFUSED',
2021-03-04T23:41:20.464223+00:00 app[web.1]: syscall: 'connect',
2021-03-04T23:41:20.464224+00:00 app[web.1]: address: '127.0.0.1',
2021-03-04T23:41:20.464224+00:00 app[web.1]: port: 5432
2021-03-04T23:41:20.464225+00:00 app[web.1]: }
2021-03-04T23:41:20.477571+00:00 heroku[router]: at=error code=H13 desc="Connection closed without response" method=GET path="/books" host=node-api-with-books.herokuapp.com request_id=24e2da67-be91-4e17-89b3-debef869bba4 fwd="66.7.125.54" dyno=web.1 connect=1ms service=49ms status=503 bytes=0 protocol=https
2021-03-04T23:41:20.484562+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2021-03-04T23:41:20.485036+00:00 app[web.1]: npm ERR! errno 1
2021-03-04T23:41:20.493801+00:00 app[web.1]: npm ERR! working-rest-api#1.0.0 start: `node index.js`
2021-03-04T23:41:20.494105+00:00 app[web.1]: npm ERR! Exit status 1
2021-03-04T23:41:20.494432+00:00 app[web.1]: npm ERR!
2021-03-04T23:41:20.494669+00:00 app[web.1]: npm ERR! Failed at the working-rest-api#1.0.0 start script.
2021-03-04T23:41:20.494947+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2021-03-04T23:41:20.511921+00:00 app[web.1]:
2021-03-04T23:41:20.512219+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2021-03-04T23:41:20.512381+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2021-03-04T23_41_20_495Z-debug.log
2021-03-04T23:41:20.920060+00:00 heroku[web.1]: Process exited with status 1
2021-03-04T23:41:20.981301+00:00 heroku[web.1]: State changed from up to crashed
2021-03-04T23:41:21.001047+00:00 heroku[web.1]: State changed from crashed to starting
2021-03-04T23:41:24.349422+00:00 heroku[web.1]: Starting process with command `npm start`
2021-03-04T23:41:28.760560+00:00 app[web.1]:
2021-03-04T23:41:28.760604+00:00 app[web.1]: > working-rest-api#1.0.0 start /app
2021-03-04T23:41:28.760605+00:00 app[web.1]: > node index.js
2021-03-04T23:41:28.760605+00:00 app[web.1]:
2021-03-04T23:41:29.460226+00:00 app[web.1]: Server listening
2021-03-04T23:41:29.767594+00:00 heroku[web.1]: State changed from starting to up
2021-03-04T23:41:30.782783+00:00 app[web.1]: /app/index.js:12
2021-03-04T23:41:30.782799+00:00 app[web.1]: throw err;
2021-03-04T23:41:30.782800+00:00 app[web.1]: ^
2021-03-04T23:41:30.782800+00:00 app[web.1]:
2021-03-04T23:41:30.782801+00:00 app[web.1]: Error: connect ECONNREFUSED 127.0.0.1:5432
2021-03-04T23:41:30.782802+00:00 app[web.1]: at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16) {
2021-03-04T23:41:30.782802+00:00 app[web.1]: errno: -111,
2021-03-04T23:41:30.782803+00:00 app[web.1]: code: 'ECONNREFUSED',
2021-03-04T23:41:30.782803+00:00 app[web.1]: syscall: 'connect',
2021-03-04T23:41:30.782803+00:00 app[web.1]: address: '127.0.0.1',
2021-03-04T23:41:30.782804+00:00 app[web.1]: port: 5432
2021-03-04T23:41:30.782804+00:00 app[web.1]: }
2021-03-04T23:41:30.806119+00:00 heroku[router]: at=error code=H13 desc="Connection closed without response" method=GET path="/books" host=node-api-with-books.herokuapp.com request_id=0476a454-a185-465c-9df3-f5e0adf6ec8f fwd="66.7.125.54" dyno=web.1 connect=1ms service=143ms status=503 bytes=0 protocol=https
2021-03-04T23:41:30.897859+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2021-03-04T23:41:30.901791+00:00 app[web.1]: npm ERR! errno 1
2021-03-04T23:41:30.940174+00:00 app[web.1]: npm ERR! working-rest-api#1.0.0 start: `node index.js`
2021-03-04T23:41:30.941393+00:00 app[web.1]: npm ERR! Exit status 1
2021-03-04T23:41:30.942380+00:00 app[web.1]: npm ERR!
2021-03-04T23:41:30.942813+00:00 app[web.1]: npm ERR! Failed at the working-rest-api#1.0.0 start script.
2021-03-04T23:41:30.943425+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2021-03-04T23:41:31.316808+00:00 app[web.1]:
2021-03-04T23:41:31.316994+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2021-03-04T23:41:31.317190+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2021-03-04T23_41_30_947Z-debug.log
2021-03-04T23:41:31.419624+00:00 heroku[web.1]: Process exited with status 1
2021-03-04T23:41:31.527952+00:00 heroku[web.1]: State changed from up to crashed
2021-03-04T23:41:32.128408+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=node-api-with-books.herokuapp.com request_id=7909f853-52aa-43dc-a228-3190e28b31b9 fwd="66.7.125.54" dyno=web.1 connect=0ms service= status=503 bytes= protocol=https
Is there any part of this that I should focus on and how do I make it work?
You might need to look at this to understand better https://www.taniarascia.com/node-express-postgresql-heroku/

Your are trying to connect to local postgreSQL database from heroku, try to set a new environment variable in heroku dashboard like this :
NODE_ENV=production
or
You need to set up all your env. var with add-ons value like this :
DB_USER=[your-add-on-user]
DB_PASSWORD=[your-add-on-pass]
DB_HOST=[your-add-on-host]
DB_PORT=5432
DB_DATABASE=[your-add-on-database]
source : https://www.taniarascia.com/node-express-postgresql-heroku/#environment-variables

Related

Application error - I'm getting an error message after deployment to Heroku even though my app works fine in development

I tried to publish my app to Heroku but I got the below error message:
An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details. You can do this from the Heroku CLI with the command
heroku logs --tail
I checked the logs and got the below info which I cannot decipher:
(node:40446) SyntaxError Plugin: heroku: /home/me/.local/share/heroku/config.json: Unexpected end of JSON input
module: #oclif/config#1.17.0
task: runHook prerun
plugin: heroku
root: /snap/heroku/4076
See more details with DEBUG=*
2021-09-20T22:05:15.905073+00:00 app[api]: Deploy 17474356 by user me.me#myemail.com
2021-09-20T22:05:15.922889+00:00 app[api]: Scaled to web#1:Free by user me.me#myemail.com
2021-09-20T22:05:17.000000+00:00 app[api]: Build succeeded
2021-09-20T22:05:22.406972+00:00 heroku[web.1]: Starting process with command `npm start`
2021-09-20T22:05:23.782304+00:00 app[web.1]:
2021-09-20T22:05:23.782323+00:00 app[web.1]: > contact-keeper#1.0.0 start /app
2021-09-20T22:05:23.782323+00:00 app[web.1]: > node server.js
2021-09-20T22:05:23.782323+00:00 app[web.1]:
2021-09-20T22:05:24.264339+00:00 app[web.1]: /app/server.js:4
2021-09-20T22:05:24.264356+00:00 app[web.1]: const path = requier("path");
2021-09-20T22:05:24.264357+00:00 app[web.1]: ^
2021-09-20T22:05:24.264357+00:00 app[web.1]:
2021-09-20T22:05:24.264358+00:00 app[web.1]: ReferenceError: requier is not defined
2021-09-20T22:05:24.264358+00:00 app[web.1]: at Object.<anonymous> (/app/server.js:4:14)
2021-09-20T22:05:24.264359+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:1072:14)
2021-09-20T22:05:24.264359+00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
2021-09-20T22:05:24.264360+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:937:32)
2021-09-20T22:05:24.264360+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:778:12)
2021-09-20T22:05:24.264360+00:00 app[web.1]: at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
2021-09-20T22:05:24.264361+00:00 app[web.1]: at internal/main/run_main_module.js:17:47
2021-09-20T22:05:24.276266+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2021-09-20T22:05:24.276629+00:00 app[web.1]: npm ERR! errno 1
2021-09-20T22:05:24.285403+00:00 app[web.1]: npm ERR! contact-keeper#1.0.0 start: `node server.js`
2021-09-20T22:05:24.285546+00:00 app[web.1]: npm ERR! Exit status 1
2021-09-20T22:05:24.285701+00:00 app[web.1]: npm ERR!
2021-09-20T22:05:24.285813+00:00 app[web.1]: npm ERR! Failed at the contact-keeper#1.0.0 start script.
2021-09-20T22:05:24.285905+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2021-09-20T22:05:24.304319+00:00 app[web.1]:
2021-09-20T22:05:24.307416+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2021-09-20T22:05:24.307459+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2021-09-20T22_05_24_286Z-debug.log
2021-09-20T22:05:24.477472+00:00 heroku[web.1]: Process exited with status 1
2021-09-20T22:05:24.608841+00:00 heroku[web.1]: State changed from starting to crashed
2021-09-20T22:05:24.616776+00:00 heroku[web.1]: State changed from crashed to starting
2021-09-20T22:05:30.615650+00:00 heroku[web.1]: Starting process with command `npm start`
2021-09-20T22:05:32.154416+00:00 app[web.1]:
2021-09-20T22:05:32.154432+00:00 app[web.1]: > contact-keeper#1.0.0 start /app
2021-09-20T22:05:32.154432+00:00 app[web.1]: > node server.js
2021-09-20T22:05:32.154433+00:00 app[web.1]:
2021-09-20T22:05:32.491951+00:00 app[web.1]: /app/server.js:4
2021-09-20T22:05:32.491970+00:00 app[web.1]: const path = requier("path");
2021-09-20T22:05:32.491970+00:00 app[web.1]: ^
2021-09-20T22:05:32.491970+00:00 app[web.1]:
2021-09-20T22:05:32.491971+00:00 app[web.1]: ReferenceError: requier is not defined
2021-09-20T22:05:32.491971+00:00 app[web.1]: at Object.<anonymous> (/app/server.js:4:14)
2021-09-20T22:05:32.491971+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:1072:14)
2021-09-20T22:05:32.491972+00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
2021-09-20T22:05:32.491972+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:937:32)
2021-09-20T22:05:32.491972+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:778:12)
2021-09-20T22:05:32.491975+00:00 app[web.1]: at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
2021-09-20T22:05:32.491975+00:00 app[web.1]: at internal/main/run_main_module.js:17:47
2021-09-20T22:05:32.502469+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2021-09-20T22:05:32.504151+00:00 app[web.1]: npm ERR! errno 1
2021-09-20T22:05:32.507359+00:00 app[web.1]: npm ERR! contact-keeper#1.0.0 start: `node server.js`
2021-09-20T22:05:32.507361+00:00 app[web.1]: npm ERR! Exit status 1
2021-09-20T22:05:32.507362+00:00 app[web.1]: npm ERR!
2021-09-20T22:05:32.507362+00:00 app[web.1]: npm ERR! Failed at the contact-keeper#1.0.0 start script.
2021-09-20T22:05:32.507363+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2021-09-20T22:05:32.517624+00:00 app[web.1]:
2021-09-20T22:05:32.517629+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2021-09-20T22:05:32.517630+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2021-09-20T22_05_32_508Z-debug.log
2021-09-20T22:05:32.654009+00:00 heroku[web.1]: Process exited with status 1
2021-09-20T22:05:32.790052+00:00 heroku[web.1]: State changed from starting to crashed
2021-09-20T22:10:11.627061+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=pure-thicket-06601.herokuapp.com request_id=0c6e85f7-f539-406d-a7fa-9d92a88ea7de fwd="89.211.153.133" dyno= connect= service= status=503 bytes= protocol=https
2021-09-20T22:10:12.524329+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=pure-thicket-06601.herokuapp.com request_id=c9282c5e-54aa-4735-802d-fd782041837a fwd="89.211.153.133" dyno= connect= service= status=503 bytes= protocol=https
2021-09-20T22:13:28.000000+00:00 app[api]: Build started by user me.me#myemail.com
2021-09-20T22:15:44.820687+00:00 app[api]: Deploy d8ef6129 by user me.me#myemail.com
2021-09-20T22:15:44.820687+00:00 app[api]: Release v4 created by user me.me#myemail.com
2021-09-20T22:15:45.198887+00:00 heroku[web.1]: State changed from crashed to starting
2021-09-20T22:15:46.000000+00:00 app[api]: Build succeeded
2021-09-20T22:15:51.404944+00:00 heroku[web.1]: Starting process with command `npm start`
2021-09-20T22:15:52.687305+00:00 app[web.1]:
2021-09-20T22:15:52.687323+00:00 app[web.1]: > contact-keeper#1.0.0 start /app
2021-09-20T22:15:52.687323+00:00 app[web.1]: > node server.js
2021-09-20T22:15:52.687324+00:00 app[web.1]:
2021-09-20T22:15:53.120246+00:00 app[web.1]: /app/server.js:4
2021-09-20T22:15:53.120260+00:00 app[web.1]: const path = requier("path");
2021-09-20T22:15:53.120260+00:00 app[web.1]: ^
2021-09-20T22:15:53.120261+00:00 app[web.1]:
2021-09-20T22:15:53.120262+00:00 app[web.1]: ReferenceError: requier is not defined
2021-09-20T22:15:53.120262+00:00 app[web.1]: at Object.<anonymous> (/app/server.js:4:14)
2021-09-20T22:15:53.120263+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:1072:14)
2021-09-20T22:15:53.120263+00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
2021-09-20T22:15:53.120264+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:937:32)
2021-09-20T22:15:53.120264+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:778:12)
2021-09-20T22:15:53.120265+00:00 app[web.1]: at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
2021-09-20T22:15:53.120265+00:00 app[web.1]: at internal/main/run_main_module.js:17:47
2021-09-20T22:15:53.132041+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2021-09-20T22:15:53.132277+00:00 app[web.1]: npm ERR! errno 1
2021-09-20T22:15:53.143479+00:00 app[web.1]: npm ERR! contact-keeper#1.0.0 start: `node server.js`
2021-09-20T22:15:53.143539+00:00 app[web.1]: npm ERR! Exit status 1
2021-09-20T22:15:53.143612+00:00 app[web.1]: npm ERR!
2021-09-20T22:15:53.143669+00:00 app[web.1]: npm ERR! Failed at the contact-keeper#1.0.0 start script.
2021-09-20T22:15:53.143714+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2021-09-20T22:15:53.156377+00:00 app[web.1]:
2021-09-20T22:15:53.156477+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2021-09-20T22:15:53.156529+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2021-09-20T22_15_53_144Z-debug.log
2021-09-20T22:15:53.320983+00:00 heroku[web.1]: Process exited with status 1
2021-09-20T22:15:53.393003+00:00 heroku[web.1]: State changed from starting to crashed
2021-09-20T22:16:11.040791+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=pure-thicket-06601.herokuapp.com request_id=fcca437f-5d66-44db-a8dc-8bb638db78ac fwd="89.211.153.133" dyno= connect= service= status=503 bytes= protocol=https
2021-09-20T22:16:11.928866+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=pure-thicket-06601.herokuapp.com request_id=d12c938a-0a91-4947-8d10-6af6f31a7b9f fwd="89.211.153.133" dyno= connect= service= status=503 bytes= protocol=https
2021-09-20T22:17:36.704916+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=pure-thicket-06601.herokuapp.com request_id=5ed37742-5272-486e-b762-323e16c53cf1 fwd="89.211.153.133" dyno= connect= service= status=503 bytes= protocol=https
Any idea what went wrong? Everything worked perfectly fine in localhost but now even locally I'm having problems after deployment.
There is a spelling error. Replace
const path = requier("path");
with
const path = require("path");
and deploy it again to see if it works.

Getting H13 Error when visiting deployed Heroku Site

I am able to deploy my heroku app, but when I visit the site I get an "Application Error"
I check the logs and I get this error.
2020-12-31T19:11:51.183872+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2020-12-31T19:11:51.184111+00:00 app[web.1]: npm ERR! errno 1
2020-12-31T19:11:51.188994+00:00 app[web.1]: npm ERR! donaghmoyne-gaa#1.0.0 start: `node app.js`
2020-12-31T19:11:51.189093+00:00 app[web.1]: npm ERR! Exit status 1
2020-12-31T19:11:51.189223+00:00 app[web.1]: npm ERR!
2020-12-31T19:11:51.189332+00:00 app[web.1]: npm ERR! Failed at the donaghmoyne-gaa#1.0.0 start script.
2020-12-31T19:11:51.189430+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2020-12-31T19:11:51.198554+00:00 app[web.1]:
2020-12-31T19:11:51.198755+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2020-12-31T19:11:51.198866+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2020-12-31T19_11_51_190Z-debug.log
2020-12-31T19:11:51.248899+00:00 heroku[web.1]: Process exited with status 1
2020-12-31T19:11:51.177846+00:00 heroku[router]: at=error code=H13 desc="Connection closed without response" method=GET path="/" host=donaghmoyne-gaa.herokuapp.com request_id=6e2f3c82-5678-4247-ba5f-7f7d2cf38362 fwd="80.233.38.196" dyno=web.1 connect=1ms service=28205ms status=503 bytes=0 protocol=https
2020-12-31T19:11:51.293085+00:00 heroku[web.1]: State changed from up to crashed
2020-12-31T19:11:51.296451+00:00 heroku[web.1]: State changed from crashed to starting
2020-12-31T19:11:53.293694+00:00 heroku[web.1]: Starting process with command `npm start`
2020-12-31T19:11:55.043398+00:00 app[web.1]:
2020-12-31T19:11:55.043410+00:00 app[web.1]: > donaghmoyne-gaa#1.0.0 start /app
2020-12-31T19:11:55.043410+00:00 app[web.1]: > node app.js
2020-12-31T19:11:55.043411+00:00 app[web.1]:
2020-12-31T19:11:55.550523+00:00 app[web.1]: Listening on Port 3769
2020-12-31T19:11:55.964632+00:00 heroku[web.1]: State changed from starting to up
2020-12-31T19:12:25.618344+00:00 heroku[router]: sock=backend at=error code=H18 desc="Server Request Interrupted" method=GET path="/favicon.ico" host=donaghmoyne-gaa.herokuapp.com request_id=d65a38d1-6b26-4797-8e82-4058fe54f5d6 fwd="80.233.38.196" dyno=web.1 connect=5000ms service=25004ms status=503 bytes= protocol=https
I am really not sure what is causing the error,
Thank you
I found what the problem was, I was not connecting the Atlas DB properly.
I found this video and it helped. https://www.youtube.com/watch?v=WVxG1Smf92o&ab_channel=Kristian

"npm ERR! code ELIFECYCLE" error Heroku deployment

I was trying to deploy a Node.js application with [this][1] becaon library into Heroku. The Heroku logs says that the error might be coming from start script but there is no problem with my start script.When I deployed the app to Heroku I got the following error:
When I run node index.js locally I get no errors. But the application does not run on Heroku
Warning: heroku update available from 7.0.49 to 7.18.10
2018-12-01T04:06:34.300391+00:00 heroku[web.1]: Starting process with command `npm start`
2018-12-01T04:06:35.940335+00:00 app[web.1]:
2018-12-01T04:06:35.940352+00:00 app[web.1]: > beacon#1.0.0 start /app
2018-12-01T04:06:35.940354+00:00 app[web.1]: > node index.js
2018-12-01T04:06:35.940355+00:00 app[web.1]:
2018-12-01T04:06:36.182490+00:00 app[web.1]: node: ../deps/uv/src/unix/poll.c:120: uv_poll_start: Assertion `!(((handle)->flags & (UV_CLOSING | UV_CLOSED)) != 0)' failed.
2018-12-01T04:06:36.185072+00:00 app[web.1]: Aborted
2018-12-01T04:06:36.188032+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2018-12-01T04:06:36.188313+00:00 app[web.1]: npm ERR! errno 134
2018-12-01T04:06:36.189384+00:00 app[web.1]: npm ERR! beacon#1.0.0 start: `node index.js`
2018-12-01T04:06:36.189493+00:00 app[web.1]: npm ERR! Exit status 134
2018-12-01T04:06:36.189660+00:00 app[web.1]: npm ERR!
2018-12-01T04:06:36.189769+00:00 app[web.1]: npm ERR! Failed at the beacon#1.0.0 start script.
2018-12-01T04:06:36.189870+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2018-12-01T04:06:36.196620+00:00 app[web.1]:
2018-12-01T04:06:36.197883+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2018-12-01T04:06:36.197884+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2018-12-01T04_06_36_191Z-debug.log
2018-12-01T04:06:36.252135+00:00 heroku[web.1]: Process exited with status 134
2018-12-01T04:06:36.269181+00:00 heroku[web.1]: State changed from starting to crashed
2018-12-01T04:06:36.271462+00:00 heroku[web.1]: State changed from crashed to starting
2018-12-01T04:06:38.878330+00:00 heroku[web.1]: Starting process with command `npm start`
2018-12-01T04:06:41.389907+00:00 app[web.1]: node: ../deps/uv/src/unix/poll.c:120: uv_poll_start: Assertion `!(((handle)->flags & (UV_CLOSING | UV_CLOSED)) != 0)' failed.
2018-12-01T04:06:41.399890+00:00 app[web.1]: Aborted
2018-12-01T04:06:41.414233+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2018-12-01T04:06:41.415046+00:00 app[web.1]: npm ERR! errno 134
2018-12-01T04:06:41.415963+00:00 app[web.1]: npm ERR! beacon#1.0.0 start: `node index.js`
2018-12-01T04:06:41.416136+00:00 app[web.1]: npm ERR! Exit status 134
2018-12-01T04:06:41.416369+00:00 app[web.1]: npm ERR!
2018-12-01T04:06:41.416552+00:00 app[web.1]: npm ERR! Failed at the beacon#1.0.0 start script.
2018-12-01T04:06:41.416721+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2018-12-01T04:06:41.424049+00:00 app[web.1]:
2018-12-01T04:06:41.428265+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2018-12-01T04:06:41.428268+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2018-12-01T04_06_41_418Z-debug.log
2018-12-01T04:06:41.108083+00:00 app[web.1]:
2018-12-01T04:06:41.108108+00:00 app[web.1]: > beacon#1.0.0 start /app
2018-12-01T04:06:41.108110+00:00 app[web.1]: > node index.js
2018-12-01T04:06:41.108111+00:00 app[web.1]:
2018-12-01T04:06:41.596884+00:00 heroku[web.1]: State changed from starting to crashed
2018-12-01T04:06:41.485308+00:00 heroku[web.1]: Process exited with status 134
2018-12-01T04:07:26.397433+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=shrouded-earth-56576.herokuapp.com request_id=d07bc3c2-d97c-42e1-9dd6-9898eb760ac4 fwd="71.82.55.26" dyno= connect= service= status=503 bytes= protocol=https
2018-12-01T04:07:26.994317+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=shrouded-earth-56576.herokuapp.com request_id=dd732048-d3f9-44e9-98d2-46eb8cc85cda fwd="71.82.55.26" dyno= connect= service= status=503 bytes= protocol=https
2018-12-01T04:13:25.564521+00:00 heroku[web.1]: State changed from crashed to starting
2018-12-01T04:13:27.647004+00:00 heroku[web.1]: Starting process with command `npm start`
2018-12-01T04:13:29.564971+00:00 heroku[web.1]: Process exited with status 134
2018-12-01T04:13:29.294660+00:00 app[web.1]:
2018-12-01T04:13:29.294685+00:00 app[web.1]: > beacon#1.0.0 start /app
2018-12-01T04:13:29.294687+00:00 app[web.1]: > node index.js
2018-12-01T04:13:29.294688+00:00 app[web.1]:
2018-12-01T04:13:29.510248+00:00 app[web.1]: node: ../deps/uv/src/unix/poll.c:120: uv_poll_start: Assertion `!(((handle)->flags & (UV_CLOSING | UV_CLOSED)) != 0)' failed.
2018-12-01T04:13:29.513133+00:00 app[web.1]: Aborted
2018-12-01T04:13:29.516318+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2018-12-01T04:13:29.516650+00:00 app[web.1]: npm ERR! errno 134
2018-12-01T04:13:29.517766+00:00 app[web.1]: npm ERR! beacon#1.0.0 start: `node index.js`
2018-12-01T04:13:29.517871+00:00 app[web.1]: npm ERR! Exit status 134
2018-12-01T04:13:29.518068+00:00 app[web.1]: npm ERR!
2018-12-01T04:13:29.518177+00:00 app[web.1]: npm ERR! Failed at the beacon#1.0.0 start script.
2018-12-01T04:13:29.518300+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2018-12-01T04:13:29.523910+00:00 app[web.1]:
2018-12-01T04:13:29.524106+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2018-12-01T04:13:29.524250+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2018-12-01T04_13_29_519Z-debug.log
2018-12-01T04:13:29.599675+00:00 heroku[web.1]: State changed from starting to crashed
2018-12-01T04:13:31.494135+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=shrouded-earth-56576.herokuapp.com request_id=67443cd5-7197-4ef7-a0b0-2a5491d9e4d6 fwd="71.82.55.26" dyno= connect= service= status=503 bytes= protocol=https
2018-12-01T04:13:33.189065+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=shrouded-earth-56576.herokuapp.com request_id=0146892f-fab3-4636-ad2d-b1f8d03800e5 fwd="71.82.55.26" dyno= connect= service= status=503 bytes= protocol=https
2018-12-01T04:21:18.599016+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=shrouded-earth-56576.herokuapp.com request_id=72ad062c-7a36-4b87-9aae-b4c661284deb fwd="71.82.55.26" dyno= connect= service= status=503 bytes= protocol=https
2018-12-01T04:21:20.379722+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=shrouded-earth-56576.herokuapp.com request_id=bf46325b-6def-4060-b091-a14d5764f01c fwd="71.82.55.26" dyno= connect= service= status=503 bytes= protocol=https
2018-12-01T04:24:03.236771+00:00 heroku[web.1]: State changed from crashed to starting
2018-12-01T04:24:07.724222+00:00 app[web.1]: Aborted
2018-12-01T04:24:07.727689+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2018-12-01T04:24:07.728039+00:00 app[web.1]: npm ERR! errno 134
2018-12-01T04:24:07.729239+00:00 app[web.1]: npm ERR! beacon#1.0.0 start: `node index.js`
2018-12-01T04:24:07.729410+00:00 app[web.1]: npm ERR! Exit status 134
2018-12-01T04:24:07.729636+00:00 app[web.1]: npm ERR!
2018-12-01T04:24:07.729806+00:00 app[web.1]: npm ERR! Failed at the beacon#1.0.0 start script.
2018-12-01T04:24:07.729961+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2018-12-01T04:24:07.733417+00:00 app[web.1]:
2018-12-01T04:24:07.733683+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2018-12-01T04:24:07.733804+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2018-12-01T04_24_07_731Z-debug.log
2018-12-01T04:24:07.471562+00:00 app[web.1]:
2018-12-01T04:24:07.471584+00:00 app[web.1]: > beacon#1.0.0 start /app
2018-12-01T04:24:07.471586+00:00 app[web.1]: > node index.js
2018-12-01T04:24:07.471587+00:00 app[web.1]:
2018-12-01T04:24:07.721101+00:00 app[web.1]: node: ../deps/uv/src/unix/poll.c:120: uv_poll_start: Assertion `!(((handle)->flags & (UV_CLOSING | UV_CLOSED)) != 0)' failed.
2018-12-01T04:24:07.796807+00:00 heroku[web.1]: Process exited with status 134
This is my packgae.json
{
"name": "beacon",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "node index.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"dependencies": {
"bluetooth-hci-socket": "^0.5.1",
"body-parser": "^1.18.3",
"ejs": "^2.6.1",
"express": "^4.16.4",
"noble": "^1.9.1",
"node-beacon-scanner": "^0.1.0",
"node-gyp": "^3.8.0",
"rebuild": "^0.1.2"
},
"engines": {
"node": "8.11.1"
},
"author": "sas",
"license": "ISC"
}
Edit 1
Complete Logs:
Warning: heroku update available from 7.0.49 to 7.18.10
2018-12-01T04:06:35.940354+00:00 app[web.1]: > node index.js
2018-12-01T04:06:35.940355+00:00 app[web.1]:
2018-12-01T04:06:36.182490+00:00 app[web.1]: node: ../deps/uv/src/unix/poll.c:120: uv_poll_start: Assertion `!(((handle)->flags & (UV_CLOSING | UV_CLOSED)) != 0)' failed.
2018-12-01T04:06:36.185072+00:00 app[web.1]: Aborted
2018-12-01T04:06:36.188032+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2018-12-01T04:06:36.188313+00:00 app[web.1]: npm ERR! errno 134
2018-12-01T04:06:36.189384+00:00 app[web.1]: npm ERR! beacon#1.0.0 start: `node index.js`
2018-12-01T04:06:36.189493+00:00 app[web.1]: npm ERR! Exit status 134
2018-12-01T04:06:36.189660+00:00 app[web.1]: npm ERR!
2018-12-01T04:06:36.189769+00:00 app[web.1]: npm ERR! Failed at the beacon#1.0.0 start script.
2018-12-01T04:06:36.189870+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2018-12-01T04:06:36.196620+00:00 app[web.1]:
2018-12-01T04:06:36.197883+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2018-12-01T04:06:36.197884+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2018-12-01T04_06_36_191Z-debug.log
2018-12-01T04:06:36.252135+00:00 heroku[web.1]: Process exited with status 134
2018-12-01T04:06:36.269181+00:00 heroku[web.1]: State changed from starting to crashed
2018-12-01T04:06:36.271462+00:00 heroku[web.1]: State changed from crashed to starting
2018-12-01T04:06:38.878330+00:00 heroku[web.1]: Starting process with command `npm start`
2018-12-01T04:06:41.389907+00:00 app[web.1]: node: ../deps/uv/src/unix/poll.c:120: uv_poll_start: Assertion `!(((handle)->flags & (UV_CLOSING | UV_CLOSED)) != 0)' failed.
2018-12-01T04:06:41.399890+00:00 app[web.1]: Aborted
2018-12-01T04:06:41.414233+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2018-12-01T04:06:41.415046+00:00 app[web.1]: npm ERR! errno 134
2018-12-01T04:06:41.415963+00:00 app[web.1]: npm ERR! beacon#1.0.0 start: `node index.js`
2018-12-01T04:06:41.416136+00:00 app[web.1]: npm ERR! Exit status 134
2018-12-01T04:06:41.416369+00:00 app[web.1]: npm ERR!
2018-12-01T04:06:41.416552+00:00 app[web.1]: npm ERR! Failed at the beacon#1.0.0 start script.
2018-12-01T04:06:41.416721+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2018-12-01T04:06:41.424049+00:00 app[web.1]:
2018-12-01T04:06:41.428265+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2018-12-01T04:06:41.428268+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2018-12-01T04_06_41_418Z-debug.log
2018-12-01T04:06:41.108083+00:00 app[web.1]:
2018-12-01T04:06:41.108108+00:00 app[web.1]: > beacon#1.0.0 start /app
2018-12-01T04:06:41.108110+00:00 app[web.1]: > node index.js
2018-12-01T04:06:41.108111+00:00 app[web.1]:
2018-12-01T04:06:41.596884+00:00 heroku[web.1]: State changed from starting to crashed
2018-12-01T04:06:41.485308+00:00 heroku[web.1]: Process exited with status 134
2018-12-01T04:07:26.397433+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=shrouded-earth-56576.herokuapp.com request_id=d07bc3c2-d97c-42e1-9dd6-9898eb760ac4 fwd="71.82.55.26" dyno= connect= service= status=503 bytes= protocol=https
2018-12-01T04:07:26.994317+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=shrouded-earth-56576.herokuapp.com request_id=dd732048-d3f9-44e9-98d2-46eb8cc85cda fwd="71.82.55.26" dyno= connect= service= status=503 bytes= protocol=https
2018-12-01T04:13:25.564521+00:00 heroku[web.1]: State changed from crashed to starting
2018-12-01T04:13:27.647004+00:00 heroku[web.1]: Starting process with command `npm start`
2018-12-01T04:13:29.564971+00:00 heroku[web.1]: Process exited with status 134
2018-12-01T04:13:29.294660+00:00 app[web.1]:
2018-12-01T04:13:29.294685+00:00 app[web.1]: > beacon#1.0.0 start /app
2018-12-01T04:13:29.294687+00:00 app[web.1]: > node index.js
2018-12-01T04:13:29.294688+00:00 app[web.1]:
2018-12-01T04:13:29.510248+00:00 app[web.1]: node: ../deps/uv/src/unix/poll.c:120: uv_poll_start: Assertion `!(((handle)->flags & (UV_CLOSING | UV_CLOSED)) != 0)' failed.
2018-12-01T04:13:29.513133+00:00 app[web.1]: Aborted
2018-12-01T04:13:29.516318+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2018-12-01T04:13:29.516650+00:00 app[web.1]: npm ERR! errno 134
2018-12-01T04:13:29.517766+00:00 app[web.1]: npm ERR! beacon#1.0.0 start: `node index.js`
2018-12-01T04:13:29.517871+00:00 app[web.1]: npm ERR! Exit status 134
2018-12-01T04:13:29.518068+00:00 app[web.1]: npm ERR!
2018-12-01T04:13:29.518177+00:00 app[web.1]: npm ERR! Failed at the beacon#1.0.0 start script.
2018-12-01T04:13:29.518300+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2018-12-01T04:13:29.523910+00:00 app[web.1]:
2018-12-01T04:13:29.524106+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2018-12-01T04:13:29.524250+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2018-12-01T04_13_29_519Z-debug.log
2018-12-01T04:13:29.599675+00:00 heroku[web.1]: State changed from starting to crashed
2018-12-01T04:13:31.494135+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=shrouded-earth-56576.herokuapp.com request_id=67443cd5-7197-4ef7-a0b0-2a5491d9e4d6 fwd="71.82.55.26" dyno= connect= service= status=503 bytes= protocol=https
2018-12-01T04:13:33.189065+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=shrouded-earth-56576.herokuapp.com request_id=0146892f-fab3-4636-ad2d-b1f8d03800e5 fwd="71.82.55.26" dyno= connect= service= status=503 bytes= protocol=https
2018-12-01T04:21:18.599016+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=shrouded-earth-56576.herokuapp.com request_id=72ad062c-7a36-4b87-9aae-b4c661284deb fwd="71.82.55.26" dyno= connect= service= status=503 bytes= protocol=https
2018-12-01T04:21:20.379722+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=shrouded-earth-56576.herokuapp.com request_id=bf46325b-6def-4060-b091-a14d5764f01c fwd="71.82.55.26" dyno= connect= service= status=503 bytes= protocol=https
2018-12-01T04:24:03.236771+00:00 heroku[web.1]: State changed from crashed to starting
2018-12-01T04:24:07.724222+00:00 app[web.1]: Aborted
2018-12-01T04:24:07.727689+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2018-12-01T04:24:07.728039+00:00 app[web.1]: npm ERR! errno 134
2018-12-01T04:24:07.729239+00:00 app[web.1]: npm ERR! beacon#1.0.0 start: `node index.js`
2018-12-01T04:24:07.729410+00:00 app[web.1]: npm ERR! Exit status 134
2018-12-01T04:24:07.729636+00:00 app[web.1]: npm ERR!
2018-12-01T04:24:07.729806+00:00 app[web.1]: npm ERR! Failed at the beacon#1.0.0 start script.
2018-12-01T04:24:07.729961+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2018-12-01T04:24:07.733417+00:00 app[web.1]:
2018-12-01T04:24:07.733683+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2018-12-01T04:24:07.733804+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2018-12-01T04_24_07_731Z-debug.log
2018-12-01T04:24:07.471562+00:00 app[web.1]:
2018-12-01T04:24:07.471584+00:00 app[web.1]: > beacon#1.0.0 start /app
2018-12-01T04:24:07.471586+00:00 app[web.1]: > node index.js
2018-12-01T04:24:07.471587+00:00 app[web.1]:
2018-12-01T04:24:07.721101+00:00 app[web.1]: node: ../deps/uv/src/unix/poll.c:120: uv_poll_start: Assertion `!(((handle)->flags & (UV_CLOSING | UV_CLOSED)) != 0)' failed.
2018-12-01T04:24:07.796807+00:00 heroku[web.1]: Process exited with status 134
2018-12-01T04:45:54.163823+00:00 heroku[web.1]: State changed from crashed to starting
2018-12-01T04:45:57.333106+00:00 heroku[web.1]: Starting process with command `npm start`
2018-12-01T04:46:00.197869+00:00 app[web.1]:
2018-12-01T04:46:00.197897+00:00 app[web.1]: > beacon#1.0.0 start /app
2018-12-01T04:46:00.197899+00:00 app[web.1]: > node index.js
2018-12-01T04:46:00.197900+00:00 app[web.1]:
2018-12-01T04:46:00.626118+00:00 app[web.1]: node: ../deps/uv/src/unix/poll.c:120: uv_poll_start: Assertion `!(((handle)->flags & (UV_CLOSING | UV_CLOSED)) != 0)' failed.
2018-12-01T04:46:00.630209+00:00 app[web.1]: Aborted
2018-12-01T04:46:00.642201+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2018-12-01T04:46:00.642204+00:00 app[web.1]: npm ERR! errno 134
2018-12-01T04:46:00.642215+00:00 app[web.1]: npm ERR! beacon#1.0.0 start: `node index.js`
2018-12-01T04:46:00.642217+00:00 app[web.1]: npm ERR! Exit status 134
2018-12-01T04:46:00.642220+00:00 app[web.1]: npm ERR!
2018-12-01T04:46:00.642224+00:00 app[web.1]: npm ERR! Failed at the beacon#1.0.0 start script.
2018-12-01T04:46:00.649736+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2018-12-01T04:46:00.671528+00:00 app[web.1]:
2018-12-01T04:46:00.671785+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2018-12-01T04:46:00.671953+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2018-12-0s

Linux Application Error on Heroku Open Node App

When I heroku open a basic node app, I get a series of errors. This comes after a successful heroku push.
I looked on GitHub and found the same error for a windows user, but I'm on a mac. It was suggested to run the command
--no-bin-links though I do not know what that will do. Help, please.
$ heroku logs
2015-11-18T22:00:42.465970+00:00 heroku[api]: Enable Logplex by adamcweitzman#gmail.com
2015-11-18T22:00:42.465970+00:00 heroku[api]: Release v2 created by adamcweitzman#gmail.com
2015-11-18T22:01:13.964233+00:00 heroku[api]: Deploy 95ab50f by adamcweitzman#gmail.com
2015-11-18T22:01:13.964233+00:00 heroku[api]: Release v3 created by adamcweitzman#gmail.com
2015-11-18T22:01:13.898217+00:00 heroku[api]: Scale to web=1 by adamcweitzman#gmail.com
2015-11-18T22:01:14.302776+00:00 heroku[slug-compiler]: Slug compilation started
2015-11-18T22:01:14.302785+00:00 heroku[slug-compiler]: Slug compilation finished
2015-11-18T22:01:15.248283+00:00 heroku[web.1]: Starting process with command `npm start`
2015-11-18T22:01:17.147380+00:00 app[web.1]:
2015-11-18T22:01:17.147400+00:00 app[web.1]:
2015-11-18T22:01:17.147399+00:00 app[web.1]: > shufflebod#0.0.0 start /app
2015-11-18T22:01:17.147400+00:00 app[web.1]: > node ./bin/www
2015-11-18T22:01:17.709403+00:00 app[web.1]: npm ERR! Linux 3.13.0-66-generic
2015-11-18T22:01:17.709767+00:00 app[web.1]: npm ERR! argv "/app/.heroku/node/bin/node" "/app/.heroku/node/bin/npm" "start"
2015-11-18T22:01:17.710006+00:00 app[web.1]: npm ERR! node v5.0.0
2015-11-18T22:01:17.710500+00:00 app[web.1]: npm ERR! npm v3.3.6
2015-11-18T22:01:17.710886+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2015-11-18T22:01:17.711057+00:00 app[web.1]: npm ERR! shufflebod#0.0.0 start: `node ./bin/www`
2015-11-18T22:01:17.711204+00:00 app[web.1]: npm ERR! Exit status 1
2015-11-18T22:01:17.711370+00:00 app[web.1]: npm ERR!
2015-11-18T22:01:17.711524+00:00 app[web.1]: npm ERR! Failed at the shufflebod#0.0.0 start script 'node ./bin/www'.
2015-11-18T22:01:17.711690+00:00 app[web.1]: npm ERR! This is most likely a problem with the shufflebod package,
2015-11-18T22:01:17.711879+00:00 app[web.1]: npm ERR! not with npm itself.
2015-11-18T22:01:17.712210+00:00 app[web.1]: npm ERR! node ./bin/www
2015-11-18T22:01:17.712025+00:00 app[web.1]: npm ERR! Tell the author that this fails on your system:
2015-11-18T22:01:17.712359+00:00 app[web.1]: npm ERR! You can get their info via:
2015-11-18T22:01:17.712648+00:00 app[web.1]: npm ERR! There is likely additional logging output above.
2015-11-18T22:01:17.712503+00:00 app[web.1]: npm ERR! npm owner ls shufflebod
2015-11-18T22:01:17.715348+00:00 app[web.1]:
2015-11-18T22:01:17.715563+00:00 app[web.1]: npm ERR! Please include the following file with any support request:
2015-11-18T22:01:17.715707+00:00 app[web.1]: npm ERR! /app/npm-debug.log
2015-11-18T22:01:17.697334+00:00 app[web.1]:
2015-11-18T22:01:17.697338+00:00 app[web.1]: /app/node_modules/mongodb/lib/server.js:235
2015-11-18T22:01:17.697339+00:00 app[web.1]: process.nextTick(function() { throw err; })
2015-11-18T22:01:17.697340+00:00 app[web.1]: ^
2015-11-18T22:01:17.697341+00:00 app[web.1]: Error: getaddrinfo ENOTFOUND undefined undefined:27017
2015-11-18T22:01:17.697343+00:00 app[web.1]: at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:77:26)
2015-11-18T22:01:17.697342+00:00 app[web.1]: at errnoException (dns.js:26:10)
2015-11-18T22:01:17.704845+00:00 app[web.1]:
2015-11-18T22:01:18.349594+00:00 heroku[web.1]: Process exited with status 1
2015-11-18T22:01:19.268580+00:00 heroku[web.1]: Starting process with command `npm start`
2015-11-18T22:01:20.934317+00:00 app[web.1]:
2015-11-18T22:01:20.934327+00:00 app[web.1]: > shufflebod#0.0.0 start /app
2015-11-18T22:01:20.934328+00:00 app[web.1]: > node ./bin/www
2015-11-18T22:01:20.934329+00:00 app[web.1]:
2015-11-18T22:01:21.402689+00:00 app[web.1]: npm ERR! Linux 3.13.0-66-generic
2015-11-18T22:01:21.389182+00:00 app[web.1]:
2015-11-18T22:01:21.389186+00:00 app[web.1]: /app/node_modules/mongodb/lib/server.js:235
2015-11-18T22:01:21.403047+00:00 app[web.1]: npm ERR! argv "/app/.heroku/node/bin/node" "/app/.heroku/node/bin/npm" "start"
2015-11-18T22:01:21.403274+00:00 app[web.1]: npm ERR! node v5.0.0
2015-11-18T22:01:21.389187+00:00 app[web.1]: process.nextTick(function() { throw err; })
2015-11-18T22:01:21.389188+00:00 app[web.1]: ^
2015-11-18T22:01:21.389220+00:00 app[web.1]: Error: getaddrinfo ENOTFOUND undefined undefined:27017
2015-11-18T22:01:21.389223+00:00 app[web.1]: at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:77:26)
2015-11-18T22:01:21.403921+00:00 app[web.1]: npm ERR! npm v3.3.6
2015-11-18T22:01:21.389222+00:00 app[web.1]: at errnoException (dns.js:26:10)
2015-11-18T22:01:21.404128+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2015-11-18T22:01:21.398077+00:00 app[web.1]:
2015-11-18T22:01:21.404250+00:00 app[web.1]: npm ERR! shufflebod#0.0.0 start: `node ./bin/www`
2015-11-18T22:01:21.404341+00:00 app[web.1]: npm ERR! Exit status 1
2015-11-18T22:01:21.404490+00:00 app[web.1]: npm ERR!
2015-11-18T22:01:21.404594+00:00 app[web.1]: npm ERR! Failed at the shufflebod#0.0.0 start script 'node ./bin/www'.
2015-11-18T22:01:21.404805+00:00 app[web.1]: npm ERR! not with npm itself.
2015-11-18T22:01:21.404703+00:00 app[web.1]: npm ERR! This is most likely a problem with the shufflebod package,
2015-11-18T22:01:21.404901+00:00 app[web.1]: npm ERR! Tell the author that this fails on your system:
2015-11-18T22:01:21.405100+00:00 app[web.1]: npm ERR! You can get their info via:
2015-11-18T22:01:21.404998+00:00 app[web.1]: npm ERR! node ./bin/www
2015-11-18T22:01:21.405200+00:00 app[web.1]: npm ERR! npm owner ls shufflebod
2015-11-18T22:01:21.405292+00:00 app[web.1]: npm ERR! There is likely additional logging output above.
2015-11-18T22:01:21.407531+00:00 app[web.1]:
2015-11-18T22:01:21.407693+00:00 app[web.1]: npm ERR! Please include the following file with any support request:
2015-11-18T22:01:21.407785+00:00 app[web.1]: npm ERR! /app/npm-debug.log
2015-11-18T22:01:21.971588+00:00 heroku[web.1]: State changed from starting to crashed
2015-11-18T22:01:21.992188+00:00 heroku[web.1]: Process exited with status 1
2015-11-18T22:01:18.396645+00:00 heroku[web.1]: State changed from starting to crashed
2015-11-18T22:01:18.397743+00:00 heroku[web.1]: State changed from crashed to starting
2015-11-18T22:01:46.680907+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=arcane-scrubland-5339.herokuapp.com request_id=1b2efaee-c58e-4f2f-9c5d-9cac682c21e8 fwd="208.191.152.154" dyno= connect= service= status=503 bytes=
2015-11-18T22:01:48.353321+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=arcane-scrubland-5339.herokuapp.com request_id=7bbff939-36e5-4566-9556-a00e705dd48f fwd="208.191.152.154" dyno= connect= service= status=503 bytes=
2015-11-18T22:02:06.643850+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=arcane-scrubland-5339.herokuapp.com request_id=eca3d154-2aa1-4c4c-86b7-0a12d7043302 fwd="208.191.152.154" dyno= connect= service= status=503 bytes=
2015-11-18T22:02:06.931913+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=arcane-scrubland-5339.herokuapp.com request_id=fb796d4c-c4ce-4696-a019-8d1e208ad8ef fwd="208.191.152.154" dyno= connect= service= status=503 bytes=
2015-11-18T22:10:19.380625+00:00 heroku[slug-compiler]: Slug compilation started
2015-11-18T22:10:19.380667+00:00 heroku[slug-compiler]: Slug compilation finished
2015-11-18T22:10:19.245516+00:00 heroku[api]: Deploy 52e6c8e by adamcweitzman#gmail.com
2015-11-18T22:10:19.245516+00:00 heroku[api]: Release v4 created by adamcweitzman#gmail.com
2015-11-18T22:10:19.481578+00:00 heroku[web.1]: State changed from crashed to starting
2015-11-18T22:10:20.489282+00:00 heroku[web.1]: Starting process with command `nodemon bin/www`
2015-11-18T22:10:22.069790+00:00 app[web.1]: bash: nodemon: command not found
2015-11-18T22:10:22.731271+00:00 heroku[web.1]: Process exited with status 127
2015-11-18T22:10:22.755823+00:00 heroku[web.1]: State changed from starting to crashed
2015-11-18T22:10:25.421596+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=arcane-scrubland-5339.herokuapp.com request_id=fd282f48-9ccb-4e9a-ba08-2db5d503ab3e fwd="208.191.152.154" dyno= connect= service= status=503 bytes=
2015-11-18T22:10:30.012124+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=arcane-scrubland-5339.herokuapp.com request_id=5704bcfe-ad83-4a8a-ae02-b7cc590f1e7b fwd="208.191.152.154" dyno= connect= service= status=503 bytes=
so i figured a solution, not sure why it works though...
in my package.json I had node: nodemon bin/www when I needed web: node ./bin/www I do not know why this is the case, if someone could explain, that would be amazing.

NodeJS Heroku Deploying Error

When I was deploying my app to Heroku from github, on my Heroku dashboard it says my app is successfully deployed. However, when I view my app it says Application Error.
So here is my log:
2015-09-09T05:54:41.566570+00:00 heroku[web.1]: State changed from starting to crashed
2015-09-09T05:54:41.566570+00:00 heroku[web.1]: State changed from crashed to starting
2015-09-09T05:54:41.542661+00:00 heroku[web.1]: Process exited with status 1
2015-09-09T05:54:43.511445+00:00 heroku[web.1]: Starting process with command `npm start`
2015-09-09T05:54:45.973805+00:00 app[web.1]:
2015-09-09T05:54:45.973825+00:00 app[web.1]: > mark-wen-home#1.0.0 start /app
2015-09-09T05:54:45.973828+00:00 app[web.1]: > node server.js
2015-09-09T05:54:45.973829+00:00 app[web.1]:
2015-09-09T05:54:46.306616+00:00 app[web.1]: events.js:85
2015-09-09T05:54:46.306620+00:00 app[web.1]: throw er; // Unhandled 'error' event
2015-09-09T05:54:46.306621+00:00 app[web.1]: ^
2015-09-09T05:54:46.306623+00:00 app[web.1]: Error: listen EACCES
2015-09-09T05:54:46.306624+00:00 app[web.1]: at exports._errnoException (util.js:746:11)
2015-09-09T05:54:46.306625+00:00 app[web.1]: at Server._listen2 (net.js:1139:19)
2015-09-09T05:54:46.306626+00:00 app[web.1]: at listen (net.js:1182:10)
2015-09-09T05:54:46.306628+00:00 app[web.1]: at Server.listen (net.js:1267:5)
2015-09-09T05:54:46.306629+00:00 app[web.1]: at EventEmitter.listen (/app/node_modules/express/lib/application.js:617:24)
2015-09-09T05:54:46.306630+00:00 app[web.1]: at Object.<anonymous> (/app/server.js:6:18)
2015-09-09T05:54:46.306631+00:00 app[web.1]: at Module._compile (module.js:460:26)
2015-09-09T05:54:46.306633+00:00 app[web.1]: at Object.Module._extensions..js (module.js:478:10)
2015-09-09T05:54:46.306634+00:00 app[web.1]: at Module.load (module.js:355:32)
2015-09-09T05:54:46.306635+00:00 app[web.1]: at Function.Module._load (module.js:310:12)
2015-09-09T05:54:46.319744+00:00 app[web.1]:
2015-09-09T05:54:46.325322+00:00 app[web.1]: npm ERR! argv "/app/.heroku/node/bin/node" "/app/.heroku/node/bin/npm" "start"
2015-09-09T05:54:46.325562+00:00 app[web.1]: npm ERR! node v0.12.7
2015-09-09T05:54:46.325986+00:00 app[web.1]: npm ERR! npm v2.11.3
2015-09-09T05:54:46.326180+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2015-09-09T05:54:46.326474+00:00 app[web.1]: npm ERR! mark-wen-home#1.0.0 start: `node server.js`
2015-09-09T05:54:46.326627+00:00 app[web.1]: npm ERR! Exit status 1
2015-09-09T05:54:46.326774+00:00 app[web.1]: npm ERR!
2015-09-09T05:54:46.326914+00:00 app[web.1]: npm ERR! Failed at the mark-wen-home#1.0.0 start script 'node server.js'.
2015-09-09T05:54:46.327140+00:00 app[web.1]: npm ERR! This is most likely a problem with the mark-wen-home package,
2015-09-09T05:54:46.327330+00:00 app[web.1]: npm ERR! not with npm itself.
2015-09-09T05:54:46.327495+00:00 app[web.1]: npm ERR! Tell the author that this fails on your system:
2015-09-09T05:54:46.327804+00:00 app[web.1]: npm ERR! node server.js
2015-09-09T05:54:46.327908+00:00 app[web.1]: npm ERR! You can get their info via:
2015-09-09T05:54:46.328139+00:00 app[web.1]: npm ERR! npm owner ls mark-wen-home
2015-09-09T05:54:46.328335+00:00 app[web.1]: npm ERR! There is likely additional logging output above.
2015-09-09T05:54:46.331322+00:00 app[web.1]:
2015-09-09T05:54:46.331590+00:00 app[web.1]: npm ERR! Please include the following file with any support request:
2015-09-09T05:54:46.331796+00:00 app[web.1]: npm ERR! /app/npm-debug.log
2015-09-09T05:54:46.324727+00:00 app[web.1]: npm ERR! Linux 3.13.0-61-generic
2015-09-09T05:54:47.275838+00:00 heroku[web.1]: State changed from starting to crashed
2015-09-09T05:54:47.256020+00:00 heroku[web.1]: Process exited with status 1
2015-09-09T06:02:13.416277+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=mark-wen-home.herokuapp.com request_id=1ef25e3b-07c1-4d3c-b076-1340b63418b9 fwd="72.12.205.35" dyno= connect= service= status=503 bytes=
2015-09-09T06:02:13.809318+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=mark-wen-home.herokuapp.com request_id=8a4ba90e-6596-40e7-a5a0-72f829a5b90f fwd="72.12.205.35" dyno= connect= service= status=503 bytes=
And here is my server.js in case it is needed:
var express = require('express');
var app = express();
app.use(express.static(__dirname + '/public'));
var server = app.listen(80, function () {
var port = server.address().port;
console.log('Listening at port ' + port);
});
I am new to Heroku, please help me out with this, thanks.
instead of 80, try to use like this (process.env.PORT || 80))
Common issue, try this.
Add a file in your app's root directory: Procfile
It has no extensions, just Procfile
And in this Procfile, add the following
web: node ./bin/www
Recompile and repush, let us know what happens.

Resources