Skip to content

Can't connect to Atlas - Error:No suitable servers found #313

Closed
@Jeff-Lewis

Description

@Jeff-Lewis

I'm having trouble connecting to Atlas as well with PHP. Connect fine using other libs and MongoChef so whitelisting is not the issue.

  • Windows 10
  • PHP 5.6.29
  • mongodb.dll ext 1.2.2
  • "mongodb/mongodb": "^1.1.0" from composer
  • Atlas cluster running MongoDB 3.2
Error fetching Mongo. DB:myDB Coll:myCollection Error:No suitable servers found (`serverSelectionTryOnce` set): 
[TLS handshake failed: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed calling ismaster on 'myShard.mongodb.net:27017'] 
[TLS handshake failed: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed calling ismaster on 'myShard.mongodb.net:27017'] 
[TLS handshake failed: error:14090086:SSL routines:ssl3_get_serve query:{"theField":"theValue"} fields:{"projection":{"_id":1,"theField":1}}
exception 'MongoDB\Driver\Exception\ConnectionTimeoutException' with message 'No suitable servers found (`serverSelectionTryOnce` set): 
[TLS handshake failed: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed calling ismaster on 'myShard.mongodb.net:27017'] 
[TLS handshake failed: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed calling ismaster on 'myShard.mongodb.net:27017'] 
[TLS handshake failed: error:14090086:SSL routines:ssl3_get_serve' in C:\theapp\vendor\mongodb\mongodb\src\Collection.php:498
Stack trace:
#0 C:\theapp\vendor\mongodb\mongodb\src\Collection.php(498): MongoDB\Driver\Manager->selectServer(Object(MongoDB\Driver\ReadPreference))
#1 C:\theapp\MyMongoClass.php(143): MongoDB\Collection->find(Array, Array)

The sanitized url:

mongodb://theUser:thePassword@myShard.mongodb.net:27017,myShard.mongodb.net:27017,myShard.mongodb.net:27017/admin?ssl=true&replicaSet=myReplicaset&authSource=admin

Posted as suggested

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