samyun / southwest-price-drop-bot

Bot that watches Southwest flights for price drops.
Other
74 stars 41 forks source link

Crash when deploying to Heroku #51

Closed flyize closed 4 years ago

flyize commented 5 years ago

I'm getting the following error when deploying this new version to Heroku.

2019-07-02T15:01:39+00:00 app[heroku-redis]: source=REDIS addon=redis-concentric-47016 sample#active-connections=1 sample#load-avg-1m=0.05 sample#load-avg-5m=0.115 sample#load-avg-15m=0.115 sample#read-iops=0 sample#write-iops=0 sample#memory-total=15664228kB sample#memory-free=11924100kB sample#memory-cached=728028kB sample#memory-redis=309016bytes sample#hit-rate=0.61501 sample#evicted-keys=0 2019-07-02T15:04:07.641004+00:00 heroku[web.1]: Starting process with commandnpm run start 2019-07-02T15:04:09.817109+00:00 app[web.1]: 2019-07-02T15:04:09.817130+00:00 app[web.1]: > southwest-price-drop-bot@3.1.4 start /app 2019-07-02T15:04:09.817132+00:00 app[web.1]: > node --trace-warnings index.js 2019-07-02T15:04:09.817134+00:00 app[web.1]: 2019-07-02T15:04:11.197286+00:00 app[web.1]: 2019-07-02T15:04:11.197322+00:00 app[web.1]: /app/node_modules/mongoose/lib/connection.js:465 2019-07-02T15:04:11.197325+00:00 app[web.1]: throw new MongooseError('Theuriparameter toopenUri()must be a ' + 2019-07-02T15:04:11.197327+00:00 app[web.1]: ^ 2019-07-02T15:04:11.197340+00:00 app[web.1]: Error [MongooseError]: Theuriparameter toopenUri()must be a string, got "undefined". Make sure the first parameter tomongoose.connect()ormongoose.createConnection()is a string. 2019-07-02T15:04:11.197343+00:00 app[web.1]: at new MongooseError (/app/node_modules/mongoose/lib/error/mongooseError.js:14:11) 2019-07-02T15:04:11.197345+00:00 app[web.1]: at NativeConnection.Connection.openUri (/app/node_modules/mongoose/lib/connection.js:465:11) 2019-07-02T15:04:11.197347+00:00 app[web.1]: at Mongoose.connect (/app/node_modules/mongoose/lib/index.js:289:15) 2019-07-02T15:04:11.197349+00:00 app[web.1]: at Object.<anonymous> (/app/lib/mongo.js:4:10) 2019-07-02T15:04:11.197351+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:776:30) 2019-07-02T15:04:11.197353+00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10) 2019-07-02T15:04:11.197355+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:643:32) 2019-07-02T15:04:11.197357+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:556:12) 2019-07-02T15:04:11.197359+00:00 app[web.1]: at Module.require (internal/modules/cjs/loader.js:683:19) 2019-07-02T15:04:11.197361+00:00 app[web.1]: at require (internal/modules/cjs/helpers.js:16:16) 2019-07-02T15:04:11.197363+00:00 app[web.1]: at Object.<anonymous> (/app/lib/bot/flight.js:1:18) 2019-07-02T15:04:11.197364+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:776:30) 2019-07-02T15:04:11.197366+00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10) 2019-07-02T15:04:11.197368+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:643:32) 2019-07-02T15:04:11.197370+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:556:12) 2019-07-02T15:04:11.197372+00:00 app[web.1]: at Module.require (internal/modules/cjs/loader.js:683:19) 2019-07-02T15:04:11.197374+00:00 app[web.1]: at require (internal/modules/cjs/helpers.js:16:16) 2019-07-02T15:04:11.197376+00:00 app[web.1]: at Object.<anonymous> (/app/lib/bot/alert.js:6:16) 2019-07-02T15:04:11.197378+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:776:30) 2019-07-02T15:04:11.197379+00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10) 2019-07-02T15:04:11.197382+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:643:32) 2019-07-02T15:04:11.197384+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:556:12) 2019-07-02T15:04:11.197386+00:00 app[web.1]: at Module.require (internal/modules/cjs/loader.js:683:19) 2019-07-02T15:04:11.197388+00:00 app[web.1]: at require (internal/modules/cjs/helpers.js:16:16) 2019-07-02T15:04:11.197390+00:00 app[web.1]: at Object.<anonymous> (/app/lib/apps/app.js:5:15) 2019-07-02T15:04:11.197392+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:776:30) 2019-07-02T15:04:11.197394+00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10) 2019-07-02T15:04:11.197396+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:643:32) { 2019-07-02T15:04:11.197398+00:00 app[web.1]: message: 'Theuriparameter toopenUri()must be a string, got "undefined". Make sure the first parameter tomongoose.connect()ormongoose.createConnection()is a string.', 2019-07-02T15:04:11.197401+00:00 app[web.1]: name: 'MongooseError' 2019-07-02T15:04:11.197403+00:00 app[web.1]: } 2019-07-02T15:04:11.210567+00:00 app[web.1]: npm ERR! code ELIFECYCLE 2019-07-02T15:04:11.210765+00:00 app[web.1]: npm ERR! errno 1 2019-07-02T15:04:11.211690+00:00 app[web.1]: npm ERR! southwest-price-drop-bot@3.1.4 start:node --trace-warnings index.js 2019-07-02T15:04:11.211839+00:00 app[web.1]: npm ERR! Exit status 1 2019-07-02T15:04:11.212065+00:00 app[web.1]: npm ERR! 2019-07-02T15:04:11.212271+00:00 app[web.1]: npm ERR! Failed at the southwest-price-drop-bot@3.1.4 start script. 2019-07-02T15:04:11.212515+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above. 2019-07-02T15:04:11.220007+00:00 app[web.1]: 2019-07-02T15:04:11.220229+00:00 app[web.1]: npm ERR! A complete log of this run can be found in: 2019-07-02T15:04:11.220316+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2019-07-02T15_04_11_214Z-debug.log 2019-07-02T15:04:11.299612+00:00 heroku[web.1]: State changed from starting to crashed 2019-07-02T15:04:11.282421+00:00 heroku[web.1]: Process exited with status 1 2019-07-02T15:04:18.742172+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=*.herokuapp.com request_id=c3d850fd-a914-474b-970f-df695208aa57 fwd="*" dyno= connect= service= status=503 bytes= protocol=https

flyize commented 5 years ago

Well that didn't C&P well.

https://pastebin.com/ue12c5n1

iloveitaly commented 5 years ago

@flyize my hunch is you didn't install mongodb

samyun commented 5 years ago

Yeah, assuming you deployed over an existing installation, you need to manually install the mLab MongoDB add-on, and manually copy over existing alerts.