So far everything works fine with Atlas, just one simple query errors with Unauthorized Code 13 every 30~ call.
We already tried to give the user the right readAnyDatabase, but even that doesnt help. Still every 30~ call errors. It makes totally no sense since most of the calls work without an error. Also all other queries are not affected, only this one.
Please provide the complete error message. Code 13 is not sufficient. There are important information, like database, collection and actions from the error message that we need to know to pinpoint the issue.
Indeed it does not provide much. Which server and driver versions are you using? Usually we get the database name and the operation.
There is no reasons for such a behaviour. I suspect that your variable db is changed by some other functions. At this point I would catch the error and add some tracing so that you can confirm that db is not changed and that the client has not been re-authenticated with some other credentials.
For what it’s worth, maintenance is not a daily occurrence and whrn it does occur it happens in a rolling manner including a mongodb replica set level election where the app driver will automatically discover the new primary and continue on its way.
If you are experiencing speed bumps along the way, I encourage you to open up a support case and reach out for help