nosqlnavigator / mongodb_intellij_plugin

0 stars 0 forks source link

LoadBalancerSupportMismatch error connecting to MongoDB #4

Open dmitri-danilov opened 3 months ago

dmitri-danilov commented 3 months ago

Hi,

I'm getting the error below trying to connect to our MongoDB database:

MongoDB error (MongoTimeoutException): Timed out after 5000 ms while waiting to connect. Client view of cluster state is {type=UNKNOWN, servers=[{address=mytest-lb.dlhtk.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoCommandException: Command failed with error 354 (LoadBalancerSupportMismatch): 'The server is being accessed through a load balancer, but this driver does not have load balancing enabled' on server mytest-lb.dlhtk.mongodb.net:27017. The full response is {"ok": 0, "errmsg": "The server is being accessed through a load balancer, but this driver does not have load balancing enabled", "code": 354, "codeName": "LoadBalancerSupportMismatch"}}}]

Increasing the server connection timeout in settings doesn't help.

NosqlnavigatorSupport commented 3 months ago

Hi @dmitri-danilov , thanks for your report.

Try to add to your connection URI: ?loadBalanced=true. For example, mongodb://mytest-lb.dlhtk.mongodb.net:27017/?loadBalanced=true and please let us know the result.

Unfortunately, we do not yet have a test MongoDB instance with configured support for load balance to test this solution. If this method does not help, we will definitely solve it in the next release.

Best regards, NoSQL Navigator team.

dmitri-danilov commented 3 months ago

Hi @dmitri-danilov , thanks for your report.

Try to add to your connection URI: ?loadBalanced=true. For example, mongodb://mytest-lb.dlhtk.mongodb.net:27017/?loadBalanced=true and please let us know the result.

Unfortunately, we do not yet have a test MongoDB instance with configured support for load balance to test this solution. If this method does not help, we will definitely solve it in the next release.

Best regards, NoSQL Navigator team.

Hi,

I have tried to do as you described, but results are still the same unfortunately.

Thank you

NosqlnavigatorSupport commented 3 months ago

Hi, thanks for trying.

We, in turn, configured a test shard with load balancing enabled via HAProxy. We have verified that adding /?loadBalanced=true helps resolve the issue.

May I ask about your server configuration? Is this Atlas? How did you enable load balancing there? Do other GUIs or applications connect to the database normally?

Best regards, NoSQL Navigator team.

dmitri-danilov commented 3 months ago

It is Atlas. Not sure about server config, I was not the one who set it up - was only given the connection details. I have no problem connecting to it with Compass, "Database Tool" plugin for Jetbrains IDE as well as Jupyter notebooks (pymongo, motor).

Thank you