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

Error creating index admin.system.users during mongorestore

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.9.2
    • Affects Version/s: 1.8.0
    • Component/s: Admin
    • Labels:
      None
    • ALL

      We've had an error during mongorestore.
      This was the error mensage:

      Error creating index admin.system.users: 11000 E11000 duplicate key error index: admin.system.users.$id dup key: { : ObjectId('4d8352711a9f859ddd7de952') }

      We'd used the --drop option on mongorestore, but it created the users again without removes them. Because that, it generated the error during index creation.

      The command used for backup:
      mongodump -h HOST -uUSER -pPWD -vvvvv -o backupDIR/

      The command used for restore:
      mongorestore -h HOST -uUSER -pPWD --drop -vvvvv backupDIR/

      The complete restore log:
      Tue Mar 29 16:09:52 creating new connection to:HOST
      Tue Mar 29 16:09:52 BackgroundJob starting:
      connected to: to:HOST
      Tue Mar 29 16:09:52 drillDown: backupDIR/
      Tue Mar 29 16:09:52 drillDown: backupDIR/admin
      Tue Mar 29 16:09:52 drillDown: backupDIR/admin/system.users.bson
      Tue Mar 29 16:09:52 backupDIR/admin/system.users.bson
      Tue Mar 29 16:09:52 going into namespace [admin.system.users]
      Tue Mar 29 16:09:52 dropping
      Tue Mar 29 16:09:52 file size: 368
      Tue Mar 29 16:09:52 4 objects found
      Tue Mar 29 16:09:52 drillDown: backupDIR/admin/system.indexes.bson
      Tue Mar 29 16:09:52 backupDIR/admin/system.indexes.bson
      Tue Mar 29 16:09:52 going into namespace [admin.system.indexes]
      Tue Mar 29 16:09:52 dropping
      Tue Mar 29 16:09:52 file size: 158
      Tue Mar 29 16:09:52 { name: "id", ns: "admin.system.users", key:

      { _id: 1 }

      , v: 0 }
      Error creating index admin.system.users: 11000 E11000 duplicate key error index: admin.system.users.$id dup key: { : ObjectId('4d8352711a9f859ddd7de952') }
      To resume index restoration, run mongorestore on file backupDIR/admin/system.indexes.bson manually.
      Aborted

            Assignee:
            spencer@mongodb.com Spencer Brody (Inactive)
            Reporter:
            rdias Ricardo Dias
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: