[SERVER-7160] Mongorestore doesn't auth against admin DB when using username and password arguments Created: 25/Sep/12 Updated: 30/Oct/15 Resolved: 26/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: |
|
||||||||||||||||||||
| Operating System: | ALL | ||||||||||||||||||||
| Participants: | |||||||||||||||||||||
| Description |
|
The problem is the only way to specify the database to authenticate to is to use the -d parameter, this parameter also means the target database to restore to. And with -d specified, you can only restore single db at time. Current work around is to either (1) temporarily turn off auth or (2) add users with write privilege for every database you want to restore. Other tools probably have the same issue. |
| Comments |
| Comment by auto [ 02/Oct/12 ] |
|
Author: {u'date': u'2012-09-26T08:54:55-07:00', u'email': u'spencer@10gen.com', u'name': u'Spencer T Brody'}Message: |
| Comment by auto [ 26/Sep/12 ] |
|
Author: {u'date': u'2012-09-26T08:54:55-07:00', u'email': u'spencer@10gen.com', u'name': u'Spencer T Brody'}Message: |
| Comment by Spencer Brody (Inactive) [ 26/Sep/12 ] |
|
Seems to me that rather than add a new parameter to mongorestore, it should just assume it should auth against the admin DB when doing a full restore. It actually tries to do this, but the problem is that it's first trying to auth with the db specified, which in a full restore is the empty string "". Seems that in 2.0 running the auth commands against an emtpy database string didn't cause an error, but it does now in 2.2. Skipping the auth attempt in mongorestore against the empty db name should allow it to get to the auth against the admin db, resolving this issue. CR coming soon. |