This error means that when we query the status history to export it we're sorting by columns that don't match the available indexes in Mongo.
Looking in the code I can see that the index on the statuseshistory collection is {"model-uuid", "globalkey", "updated"}, but in the export we're sorting by {"-updated", "-_id"} (after filtering by model-uuid).
I think one way to fix it would be to add an index on {"model-uuid", "-updated", "-_id"}. (Maybe we could fix it by querying slightly differently instead.)
The statuseshistory collection should be being trimmed by the status history pruner - can you see any messages in the logs about that? Maybe some indication of how big the collection is?
This error means that when we query the status history to export it we're sorting by columns that don't match the available indexes in Mongo.
Looking in the code I can see that the index on the statuseshistory collection is {"model-uuid", "globalkey", "updated"}, but in the export we're sorting by {"-updated", "-_id"} (after filtering by model-uuid).
I think one way to fix it would be to add an index on {"model-uuid", "-updated", "-_id"}. (Maybe we could fix it by querying slightly differently instead.)
The statuseshistory collection should be being trimmed by the status history pruner - can you see any messages in the logs about that? Maybe some indication of how big the collection is?