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

mongorestore panic during convertLegacyIndexes from 4.4 mongodump

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 100.0.2
    • Affects Version/s: None
    • Component/s: None
    • None

      While testing 4.4 shared tier cluster upgrades on Atlas, we ran into some issues with the convertLegacyIndexes that was preventing mongorestore from completing:

      2020-05-08T15:03:06.079+0000	WARNING: ignoring unsupported URI parameter 'replicaset'
      2020-05-08T15:03:06.313+0000	preparing collections to restore from
      2020-05-08T15:03:06.334+0000	reading metadata for test.regular from archive on stdin
      2020-05-08T15:03:06.351+0000	restoring test.regular from archive on stdin
      2020-05-08T15:03:06.368+0000	restoring indexes for collection test.regular from metadata
      panic: interface conversion: interface {} is nil, not string
      goroutine 74 [running]:
      github.com/mongodb/mongo-tools/mongorestore.(*MongoRestore).convertLegacyIndexes(0xc0003f4fc0, 0xc000166370, 0x2, 0x3)
      	/data/mci/34ceda524db18caf8d2fad96dcc1efa2/src/github.com/mongodb/mongo-tools/mongorestore/restore.go:311 +0x21a
      github.com/mongodb/mongo-tools/mongorestore.(*MongoRestore).RestoreIntent(0xc0003f4fc0, 0xc000178000, 0x0, 0x0, 0x0, 0x0)
      	/data/mci/34ceda524db18caf8d2fad96dcc1efa2/src/github.com/mongodb/mongo-tools/mongorestore/restore.go:292 +0x854
      github.com/mongodb/mongo-tools/mongorestore.(*MongoRestore).RestoreIntents.func1(0xc0003f4fc0, 0xc0000783c0, 0x1)
      	/data/mci/34ceda524db18caf8d2fad96dcc1efa2/src/github.com/mongodb/mongo-tools/mongorestore/restore.go:98 +0x1cd
      created by github.com/mongodb/mongo-tools/mongorestore.(*MongoRestore).RestoreIntents
      	/data/mci/34ceda524db18caf8d2fad96dcc1efa2/src/github.com/mongodb/mongo-tools/mongorestore/restore.go:81 +0x12c

      The process to upgrade a shared tier involves a mongodump piped into a mongorestore.

      I was able to reproduce this with a 4.4 replica set and MongoDB Database Tools v100.0.1. To setup the source collection from the shell:

      use test
      db.regular.createIndexes([ {"a.b": 1}, {s:"text"}]);
      use test
      for (let i = 0; i < 10; i++) { 
        db.useSiblingDB("test").regular.insert({a: [{b:i}], s: ""+i});

            evgeni.dobranov@mongodb.com Evgeni Dobranov
            marko.vojvodic@mongodb.com Marko Vojvodic
            Tim Fogarty
            0 Vote for this issue
            3 Start watching this issue