mongodbmongodb-atlasmongodb-atlas-search

MongoDB "PlanExecutor error during aggregation :: caused by :: service temporarily unavailable" when trying to list search indexes on a collection


I started getting this error recently.

PlanExecutor error during aggregation :: caused by :: service temporarily unavailable

It seems to happen randomly when my application is trying to use an aggregation, the same aggregation can be run at a later time with no issue (usually).

I'm wondering if there's anything I can do to prevent this error from happening and if there's a reason it started to happen recently.

The error message suggests the issue is on the database side, but I can't find any signs of a problem occuring when I look at MongoDB Atlas status.

I'm asking this question, because I couldn't find any documentation on this error anywhere online.

I'm using MongoDB Atlas with a dedicated cluster and my application uses the nodejs official driver.

EDIT: Checking the mongod logs I identified it comes from $listSearchIndexes, however I still don't know why this occurs.


Solution

  • After talking with the support team at Mongo we finally figured out what was happening.

    My application needs to generate search indexes dynamically at run-time. This turned out to be an issue when multiple search indexes were trying to be generated at the same time, because Mongo throttles requests to the mongot service.

    Making sure only one index was being generated at a time fixed my issue.