-
Notifications
You must be signed in to change notification settings - Fork 211
Closed
Description
Description
Fatal error: Uncaught MongoDB\Driver\Exception\ConnectionTimeoutException: No suitable servers found (`serverSelectionTryOnce` set): [socket timeout calling ismaster on 'gcp-atlas-prod-shard-00-00-gz8ag.gcp.mongodb.net:27017'] [socket timeout calling ismaster on 'gcp-atlas-prod-shard-00-01-gz8ag.gcp.mongodb.net:27017'] [socket timeout calling ismaster on 'gcp-atlas-prod-shard-00-02-gz8ag.gcp.mongodb.net:27017'] in /var/www/html/vendor/mongodb/mongodb/src/Collection.php:645
Stack trace:
#0 /var/www/html/vendor/mongodb/mongodb/src/Collection.php(645): MongoDB\Driver\Manager->selectServer(Object(MongoDB\Driver\ReadPreference))
#1 /var/www/html/App/settings.php(53): MongoDB\Collection->findOne(Array)
#2 /var/www/html/public/index.php(5): require_once('/var/www/html/A...')
#3 {main} thrown in /var/www/html/vendor/mongodb/mongodb/src/Collection.php on line 645
The problem comes randomly mostly every second time i start the pod.
Environment
I have a PHP Version 7.2.14 running on kubernetes deployment on google cloud.
libbson bundled version => 1.13.0
libmongoc bundled version => 1.13.0
libmongoc SSL => enabled
libmongoc SSL library => OpenSSL
libmongoc crypto => enabled
libmongoc crypto library => libcrypto
libmongoc crypto system profile => disabled
libmongoc SASL => enabled
libmongoc ICU => disabled
libmongoc compression => enabled
libmongoc compression snappy => disabled
libmongoc compression zlib => enabled
mongodb.debug => no value => no value
<?php
$mongo_password = "xxxxxx";
$mongo_database = "db_test";
$mongo_connectionstring = "mongodb+srv://username:".$mongo_password."@gcp-atlas-prod-gz8ag.gcp.mongodb.net";
$mongo = new MongoDB\Client($mongo_connectionstring);
$collection = $mongo->$mongo_database->config;
$_CFG =$collection->findOne(['id'=> 'system']);
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels