1

I migrated MongoDB from 3.2 to 5.0.2 step b step. I am trying to take mongodump.

For this I used the following command:

mongodump --db testdb --authenticationDatabase admin --username test123 --password pwd123  --out /var/backups/mongobackups/`date +"%m-%d-%y"`

I am getting the following error.

Failed: error dumping metadata: (Location5254501) Could not parse catalog entry while replying to listIndexes

Please help us on this to resolve.

abbas-ak
  • 642
  • 3
  • 13
  • Did you also install the new database tools? – Joe Sep 03 '21 at 09:30
  • @Joe Yes it was up to date and part of MongoDB installation. In MongoDB 5 even I am not able to list index db.employee.getIndexes() gives me the same error. So I uninstall and re-install MongoDB 3.2 and I restore db. Now I am able to view list index in 3.2. But need to find why indexes are failing after migration. – abbas-ak Sep 03 '21 at 11:47
  • It will be hard to diagnose the problem without examining the metadata for the indexes. Probably easiest to restore without the indexes and rebuild them: https://stackoverflow.com/a/41036997/2282634 – Joe Sep 03 '21 at 19:33

1 Answers1

1

In case someone is stuck with this error after updating MongoDB, the error is caused by bad indexes in the database. If you run db.XXX.validate() on each collection (where XXX is the name of the collection) it should tell which ones have problems. The validate command also instructs how to fix them. If nothing else works, you can delete and recreate the invalid indexes.

Guy Incognito
  • 344
  • 2
  • 6
  • 10