[SERVER-7182] Getting need to login error when trying to restore a single database Created: 27/Sep/12  Updated: 11/Jul/16  Resolved: 28/Sep/12

Status: Closed
Project: Core Server
Component/s: Tools
Affects Version/s: 2.2.0
Fix Version/s: 2.2.1, 2.3.0

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

Issue Links:
Depends
Operating System: ALL
Participants:

 Description   

Server complains that user needs to login even if it specified the right username and password for the database. Offending code in createIndex (@restore.cpp):

BSONObj err = conn().getLastErrorDetailed(false, false, _w);

The problem with the code above is getLastErrorDetailed would always run the command against the admin database, and if the user specified a database (through the -d parameter) other than admin, then this will not work.



 Comments   
Comment by auto [ 02/Oct/12 ]

Author:

{u'date': u'2012-09-28T14:43:13-07:00', u'email': u'spencer@10gen.com', u'name': u'Spencer T Brody'}

Message: SERVER-7182 Fix broken compile for mongos
Branch: v2.2
https://github.com/mongodb/mongo/commit/2ac26a3c808772c639ee0932527431aee1f4d91e

Comment by auto [ 02/Oct/12 ]

Author:

{u'date': u'2012-09-28T13:01:07-07:00', u'email': u'spencer@10gen.com', u'name': u'Spencer T Brody'}

Message: SERVER-7182 Call getLastError on the correct database in mongorestore
Branch: v2.2
https://github.com/mongodb/mongo/commit/c301b78471e055b8426a27910d9ce514defa67d6

Comment by auto [ 28/Sep/12 ]

Author:

{u'date': u'2012-09-28T14:43:13-07:00', u'email': u'spencer@10gen.com', u'name': u'Spencer T Brody'}

Message: SERVER-7182 Fix broken compile for mongos
Branch: master
https://github.com/mongodb/mongo/commit/4603ddc06daefb3b632e4cb78d3458653286cdec

Comment by auto [ 28/Sep/12 ]

Author:

{u'date': u'2012-09-28T13:01:07-07:00', u'email': u'spencer@10gen.com', u'name': u'Spencer T Brody'}

Message: SERVER-7182 Call getLastError on the correct database in mongorestore
Branch: master
https://github.com/mongodb/mongo/commit/82578579b6d548c4d641551dd1a61e3703935e15

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