0
2017-09-03T18:50:57.000000+00:00 app[api]: Build started by user 
[me]
2017-09-03T18:51:28.776809+00:00 heroku[web.1]: State changed from 
crashed to starting
2017-09-03T18:51:28.572116+00:00 app[api]: Deploy 20b0544e by user 
[me]
2017-09-03T18:51:28.572116+00:00 app[api]: Release v22 created by 
user [me]
2017-09-03T18:50:57.000000+00:00 app[api]: Build succeeded
2017-09-03T18:51:30.798246+00:00 heroku[web.1]: Starting process with 
command `node index.js`
2017-09-03T18:51:34.045108+00:00 app[web.1]: Sun, 03 Sep 2017 
18:51:34 GMT body-parser deprecated bodyParser: use individual 
json/urlencoded middlewares at index.js:95:9
2017-09-03T18:51:34.047680+00:00 app[web.1]: Sun, 03 Sep 2017 
18:51:34 GMT body-parser deprecated undefined extended: provide 
extended option at node_modules/body-parser/index.js:105:29
2017-09-03T18:51:34.050039+00:00 app[web.1]: Sun, 03 Sep 2017 
18:51:34 GMT express-session deprecated undefined resave option; 
provide resave option at index.js:111:9
2017-09-03T18:51:34.050243+00:00 app[web.1]: memory, and will not 
scale past a single process.
2017-09-03T18:51:34.142994+00:00 app[web.1]: listening on *:5000
2017-09-03T18:51:34.050242+00:00 app[web.1]: designed for a 
production environment, as it will leak
2017-09-03T18:51:34.158304+00:00 app[web.1]: failed to connect to 
server [localhost:27017] on first connect [MongoError: connect 
ECONNREFUSED 127.0.0.1:27017]
2017-09-03T18:51:34.141487+00:00 app[web.1]: (node:4) 
DeprecationWarning: `open()` is deprecated in mongoose >= 4.11.0, use 
`openUri()` instead, or set the `useMongoClient` option if using 
`connect()` or `createConnection()`. See 
http://mongoosejs.com/docs/connections.html#use-mongo-client
2017-09-03T18:51:34.050241+00:00 app[web.1]: Warning: 
connect.session() MemoryStore is not
2017-09-03T18:51:34.050168+00:00 app[web.1]: Sun, 03 Sep 2017 
18:51:34 GMT express-session deprecated undefined saveUninitialized 
option; provide saveUninitialized option at index.js:111:9
2017-09-03T18:51:34.165093+00:00 app[web.1]: 
Db.prototype.authenticate method will no longer be available in the 
next major release 3.x as MongoDB 3.6 will only allow auth against      
users in the admin db and will no longer allow multiple credentials 
on a socket. Please authenticate using MongoClient.connect with auth 
credentials.

So I've been trying to deploy my Node.js application on Heroku for a few days now with little success.This indeed has caused some frustration since I need this app running on my website. Running the command heroku local web renders a working version of the application on port 5000.

2017-09-03T18:51:34.158304+00:00 app[web.1]: failed to connect to 
server [localhost:27017] on first connect [MongoError: connect 
ECONNREFUSED 127.0.0.1:27017]

I think this means that it is a problem with the MongoDB database I am using. I am using mLab as a database when the application is deployed in production. I have added the required connections for mLab in my code but it does not work. I really would appreciate it if someone could help me?

Also, do I need to deploy the modules installed with npm install to heroku for the application to work? I think it might be an issue with the packages installed when npm install is run. Could someone pin-point me to the issue?

Here is a link to the code, maybe download the files and take a look and test out the application locally and try deploying it to Heroku yourself if possible.

craynawsum
  • 11
  • 3

1 Answers1

0

its because you need to change the urls there

ps: do not let your database credentials in an open source repository...

Constantin Guidon
  • 1,892
  • 16
  • 21
  • I tried doing that but it did not work, still getting the same error. I also have this error maybe it rings a bell? And yes thanks for the heads up, I only am showing the db in open space repo for the purpose of asking this question. I will delete it after. Warning: connect.session() MemoryStore is not 2017-09-03T21:38:51.949247+00:00 app[web.1]: designed for a production environment, as it will leak 2017-09-03T21:38:51.949248+00:00 app[web.1]: memory, and will not scale past a single process. – craynawsum Sep 03 '17 at 21:42
  • its working for me did you commit your files ? for the other problems, its seems your boilerplate is really old and use many deprecated stuff and there is so much lava flow... I get this error also: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch you can grab a fix here (https://stackoverflow.com/questions/15693192/heroku-node-js-error-web-process-failed-to-bind-to-port-within-60-seconds-of) – Constantin Guidon Sep 03 '17 at 22:01
  • I commited my files to heroku https://mysterious-sands-16659.herokuapp.com/ – craynawsum Sep 03 '17 at 22:11
  • Hey I looked at the solution you sent a link to and my application worked!!! Thank you so much :D You are awesome. Gave you a +1 – craynawsum Sep 03 '17 at 22:18