[SERVER-13046] User Authentication Created: 05/Mar/14  Updated: 10/Dec/14  Resolved: 05/Mar/14

Status: Closed
Project: Core Server
Component/s: Admin, Shell, Usability
Affects Version/s: 2.6.0-rc0
Fix Version/s: None

Type: Question Priority: Major - P3
Reporter: Daniel Martinez Assignee: Spencer Brody (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Description   

I found incompatibility between the authentication system between v2.4.9 and the v2.6.

This is the message:

2014-03-05T10:51:57.986-0500 Error: 18 { ok: 0.0, errmsg: "auth failed", code: 18 } at src/mongo/shell/db.js:1205
exception: login failed



 Comments   
Comment by Daniel Martinez [ 06/Mar/14 ]

For now I have decide to use the old version until RC be completed.

Comment by Daniel Martinez [ 05/Mar/14 ]

Thanks Andy for the reply.

Comment by Andy Schwerin [ 05/Mar/14 ]

This is happening because you have no users in your "admin" database. MongoDB 2.6 assumes that users upgrading from 2.4 with auth enabled will have at least one user in the admin database, since you need one to administer the cluster. Since your test database has no such user, this assumption was false, and you hit this behavior.

Before upgrading from 2.4 to 2.6, make sure you have at least one user in your "admin" database.

We will update our documentation.

Comment by Daniel Martinez [ 05/Mar/14 ]

I make a mistake, with the version: v2.4.5 (I have running an node.js app and I making tests with 2.4.9 in other server)

Steps to reproduce:

mkdir /data/testauth
/mongodb2.4.5/bin/mongod --dbpath /data/testauth/ &
/mongodb2.4.5/bin/mongo
>db.addUser( { user: "author", pwd: "pass", roles: [ "readWrite" ] } )
exit

Then
kill mongodb process and confirm auth

/mongodb2.4.5/bin/mongod --dbpath /data/testauth/ --auth &
/mongodb2.4.5/bin/mongo test --username author --password pass

Now stop v2.4.5 and start v2.6 server
try to login with

mongo test --username author --password pass

I am getting

2014-03-05T13:21:50.133-0500 Error: 18 { ok: 0.0, errmsg: "auth failed", code: 18 } at src/mongo/shell/db.js:1205
exception: login failed

Comment by Andy Schwerin [ 05/Mar/14 ]

The following link offers upgrade instructions. They still say they're for upgrading to 2.5, but they hold for the release candidates, as well. http://docs.mongodb.org/master/release-notes/2.6-upgrade/

As to your particular problem, can you elaborate a little? You ought to be able to just start the 2.6 RC with authentication enabled and start working. Nothing about the authentication protocol between clients and servers changed, and version 2.6 starts up in a 2.4 compatibility mode when you upgrade, and remains there until you take action to enable new auth functionality. Can you describe a specific set of steps to reproduce the problem?

Comment by Daniel Martinez [ 05/Mar/14 ]

http://docs.mongodb.org/master/core/authentication/#mongodb-cr-authentication

I am not sure how to upgrade from v2.4.9 to 2.6RC.

Generated at Thu Feb 08 03:30:28 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.