Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-8280

copydb command always requires credentials if the destination mongod is running with authentication, even if the source is running without it

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.5.0
    • Affects Version/s: 2.0.7, 2.2.2, 2.4.0-rc2
    • Component/s: Admin, Security
    • None
    • ALL
    • Hide

      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')

      Show
      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')

      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.

            Assignee:
            spencer@mongodb.com Spencer Brody (Inactive)
            Reporter:
            robjectlabs Robert Miyashiro
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: