No suitable servers found - socket timeout calling ismaster

0

Hi
We have a periodical error:
unable to query db: No suitable servers found (serverSelectionTryOnce set): socket timeout calling ismaster on 'XXXXXX-1.docdb.amazonaws.com:27017'

in our PHP app, usually 3-4 times per day.

our conditions:

  • app server is in the same region as documentdb

  • security group allows the connection (other query runs)

  • we have only one instance in the cluster (so I don't understand how this can be connected with ismaster reply from documentdb in case you have multiple instance setup)

  • the cloud watch metrics do not show anything unusual for the time when errors happen, same for the app server

  • usually, only one request fails, all others are ok, and the request itself is different (not the same query)

Thank you in advance.

dmqbee
asked 3 years ago1164 views
1 Answer
0

The exception explains connectivity issue between PHP application and the DocumentDB Cluster.

It could be due transient network error or application is exhausting total number of connections or it could be due to load on DocumentDB.
To rule out the network issue, you can setup a tcpdump if you see any pattern with timing.

Please also provide your exact connection string and instance details for DocumentDB cluster , would be great help to investigate.

PHP driver's default behavior only attempts server selection once. If you want ,you can also change this behavior in driver so that it can make additional attempts to connect after a socket failure.

AWS
Anva
answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions