After upgrading to Orion 0.22.0 (applying the documented migration procedure), Orion refuses to start, existing with the following message:
INFO@10:51:50 contextBroker.cpp[1191]: Connected to mongo at mongodb1:27017:orion
terminate called after throwing an instance of 'mongo::OperationException'
what(): OperationException: { ok: 0.0, errmsg: "Index with name:
location.coords_2dsphere already exists with different options", code: 85 }
I'm using a MongoDB replica set as database.
The solution to this issue (which we have been observed sometimes in replica set environments) is to remove the location.coords_2dsphere index, i.e. executing the following command in the mongo shell (connected to the primary node):
In the case of using Orion in multiservice mode, you have to apply the above command to each one of the tenant databases.
Orion will re-create the index next time it starts.