I'm getting random "Plan executor error during find command" errors

My max time for queries is 2secs (2000ms).

However when I try to manually query the script via Studio3t, there is nothing wrong with the query as it finishes executing after 0.002 secs.

I am running on Azure VM Ubuntu 18.04 2vCPU 8GB RAM

My wired tiger cache is set to 5GB

I’ve checked my server resources that timeframe but its usage seems normal.

Here is a sample of my error log.

{“t”:{“$date”:“2022-09-20T12:27:31.486+08:00”},“s”:“W”, “c”:“QUERY”, “id”:23798, “ctx”:“conn225631”,“msg”:“Plan executor error during find command”,“attr”:{“error”:{“code”:50,“codeName”:“MaxTimeMSExpired”,“errmsg”:“operation exceeded time limit”},“stats”:{“stage”:“PROJECTION_SIMPLE”,“nReturned”:1,“works”:1,“advanced”:1,“needTime”:0,“needYield”:0,“saveState”:1,“restoreState”:0,“isEOF”:1,“transformBy”:{},“inputStage”:{“stage”:“IDHACK”,“nReturned”:1,“works”:1,“advanced”:1,“needTime”:0,“needYield”:0,“saveState”:1,“restoreState”:0,“isEOF”:1,“keysExamined”:1,“docsExamined”:1}},“cmd”:{“find”:“UserApiToken”,“filter”:{“_id”:“324018-1608032429-lQcadddddDdzicbLCBfKs7HW5VNFz8h-kXoDjXVgcMP-igd”},“projection”:{“UserId”:1,“_id”:1,“DeviceId”:1,“RequestComingFromType”:1,“DeviceName”:1,“IpAddress”:1,“CountryCode”:1,“ExpiredDate”:1,“DefaultExchange”:1},“limit”:1,“maxTimeMS”:2000,“$db”:“igd_db”,“lsid”:{“id”:{“$uuid”:“c18bc29f-81a2-45f8-8b88-c0dafd7ec56w”}},“$clusterTime”:{“clusterTime”:{“$timestamp”:{“t”:1663648049,“i”:507}},“signature”:{“hash”:{“$binary”:{“base64”:“2H3SxchRR2H3I8S/caW1Xg4Qyco=”,“subType”:“0”}},“keyId”:709645542335163252}}}}}

@jca any luck in findong out whats happening here? I’m observing the same behavior in repl mongo 5. In profiler i do see these queries taking over 30mins. Maybe its a driver bug?

the query doesn’t finish within time limit.