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

Mongoose connect throwing some warning #5333

Closed
daverbj opened this issue Jun 7, 2017 · 5 comments
Closed

Mongoose connect throwing some warning #5333

daverbj opened this issue Jun 7, 2017 · 5 comments

Comments

@daverbj
Copy link

daverbj commented Jun 7, 2017

My connection string like this

mongodb://root:pass@127.0.0.1:27017/ai?authSource=admin

Everything working good but getting a wired message at the shell.

Db.prototype.authenticate method will no longer be available in the next major release 3.x as MongoDB 3.6 will only allow auth against users in the admin db and will no longer allow multiple credentials on a socket. Please authenticate using MongoClient.connect with auth credentials.

For what is this ?

@sobafuchs
Copy link
Contributor

this is a duplicate of #5304

@kiupets
Copy link

kiupets commented Jun 29, 2017

Db.prototype.authenticate method will no longer be available in the next major release 3.x as MongoDB 3.6 will only allow auth against users in the admin db and will no longer allow multiple credentials on a socket. Please authenticate using MongoClient.connect with auth credentials.
MongoDB connection error: { MongoError: Authentication failed.
at Function.MongoError.create (C:\Users\gonza\Desktop\myapp\express-locallibrary-tutorial\node_modules\mongodb-core\lib\error.js:31:11)
at C:\Users\gonza\Desktop\myapp\express-locallibrary-tutorial\node_modules\mongodb-core\lib\connection\pool.js:497:72
at authenticateStragglers (C:\Users\gonza\Desktop\myapp\express-locallibrary-tutorial\node_modules\mongodb-core\lib\connection\pool.js:443:16)
at Connection.messageHandler (C:\Users\gonza\Desktop\myapp\express-locallibrary-tutorial\node_modules\mongodb-core\lib\connection\pool.js:477:5)
at Socket. (C:\Users\gonza\Desktop\myapp\express-locallibrary-tutorial\node_modules\mongodb-core\lib\connection\connection.js:321:22)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at readableAddChunk (_stream_readable.js:176:18)
at Socket.Readable.push (_stream_readable.js:134:10)
at TCP.onread (net.js:548:20)
name: 'MongoError',
message: 'Authentication failed.',
ok: 0,
code: 18,
errmsg: 'Authentication failed.' }

Can someone helllllp meeee!!!!

@ToTopNeo
Copy link

ToTopNeo commented Jul 5, 2017

message: 'Authentication failed.',
ok: 0,
code: 18,
errmsg: 'Authentication failed.' }
all these messages shows you are not allowed to log in database , you can check user&passwd&database,

@UmarEhsan
Copy link

For Db.prototype.authenticate method will no longer be available Error try this.
var mongoose = require('mongoose');
mongoose.Promise = global.Promise;

mongoose.connect( "mongodb://username:password@ds125146.mlab.com:25146/dbName'", { useMongoClient: true } );

For MongoLab
Make sure you are using the database username and password not the account username and password from Mlab.
In MLab, formerly MongoLab, do the following
Navigate to Users
@add Database User
Choose your username and password

@vkarpov15
Copy link
Collaborator

Set useMongoClient: true and this warning will go away

@Automattic Automattic locked and limited conversation to collaborators Dec 9, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants