来自Heroku

时间:2017-01-24 11:03:12

标签: mongodb heroku mlab

您好我在heroku上部署了我的应用程序,之后我添加了mLab:

heroku addons:create mongolab

I pushed again on heroku master and now running 
heroku logs i got this:

`enter code here`2017-01-24T10:36:48.456313+00:00 app[web.1]: designed for a production environment, as it will leak
2017-01-24T10:36:48.456314+00:00 app[web.1]: memory, and will not scale past a single process.
2017-01-24T10:36:48.494231+00:00 app[web.1]: server is running
2017-01-24T10:36:48.506464+00:00 app[web.1]: 
2017-01-24T10:36:48.506468+00:00 app[web.1]: /app/node_modules/mongodb/lib/server.js:261
2017-01-24T10:36:48.506469+00:00 app[web.1]:         process.nextTick(function() { throw err; })
2017-01-24T10:36:48.506470+00:00 app[web.1]:                                       ^
2017-01-24T10:36:48.507217+00:00 app[web.1]: MongoError: failed to connect to server [localhost:27017] on first connect
2017-01-24T10:36:48.507219+00:00 app[web.1]:     at Pool.<anonymous> (/app/node_modules/mongodb-core/lib/topologies/server.js:313:35)
2017-01-24T10:36:48.507220+00:00 app[web.1]:     at emitOne (events.js:96:13)
2017-01-24T10:36:48.507221+00:00 app[web.1]:     at Pool.emit (events.js:188:7)
2017-01-24T10:36:48.507222+00:00 app[web.1]:     at Connection.<anonymous> (/app/node_modules/mongodb-core/lib/connection/pool.js:260:12)
2017-01-24T10:36:48.507222+00:00 app[web.1]:     at Connection.g (events.js:291:16)
2017-01-24T10:36:48.507224+00:00 app[web.1]:     at Connection.emit (events.js:191:7)
2017-01-24T10:36:48.507223+00:00 app[web.1]:     at emitTwo (events.js:106:13)
2017-01-24T10:36:48.507224+00:00 app[web.1]:     at Socket.<anonymous> (/app/node_modules/mongodb-core/lib/connection/connection.js:162:49)
2017-01-24T10:36:48.507225+00:00 app[web.1]:     at Socket.g (events.js:291:16)
2017-01-24T10:36:48.507226+00:00 app[web.1]:     at emitOne (events.js:96:13)
2017-01-24T10:36:48.507227+00:00 app[web.1]:     at Socket.emit (events.js:188:7)
2017-01-24T10:36:48.507227+00:00 app[web.1]:     at emitErrorNT (net.js:1276:8)
2017-01-24T10:36:48.507228+00:00 app[web.1]:     at _combinedTickCallback (internal/process/next_tick.js:74:11)
2017-01-24T10:36:48.507229+00:00 app[web.1]:     at process._tickCallback (internal/process/next_tick.js:98:9)
2017-01-24T10:36:48.520688+00:00 app[web.1]: 
2017-01-24T10:36:48.527768+00:00 app[web.1]: npm ERR! Linux 3.13.0-105-generic
2017-01-24T10:36:48.527941+00:00 app[web.1]: npm ERR! argv "/app/.heroku/node/bin/node" "/app/.heroku/node/bin/npm" "start"
2017-01-24T10:36:48.528071+00:00 app[web.1]: npm ERR! node v6.9.1
2017-01-24T10:36:48.528171+00:00 app[web.1]: npm ERR! npm  v3.10.8
2017-01-24T10:36:48.528289+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2017-01-24T10:36:48.528387+00:00 app[web.1]: npm ERR! vet-around@1.0.0 start: `node server.js`
2017-01-24T10:36:48.528472+00:00 app[web.1]: npm ERR! Exit status 1
2017-01-24T10:36:48.528559+00:00 app[web.1]: npm ERR! 
2017-01-24T10:36:48.528645+00:00 app[web.1]: npm ERR! Failed at the vet-around@1.0.0 start script 'node server.js'.
2017-01-24T10:36:48.528716+00:00 app[web.1]: npm ERR! Make sure you have the latest version of node.js and npm installed.
2017-01-24T10:36:48.528799+00:00 app[web.1]: npm ERR! If you do, this is most likely a problem with the vet-around package,
2017-01-24T10:36:48.528868+00:00 app[web.1]: npm ERR! not with npm itself.
2017-01-24T10:36:48.529161+00:00 app[web.1]: npm ERR! Tell the author that this fails on your system:
2017-01-24T10:36:48.529211+00:00 app[web.1]: npm ERR!     node server.js
2017-01-24T10:36:48.529290+00:00 app[web.1]: npm ERR! You can get information on how to open an issue for this project with:
2017-01-24T10:36:48.529370+00:00 app[web.1]: npm ERR!     npm bugs vet-around
2017-01-24T10:36:48.529449+00:00 app[web.1]: npm ERR! Or if that isn't available, you can get their info via:
2017-01-24T10:36:48.529528+00:00 app[web.1]: npm ERR!     npm owner ls vet-around
2017-01-24T10:36:48.529606+00:00 app[web.1]: npm ERR! There is likely additional logging output above.
2017-01-24T10:36:48.533162+00:00 app[web.1]: 
2017-01-24T10:36:48.533397+00:00 app[web.1]: npm ERR! Please include the following file with any support request:
2017-01-24T10:36:48.533492+00:00 app[web.1]: npm ERR!     /app/npm-debug.log
2017-01-24T10:36:48.705142+00:00 heroku[web.1]: State changed from starting to crashed
2017-01-24T10:36:48.694130+00:00 heroku[web.1]: Process exited with status 1
2017-01-24T10:42:22.438702+00:00 heroku[web.1]: State changed from crashed to starting
2017-01-24T10:42:25.086554+00:00 heroku[web.1]: Starting process with command `npm start`
2017-01-24T10:42:27.775943+00:00 app[web.1]: 
2017-01-24T10:42:27.775958+00:00 app[web.1]: > vet-around@1.0.0 start /app
2017-01-24T10:42:27.775959+00:00 app[web.1]: > node server.js
2017-01-24T10:42:27.775960+00:00 app[web.1]: 
2017-01-24T10:42:28.526454+00:00 app[web.1]: designed for a production environment, as it will leak
2017-01-24T10:42:28.526444+00:00 app[web.1]: Warning: connect.session() MemoryStore is not
2017-01-24T10:42:28.570085+00:00 app[web.1]: server is running
2017-01-24T10:42:28.526455+00:00 app[web.1]: memory, and will not scale past a single process.
2017-01-24T10:42:28.582350+00:00 app[web.1]: 
2017-01-24T10:42:28.582352+00:00 app[web.1]: /app/node_modules/mongodb/lib/server.js:261
2017-01-24T10:42:28.582353+00:00 app[web.1]:         process.nextTick(function() { throw err; })
2017-01-24T10:42:28.582353+00:00 app[web.1]:                                       ^
2017-01-24T10:42:28.583437+00:00 app[web.1]: MongoError: failed to connect to server [localhost:27017] on first connect
2017-01-24T10:42:28.583439+00:00 app[web.1]:     at Pool.<anonymous> (/app/node_modules/mongodb-core/lib/topologies/server.js:313:35)
2017-01-24T10:42:28.583440+00:00 app[web.1]:     at Pool.emit (events.js:188:7)
2017-01-24T10:42:28.583439+00:00 app[web.1]:     at emitOne (events.js:96:13)
2017-01-24T10:42:28.583440+00:00 app[web.1]:     at Connection.<anonymous> (/app/node_modules/mongodb-core/lib/connection/pool.js:260:12)
2017-01-24T10:42:28.583441+00:00 app[web.1]:     at emitTwo (events.js:106:13)
2017-01-24T10:42:28.583440+00:00 app[web.1]:     at Connection.g (events.js:291:16)
2017-01-24T10:42:28.583441+00:00 app[web.1]:     at Connection.emit (events.js:191:7)
2017-01-24T10:42:28.583442+00:00 app[web.1]:     at Socket.<anonymous> (/app/node_modules/mongodb-core/lib/connection/connection.js:162:49)
2017-01-24T10:42:28.583442+00:00 app[web.1]:     at Socket.g (events.js:291:16)
2017-01-24T10:42:28.583443+00:00 app[web.1]:     at emitOne (events.js:96:13)
2017-01-24T10:42:28.583443+00:00 app[web.1]:     at Socket.emit (events.js:188:7)
2017-01-24T10:42:28.583443+00:00 app[web.1]:     at emitErrorNT (net.js:1276:8)
2017-01-24T10:42:28.583444+00:00 app[web.1]:     at _combinedTickCallback (internal/process/next_tick.js:74:11)
2017-01-24T10:42:28.583444+00:00 app[web.1]:     at process._tickCallback (internal/process/next_tick.js:98:9)
2017-01-24T10:42:28.596975+00:00 app[web.1]: 
2017-01-24T10:42:28.608391+00:00 app[web.1]: npm ERR! Linux 3.13.0-105-generic
2017-01-24T10:42:28.608691+00:00 app[web.1]: npm ERR! argv "/app/.heroku/node/bin/node" "/app/.heroku/node/bin/npm" "start"
2017-01-24T10:42:28.609000+00:00 app[web.1]: npm ERR! node v6.9.1
2017-01-24T10:42:28.609238+00:00 app[web.1]: npm ERR! npm  v3.10.8
2017-01-24T10:42:28.609423+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2017-01-24T10:42:28.609567+00:00 app[web.1]: npm ERR! vet-around@1.0.0 start: `node server.js`
2017-01-24T10:42:28.609692+00:00 app[web.1]: npm ERR! Exit status 1
2017-01-24T10:42:28.609831+00:00 app[web.1]: npm ERR! 
2017-01-24T10:42:28.609958+00:00 app[web.1]: npm ERR! Failed at the vet-around@1.0.0 start script 'node server.js'.
2017-01-24T10:42:28.610082+00:00 app[web.1]: npm ERR! Make sure you have the latest version of node.js and npm installed.
2017-01-24T10:42:28.610206+00:00 app[web.1]: npm ERR! If you do, this is most likely a problem with the vet-around package,
2017-01-24T10:42:28.610332+00:00 app[web.1]: npm ERR! not with npm itself.
2017-01-24T10:42:28.610483+00:00 app[web.1]: npm ERR! Tell the author that this fails on your system:
2017-01-24T10:42:28.610585+00:00 app[web.1]: npm ERR!     node server.js
2017-01-24T10:42:28.610711+00:00 app[web.1]: npm ERR! You can get information on how to open an issue for this project with:
2017-01-24T10:42:28.610834+00:00 app[web.1]: npm ERR!     npm bugs vet-around
2017-01-24T10:42:28.610956+00:00 app[web.1]: npm ERR! Or if that isn't available, you can get their info via:
2017-01-24T10:42:28.611082+00:00 app[web.1]: npm ERR!     npm owner ls vet-around
2017-01-24T10:42:28.611203+00:00 app[web.1]: npm ERR! There is likely additional logging output above.
2017-01-24T10:42:28.615378+00:00 app[web.1]: 
2017-01-24T10:42:28.615576+00:00 app[web.1]: npm ERR! Please include the following file with any support request:
2017-01-24T10:42:28.615701+00:00 app[web.1]: npm ERR!     /app/npm-debug.log
2017-01-24T10:42:28.708534+00:00 heroku[web.1]: State changed from starting to crashed
2017-01-24T10:42:28.691938+00:00 heroku[web.1]: Process exited with status 1

有人可以帮我吗? 我也得到了我的MONGODB_URI,但我不知道在哪里使用它,因为我像这样连接到数据库:

  

mongoose.connect(process.env.MONGOLAB_URI || process.env.MONGOHQ_URL ||&#39; mongodb:// localhost / VetAround&#39;);

谢谢!

0 个答案:

没有答案