Posts

Showing posts from February, 2016

MongoDB Auth Failed

So I logged in to new MongoDB server via currently installed mongo shell. Even though provided credentials were correct, I was receiving:

exception: login failed$ mongo mongosrver:27017/admin -ssl --sslAllowInvalidCertificates -u root -p password MongoDB shell version: 2.6.10 connecting to: mongoserver:27017/admin 2016-05-26T15:53:45.952+0100 Error: 18 { ok: 0.0, errmsg: "auth failed", code: 18 } at src/mongo/shell/db.js:1287 exception: login failed After much struggle, I came across a forum thread and got the clue that Mongo server and client might be mismatched.

I had 2.6.1 installed: 
$ mongo --version version 2.6.10 And it was the latest version in ubuntu repositories:

$ sudo apt show mongodb-clients Package: mongodb-clients Version: 1:2.6.10-0ubuntu1 Priority: optional Section: universe/database Source: mongodb Origin: Ubuntu Maintainer: Ubuntu Developers Therefore, I had to download the package from Mongo official repos.

Adding the mongo repo key:

$ sudo apt-key adv -…