'Deploy to heroku' fails with Application Error, App crahshed
See original GitHub issueLogs
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
I usedDeploy to Heroku
button
I 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
Issue Analytics
- State:
- Created 7 years ago
- Comments:6
Top Results From Across the Web
Causes of Heroku H10-App Crashed Error And How To Solve ...
Missing Required Environment Variable while setting a port would cause this error because Heroku already sets a port internally, failing to set ...
Read more >First Heroku deploy failed `error code=H10` - Stack Overflow
"App crashed" has the obvious meaning: your app crashed. Look further up in your logs to see why, or heroku restart to launch...
Read more >Heroku Error Codes
H10 - App crashed. A crashed web dyno or a boot timeout on the web dyno will present this error. 2010-10-06T21:51:04 ...
Read more >Application error when deploying to Heroku - Apollo Community
I'm getting an error when deploying the server from Heroku (see ... heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" ...
Read more >Deploy to Heroku instructions result in an application error ...
Hello @madamot. I just confirmed with one of our solutions engineers that that problem is related to a change in how secrets are...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.