2016-05-22T20:34:28.911247+00:00 heroku[web.1]: State changed from crashed to starting
2016-05-22T20:34:43.130790+00:00 heroku[web.1]: Starting process with command `node keystone.js`
2016-05-22T20:34:45.412256+00:00 app[web.1]: { [Error: ENOENT: no such file or directory, open '.env'] errno: -2, code: 'ENOENT', syscall: 'open', path: '.env' }
2016-05-22T20:34:48.943331+00:00 app[web.1]: { [Error: Cannot find module '../build/Release/bson'] code: 'MODULE_NOT_FOUND' }
2016-05-22T20:34:48.943687+00:00 app[web.1]: js-bson: Failed to load c++ bson extension, using pure JS version
2016-05-22T20:34:49.536957+00:00 app[web.1]: ------------------------------------------------
2016-05-22T20:34:49.536976+00:00 app[web.1]: Mongo Error:
2016-05-22T20:34:49.536983+00:00 app[web.1]:
2016-05-22T20:34:49.537300+00:00 app[web.1]: [Error: failed to connect to [localhost:27017]]
2016-05-22T20:34:49.539686+00:00 app[web.1]: /app/node_modules/keystone/lib/core/mount.js:630
2016-05-22T20:34:49.539694+00:00 app[web.1]: throw new Error('KeystoneJS (' + keystone.get('name') + ') failed to start');
2016-05-22T20:34:49.539695+00:00 app[web.1]: ^
2016-05-22T20:34:49.539695+00:00 app[web.1]:
2016-05-22T20:34:49.539696+00:00 app[web.1]: Error: KeystoneJS (KeystoneJS) failed to start
2016-05-22T20:34:49.539697+00:00 app[web.1]: at NativeConnection.<anonymous> (/app/node_modules/keystone/lib/core/mount.js:630:10)
2016-05-22T20:34:49.539697+00:00 app[web.1]: at emitOne (events.js:90:13)
2016-05-22T20:34:49.539698+00:00 app[web.1]: at NativeConnection.emit (events.js:182:7)
2016-05-22T20:34:49.539698+00:00 app[web.1]: at NativeConnection.Connection.error (/app/node_modules/mongoose/lib/connection.js:389:8)
2016-05-22T20:34:49.539699+00:00 app[web.1]: at /app/node_modules/mongoose/lib/connection.js:416:14
2016-05-22T20:34:49.539700+00:00 app[web.1]: at /app/node_modules/mongoose/lib/drivers/node-mongodb-native/connection.js:57:21
2016-05-22T20:34:49.539701+00:00 app[web.1]: at /app/node_modules/mongoose/node_modules/mongodb/lib/mongodb/db.js:286:18
2016-05-22T20:34:49.539701+00:00 app[web.1]: at /app/node_modules/mongoose/node_modules/mongodb/lib/mongodb/db.js:365:7
2016-05-22T20:34:49.539702+00:00 app[web.1]: at _combinedTickCallback (internal/process/next_tick.js:67:7)
2016-05-22T20:34:49.539705+00:00 app[web.1]: at process._tickCallback (internal/process/next_tick.js:98:9)
2016-05-22T20:34:50.542000+00:00 heroku[web.1]: Process exited with status 1
2016-05-22T20:34:50.589663+00:00 heroku[web.1]: State changed from starting to crashed
Deploy to Heroku buttonI deployed the app twice, both times got same error.
I was able to remove the following errors:
Removed this error { [Error: ENOENT: no such file or directory, open '.env'] errno: -2, code: 'ENOENT', syscall: 'open', path: '.env' } by removing the .env file from .gitignore.
Lost js-bson: Failed to load c++ bson extension, using pure JS version error by changing node_modules/bson/ext line 19 to just bson = require('bson')
Application Error still persists when I open the app page on heroku
You should not be removing the .env from your .gitignore. Instead you should go to Setting on your Heroku admin panel and add the items from your .env to the Config Variables section.
The bson warning is nothing that should worry about too much.
The real issue is that your Keystone app can't seem to connect to your database here. Make sure that you added mLab Mongo DB as an add-on on Heroku and I think I had to add a config variable with the key MONGODB_URI and as value have the url to your mongo db instance (you can find that within the mLab add-on)
Error still persists
We're closing all questions and support requests to keep the issue tracker unpolluted. Please ask this question on Stackoverflow or Gitter instead!
This definitely doesn't seem like a problem with Keystone, but rather with your specific setup. Are you sure you can connect to your database?
Finally fixed it
you have to make sure that when you create addon for mongolab, then the key to the config that Heroku sets automatically is MONGOLAB_URL..
The default is MONGODB_URI
Thanks
Go to your heroku dashboard and reveal your app's config variables on the app's settings page. There you'll notice that the mongolab mongodb connection string has the key MONGODB_URI. What I did was copy the value of the key and then deleted the config variable. I then created a new variable MONGO_URI and pasted the value. The app automatically restarted and worked like magic since.
I can't get it to work
Most helpful comment
Finally fixed it
you have to make sure that when you create addon for mongolab, then the key to the config that Heroku sets automatically is MONGOLAB_URL..
The default is MONGODB_URI
Thanks