We are using MongoDB payed version and we started receiving ReplicaSetNoPrimary error randomly this week on local. We are using node.js but when the error appears while we are working, it´s stop answering from Atlas too.
Our ip is allowed
Our local firewall is disabled
Is working in production and the URL string is the same
It happens only sometimes and when it’s about to happen the queries start working really slow
When it happens it stops working from MongoDB Compass too and we are using +srv URL
Hi @dimitar_vasilev and welcome to the MongoDB community forum!!
Thank you for sharing the above information in detail. However, to understand clearly, could you help with a few more details below:
Could you clarify if you are using a paid tier MongoDB Atlas instance or are you referring to an on-prem self-hosted enterprise deployment here?
Could you help with the node version you are using?
Can you help me understand if this was seen throughout the time the connection is build or is seen randomly. Was there something changed on the application end when the issue started to occur.
If you are on the Atlas deployment, could you confirm if you are observing something notable change on the metrics end? Please review the following How to Monitor MongoDB page which could possibly assist you with this.
Please let me know if you have any further queries.
It’s actually randomly, it can happent while the connection is beign made or after. The interesting is that it happens only on local dev environment.
I tried monitoring the problem many times but nothing I coudn’t see anything important. All seems to be fine. And is working on production which uses the exact same connection string.
Let me know if there is anything I can provide to help understand the problem better.
It would be helpful if you help me understand further with more details.
Does this mean that only the local MongoDB you’re having issues with but not Atlas?
Could you confirm how the local environment was run? Is it on a laptop, what’s the mongod command line parameters are?
What are the operating system configuration?
Could you also provide the connection string that you are using to connect for both the environments?
Does you local setup has a different configuration or security setting from the the production environment ?