Skip to content

Intermittent error: MongoConnectionException:No suitable servers found (serverselectiontryonce set): [Server closed connection. calling ismaster on 'x.x.x.x:27017']' #532

@mmucklo

Description

@mmucklo

Description

Intermittent errors observed with mongo-php-driver.

First tried 1.2.5, but have reverted down to 1.1.9.

1.2.5 had more frequent errors (almost multiple per minute) whereas 1.1.9 is a few per hour or so.

Adjusted the following things:

  1. Converted all hostnames to ip addresses in connection strings (No suitable servers found #133)
  2. Set default connectTimeoutMS and socketTimeoutMS to 20000ms
    (No suitable servers found (serverselectiontryonce set): [connection error calling ismaster on '114.225.125.126:27017'] #374)
  3. Set default 'w' to 1, and wTimeoutMS to 20000ms
    (https://groups.google.com/forum/#!msg/mongodb-dev/zlzvXo6pOcI/1y5KcEZ-IwAJ)
  4. Backed out to 1.1.9
    (No suitable servers found (serverselectiontryonce set): [connection error calling ismaster on 'xxx.xxx.xxx.xxx:xxxx'] #425)

Environment

PHP 7.0.15 on CentOS 7.3.1611 x86_64

$ php -i | grep -E 'mongodb|libmongoc|libbson'

mongodb
mongodb support => enabled
mongodb version => 1.1.9
mongodb stability => stable
libmongoc version => 1.3.6
libbson version => 1.3.6
mongodb.debug => no value => no value

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions