Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mongo error #15

Closed
alienmaster9 opened this issue Jul 3, 2018 · 2 comments
Closed

mongo error #15

alienmaster9 opened this issue Jul 3, 2018 · 2 comments

Comments

@alienmaster9
Copy link

npm start

chat.io@1.0.0 start /root/chat.io
node server.js

(node:14927) 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
{
"date": "Tue Jul 03 2018 14:51:34 GMT+0000 (UTC)",
"process": {
"pid": 14927,
"uid": 0,
"gid": 0,
"cwd": "/root/chat.io",
"execPath": "/root/.nvm/versions/node/v8.11.3/bin/node",
"version": "v8.11.3",
"argv": [
"/root/.nvm/versions/node/v8.11.3/bin/node",
"/root/chat.io/server.js"
],
"memoryUsage": {
"rss": 66256896,
"heapTotal": 56217600,
"heapUsed": 26144704,
"external": 18695889
}
},
"os": {
"loadavg": [
0.0751953125,
0.05517578125,
0.06396484375
],
"uptime": 1518
},
"trace": [
{
"column": 35,
"file": "/root/chat.io/node_modules/mongoose/node_modules/mongodb-core/lib/topologies/server.js",
"function": null,
"line": 336,
"method": null,
"native": false
},
{
"column": 13,
"file": "events.js",
"function": "emitOne",
"line": 116,
"method": null,
"native": false
},
{
"column": 7,
"file": "events.js",
"function": "Pool.emit",
"line": 211,
"method": "emit",
"native": false
},
{
"column": 12,
"file": "/root/chat.io/node_modules/mongoose/node_modules/mongodb-core/lib/connection/pool.js",
"function": null,
"line": 280,
"method": null,
"native": false
},
{
"column": 30,
"file": "events.js",
"function": "Object.onceWrapper",
"line": 317,
"method": "onceWrapper",
"native": false
},
{
"column": 13,
"file": "events.js",
"function": "emitTwo",
"line": 126,
"method": null,
"native": false
},
{
"column": 7,
"file": "events.js",
"function": "Connection.emit",
"line": 214,
"method": "emit",
"native": false
},
{
"column": 49,
"file": "/root/chat.io/node_modules/mongoose/node_modules/mongodb-core/lib/connection/connection.js",
"function": null,
"line": 187,
"method": null,
"native": false
},
{
"column": 30,
"file": "events.js",
"function": "Object.onceWrapper",
"line": 315,
"method": "onceWrapper",
"native": false
},
{
"column": 13,
"file": "events.js",
"function": "emitOne",
"line": 116,
"method": null,
"native": false
},
{
"column": 7,
"file": "events.js",
"function": "Socket.emit",
"line": 211,
"method": "emit",
"native": false
},
{
"column": 8,
"file": "internal/streams/destroy.js",
"function": "emitErrorNT",
"line": 64,
"method": null,
"native": false
},
{
"column": 11,
"file": "internal/process/next_tick.js",
"function": "_combinedTickCallback",
"line": 138,
"method": null,
"native": false
},
{
"column": 9,
"file": "internal/process/next_tick.js",
"function": "process._tickCallback",
"line": 180,
"method": "_tickCallback",
"native": false
}
],
"stack": [
"MongoError: failed to connect to server [:27017] on first connect [MongoError: getaddrinfo ENOTFOUND :27017]",
" at Pool. (/root/chat.io/node_modules/mongoose/node_modules/mongodb-core/lib/topologies/server.js:336:35)",
" at emitOne (events.js:116:13)",
" at Pool.emit (events.js:211:7)",
" at Connection. (/root/chat.io/node_modules/mongoose/node_modules/mongodb-core/lib/connection/pool.js:280:12)",
" at Object.onceWrapper (events.js:317:30)",
" at emitTwo (events.js:126:13)",
" at Connection.emit (events.js:214:7)",
" at Socket. (/root/chat.io/node_modules/mongoose/node_modules/mongodb-core/lib/connection/connection.js:187:49)",
" at Object.onceWrapper (events.js:315:30)",
" at emitOne (events.js:116:13)",
" at Socket.emit (events.js:211:7)",
" at emitErrorNT (internal/streams/destroy.js:64:8)",
" at _combinedTickCallback (internal/process/next_tick.js:138:11)",
" at process._tickCallback (internal/process/next_tick.js:180:9)"
],
"level": "error",
"message": "uncaughtException: failed to connect to server [:27017] on first connect [MongoError: getaddrinfo ENOTFOUND :27017]"
}

@anurakt27
Copy link

Did anyone find solution yet ?

@jebraili
Copy link

jebraili commented Jul 25, 2018

in index.js file inner database directory set useMongoClient true
Mongoose.connect(dbURI, { useMongoClient: true });

OmarElgabry added a commit that referenced this issue Aug 10, 2018
For version >= 4.0.0 “current URL string parser is deprecated”
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants