Mongod process keep crashing with index caused by :: Index with name:XXXX already exists with different options

Hi Team,

Mongod keep crashing with index caused by :: Index with name:XXXX already exists with different options
Follwing the error log

","attr":{"numOperationsInBatch":1,"firstOperation":{"op":"c","ns":"XXXX.$cmd","ui":{"$uuid":"02be1ab8-a92a-4e26-8e14-fd462652efa5"},"o":{"createIndexes":"CandidatesList","v":2,"key":{"applySources":1.0},"name":"applySources_1","background":true,"sparse":true},"ts":{"$timestamp":{"t":1658569709,"i":411}},"t":101,"v":2,"wall":{"$date":"2022-07-23T09:48:29.801Z"}},"lastOperation":{"op":"c","ns":"XXX.$cmd","ui":{"$uuid":"02be1ab8-a92a-4e26-8e14-fd462652efa5"},"o":{"createIndexes":"CandidatesCollections","v":2,"key":{"applySources":1.0},"name":"applySources_1","background":true,"sparse":true},"ts":{"$timestamp":{"t":1658569709,"i":411}},"t":101,"v":2,"wall":{"$date":"2022-07-23T09:48:29.801Z"}},"failedWriterThread":12,"error":"IndexOptionsConflict: index build on empty collection failed: 9d4b83fe-6abc-4146-aae8-ecbe23d29325 :: caused by :: Index with name: applySources_1 already exists with different options"}}
{"t":{"$date":"2022-07-23T18:46:40.328+00:00"},"s":"F",  "c":"-",        "id":23095,   "ctx":"OplogApplier-0","msg":"Fatal assertion","attr":{"msgid":34437,"error":"IndexOptionsConflict: index build on empty collection failed: 9d4b83fe-6abc-4146-aae8-ecbe23d29325 :: caused by :: Index with name: applySources_1 already exists with different options","file":"src/mongo/db/repl/oplog_applier_impl.cpp","line":511}}
{"t":{"$date":"2022-07-23T18:46:40.328+00:00"},"s":"F",  "c":"-",        "id":23096,   "ctx":"OplogApplier-0","msg":"\n\n***aborting after fassert() failure\n\n"}

We are notable start the mongod process as its failed the above error .
Percona mongodb is running 4.4.14-14
Even try to start the mongod in standalone mode from replica , still hitting the same error
i tried to start mongod with --noIndexRebuild options , its removed from 4.4
Can you help to fix the issues.

Hello @Murali_Kumpatla

According to the log snippet the OplogApplier fails to create index because it already exists. So your idea is correct - you need to start that instance with replication disabled and remove existing index.
I’m not sure why your attempt to do that has failed. Can you provide startup log of the mongod started in standalone mode?

1 Like