-
Notifications
You must be signed in to change notification settings - Fork 263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trying to connect to Atlas form Google GAE #707
Comments
The error message doesn't hint at a TLS certificate error, so I believe this is a case of your GAE server not being able to open a socket to the Atlas cluster. Are you able to connect to the Atlas cluster outside of GAE (e.g. using a shell on your development machine)? Note that each Atlas cluster has an IP whitelist, so you will need to add application servers and/or development machines to that whitelist in order to connect to the cluster. Failure to do so will cause Atlas to drop incoming connections, which is what we might be seeing here. I would suggest you start by adding your development machine to the Atlas whitelist and verifying that you can connect to the cluster (either using the PHP driver locally or the |
Hi @jmikola forgot to add this information in my issue, but yes I can connect from my local/dev environment. |
Searching for "Google Cloud App Engine php outgoing connection" turned up some threads about folks having general issues making outgoing connections from GAE-hosted applications and lead me to Setting up a firewall rule to allow outbound traffic on a custom port in Google's own documentation. This is nestled under a tutorial for sending e-mail but appears to refer to general firewall configurations for outgoing connections. I'm not sure what cloud provider you're using in Atlas, but Google Cloud is a supported option so I would suggest looking into that if you've not already. At the very least, you should reduce latency by keeping app servers and your database in the same cloud provider and availability zoon. One might hope that GAE would allow connections to other, internal services within Google Cloud by default, but perhaps that still requires an explicit firewall rule since Atlas' instances would still be outside of our own account. |
Hello @jmikola, So yes I deployed my MongoDB Atlas server in the Google Cloud Platform.
|
These questions are veering outside of my subject area (and likely the scope of the driver itself), so I think you'd have better luck asking Atlas support. They should be able to answer those questions and may have additional insights that would help troubleshoot your connectivity issues. I have one last suggestion that may be helpful to test connectivity without using the driver at all. #313 (comment) demonstrates how to use If you are able to run that successfully from the same GCP app server, but not connect using the driver, that would hint at some issue with the driver itself. Otherwise, it may be useful as a bare bones test for diagnosing network connectivity with the Atlas support team -- akin to attempting to ping an Atlas server from an application server where you might otherwise have shell access. |
Hi @jmikola I will contact the MongoDB Atlas support about that! |
Hello there, I know there is already some issues related to this one, but I didn't find any solution for now. I do not know if it's MongoDB library related or MongoDB Doctrine related so I posted the issue here!
Bug Report
My currently application (Symfony 5) is hosted on Google Cloud App Engine (GAE) and seems to not be able to connect to MongoDB Atlas.
However, because of GAE, I cannot connect on the server using SSH and cannot test the database connection using
mongo shell
.I always get the next error message:
Environment
Debug
Capturing data for mongodb.com
Capturing data formaincluster-shard-00-00-ev9mm.mongodb.net
Thanks for your help
The text was updated successfully, but these errors were encountered: