[SERVER-8280] copydb command always requires credentials if the destination mongod is running with authentication, even if the source is running without it Created: 22/Jan/13  Updated: 11/Jul/16  Resolved: 19/Mar/13

Status: Closed
Project: Core Server
Component/s: Admin, Security
Affects Version/s: 2.0.7, 2.2.2, 2.4.0-rc2
Fix Version/s: 2.5.0

Type: Bug Priority: Major - P3
Reporter: Robert Miyashiro 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
Duplicate
is duplicated by SERVER-10239 copydb mongod fails Closed
is duplicated by SERVER-8221 Using copyDatabase to copy from an un... Closed
is duplicated by SERVER-10197 Failure in copy database across version Closed
Operating System: ALL
Steps To Reproduce:

1. Start a mongod without --auth. This will be the 'source'.
2. Start a separate mongod with --auth. This will be the 'destination'.
3. mongo into the 'destination' mongod's admin database
4. run db.copyDatabase('fromdb', 'todb', 'source:port')

Participants:

 Description   

We are seeing an issue where a copydb command always fails in the following situation:

1. The source mongod is running WITHOUT authentication.
2. The destination mongod is running WITH authentication.
3. Credentials are NOT provided.

When the command is issued, it returns immediately with an empty error message like so:

> db.copyDatabase('fromdb', 'todb', 'from.example.com:10000')

{ "errmsg" : "", "ok" : 0 }

If we add dummy credentials to the 'fromdb' database and use those, the copy executes successfully.

It would seem that in order for this command to work without credentials BOTH the source and destination need to be running without the --auth flag. Based on the documentation, credentials should only be required if the source is running with --auth.



 Comments   
Comment by auto [ 19/Mar/13 ]

Author:

{u'date': u'2013-03-19T18:59:41Z', u'name': u'Spencer T Brody', u'email': u'spencer@10gen.com'}

Message: SERVER-8280 Rename test so it doesn't run in auth passthrough
Branch: master
https://github.com/mongodb/mongo/commit/451a73db438b08c6889df334f2cfee44cb22d59a

Comment by Eric Milkie [ 19/Mar/13 ]

This broke the copydb test on the subscription builders.

Comment by auto [ 18/Mar/13 ]

Author:

{u'date': u'2013-03-15T21:15:27Z', u'name': u'Spencer T Brody', u'email': u'spencer@10gen.com'}

Message: SERVER-8280 SERVER-7864 Make copydb command work without username/password when dest machine has auth but source does not
Branch: master
https://github.com/mongodb/mongo/commit/42676483093ae14b1f9f4a25190f0e00edcd020c

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