Uploaded image for project: 'MongoDB Database Tools'
  1. MongoDB Database Tools
  2. TOOLS-114

mongorestore --drop sometimes reports duplicate ID violation restoring system.js

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: Legacy C++ Implementation
    • Component/s: mongorestore
    • None
    • Environment:
      Windows 7 64bit
    • Platforms 2017-01-23, Platforms 2017-02-13

      When trying to restore a database dumped with mongodump via mongorestore:

       mongorestore --drop --host localhost --db mydb mydumpdir\mydb 

      I sometimes get:

      ERROR: Error creating index mydb.system.js: 11000 err: "E11000 duplicate key error index: mydb.system.js.$id dup key: { : "myfunction" }"

      This only happens on the second restore after a manual drop, i.e. if I manually drop the database and then restore it, it restores fine; a second restore would error out with a duplicate key error; but any subsequent invocation of the same restore command (without manual dropping) succeeds.

            Assignee:
            gabriel.russell@mongodb.com Gabriel Russell (Inactive)
            Reporter:
            avish Avishay Lavie
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: