Open ivankrister opened 10 months ago
Hi @ivankrister, does the error persist or does it eventually go away? By default, MongoDB Atlas uses the mongodb+srv
protocol in its connection string, which instructs the driver to do a DNS lookup on the given hostname to get the initial list of servers to connect to. The error you're encountering is an error reported by your operating system. Did you confirm that the same connection string was used in tinker and the web application where it works?
Yes, @alcaeus i confirm that im using same connection in my web and tinker im using mongodb+srv protocol in my connection and i call config('database.connections.mongodb') in my tinker and web it gives similar result, but error still exists in tinker when fetching data
For me its the other way around, From tinker It works, but calling from routes it throws the below error.
No suitable servers found (serverSelectionTryOnce
set): [connection error calling hello on 'xxxxx.docdb.amazonaws.com:27017'] {"userId":11,"exception":"[object] (MongoDB\Driver\Exception\ConnectionTimeoutException(code: 13053): No suitable servers found (serverSelectionTryOnce
set): [connection error calling hello on 'xxxxx.docdb.amazonaws.com:27017'] at /home/forge/default/vendor/mongodb/mongodb/src/functions.php:520)
@ivankrister is the issue fixed?
@lokesh-zersys the error you are receiving is likely unrelated and has a very different root cause.
I've also noted that you're using DocumentDB, so please contact AWS support for any issues you encounter as it's not supported by the MongoDB driver. Thanks.
Description:
Steps to reproduce
Expected behaviour
Display the collection on the specific model that call
Actual behaviour
Error MongoDB\Driver\Exception\InvalidArgumentException Failed to parse URI options: Failed to look up SRV record "_mongodb._tcp.XXXX.XXX.mongodb.net": A temporary error occurred on an authoritative name server. Try again later.
BUT everything fine when calling in routes