[SERVER-3966] mongodump won't dump a specific db/collection using admin credentials Created: 27/Sep/11  Updated: 11/Jul/16  Resolved: 03/Mar/12

Status: Closed
Project: Core Server
Component/s: Tools
Affects Version/s: 2.0.0
Fix Version/s: 2.1.1

Type: Bug Priority: Minor - P4
Reporter: Bernie Hackett Assignee: Ben Becker
Resolution: Done Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Operating System: ALL
Participants:

 Description   

Tested with a 3 node replica set using auth.

  1. Dump everything using admin credentials works:
    ./mongodump --username admin --password mypassword --out dumpfiles
    connected to: 127.0.0.1
    all dbs
    DATABASE: foo to dumpfiles/foo
    foo.things to dumpfiles/foo/things.bson
    10000 objects
    foo.system.indexes to dumpfiles/foo/system.indexes.bson
    2 objects
    foo.system.profile to dumpfiles/foo/system.profile.bson
    60 objects
    foo.system.users to dumpfiles/foo/system.users.bson
    2 objects
    DATABASE: admin to dumpfiles/admin
    admin.system.users to dumpfiles/admin/system.users.bson
    1 objects
    admin.system.indexes to dumpfiles/admin/system.indexes.bson
    1 objects
  1. Dumping a specific database using admin credentials fails
    ./mongodump --username admin --password mypassword --db foo --out dumpfiles
    connected to: 127.0.0.1
    Tue Sep 27 11:45:38 DBClientCursor::init call() failed
    assertion: 10276 DBClientBase::findN: transport error: 127.0.0.1 query: { authenticate: 1, nonce: "3112e50c77ef2be", user: "admin", key: "173615f515dc85297a54cb81933675d9" }
  1. Dumping a specific database with user credentials works
    ./mongodump --username foouser --password foopassword --db foo --out dumpfiles
    connected to: 127.0.0.1
    DATABASE: foo to dumpfiles/foo
    foo.things to dumpfiles/foo/things.bson
    10000 objects
    foo.system.indexes to dumpfiles/foo/system.indexes.bson
    2 objects
    foo.system.profile to dumpfiles/foo/system.profile.bson
    49 objects
    foo.system.users to dumpfiles/foo/system.users.bson
    2 objects


 Comments   
Comment by Ben Becker [ 02/Mar/12 ]

This was fixed by commit 02853421 (related to SERVER-4614).

Comment by Jonathan Schneider [ 24/Jan/12 ]

This is a rather annoying issue, the dump app really needs a way to auth against the admin database but dump a different specified database. Goes for mongorestore as well.
I can work around this for now by adding a backup user account to all databases and using that.

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