Wednesday, September 6, 2017

Re: [google-cloud-sql-discuss] Issues with Cloud SQL + App Engine

Do you have any logs from your application that shows the connection string you are using?
Can you provide an excerpt of the code you are using to connect?



On Wed, Sep 6, 2017 at 7:18 PM, Mike Hardy <mhardy@localinsights.io> wrote:
Yeah, something is wrong. The IP is a GAE instance - 104.197.227.221

On Wednesday, September 6, 2017 at 7:16:28 PM UTC-7, Vadim Berezniker wrote:
Which IP are you whitelisting? If whitelisting an IP works, that usually indicates you are not connecting via the GAE-specific connectivity.

On Wed, Sep 6, 2017 at 6:40 PM, Mike Hardy <mha...@localinsights.io> wrote:
Yup, followed those instructions to a T and still having the same issue. I attached a screenshot of the console error before we whitelist the IP. After we whitelist the IP, all is well and we can query/connect to the DB with no CORS issues.

On Wednesday, September 6, 2017 at 5:46:07 PM UTC-7, Vadim Berezniker wrote:
You should not be connecting by IP address. Please follow these instructions: https://cloud.google.com/appengine/docs/flexible/python/using-cloud-sql-postgres#setting_connection_strings_and_adding_a_library
Notice that the example connects via a '/cloudsql/INSTANCE_CONNECTION_NAME' socket when deployed. 


On Wed, Sep 6, 2017 at 5:39 PM, Mike Hardy <mha...@localinsights.io> wrote:
Right, that's what we thought - that GAE and Cloud SQL are already setup to communicate and require no configuration, but, for whatever reason, they're not communicating until we authorize the IP address from GAE.

On Wednesday, September 6, 2017 at 5:35:59 PM UTC-7, Vadim Berezniker wrote:
The proxy is automatically installed and started on GAE Flex if you follow the instructions on that page. Quoting the doc: 
"Once deployed, your application uses the Cloud SQL Proxy that is built in to the App Engine flexible environment to communicate with your Cloud SQL instance."

Connecting from Container Builder is a different story and I'm not too familiar with it. In general, migrations are done at deployment time, not at build time.


On Wed, Sep 6, 2017 at 5:27 PM, Mike Hardy <mha...@localinsights.io> wrote:
Nope, we followed these docs.  The only mention of UNIX sockets are for the proxy. Are you suggesting we install cloud sql proxy during the actual build?

On Wednesday, September 6, 2017 at 5:20:23 PM UTC-7, Vadim Berezniker wrote:
Are you connecting by IP? You should be connecting via a special UNIX sockets to avoid dealing with IP whitelisting: https://cloud.google.com/sql/docs/mysql/connect-app-engine

On Wed, Sep 6, 2017 at 5:03 PM, Mike Hardy <mha...@localinsights.io> wrote:
Hi, we have a web app that runs on GAE and Cloud SQL. GAE fails to communicate with postgres Cloud SQL unless we manually whitelist the GAE IP addresses. Once we whitelist the IP, voila, GAE, Cloud SQL, and our app all work well. However, this process is not scalable. The app will scale up and down and will generate new instances with new IP addresses. It will be impossible to whitelist these IP addresses. Our understanding was that GAE and Cloud SQL are already integrated and dont need this setup but clearly something is going. We're using GAE Flex and Cloud SQL Postgres. How do we try to fix this?

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/021e00a1-d8e4-4841-a3b6-669bae879cfb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/e338ee3e-d567-4aa7-9351-549f1172a008%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/93808a87-bcfa-40d2-887e-5305b5b63ed4%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/efc27ee4-482e-42ae-b18c-7c9100fc518d%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/497c8309-fd62-4d0c-bf08-13828d6265cb%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/CABDU3p1WmFpjsdtYyrHnGeRMFjOty22MfvN2JDLFYav8f%3DxnVA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment