Skip to content
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

Troubles with the tutorial: Using Cloud SQL for MySQL (App Engine Flexible Environment) #664

Closed
omidkrad opened this issue Jun 15, 2018 · 3 comments

Comments

@omidkrad
Copy link

omidkrad commented Jun 15, 2018

Hi, I followed steps in Using Cloud SQL for MySQL (App Engine Flexible Environment)

Everything worked and deployed successfully (8 min 21 sec for deploying?!!) until gcloud app browse that goes to the URL with "Internal Server Error" message.

And the log shows Error: connect ECONNREFUSED 127.0.0.1:3306

Question 1: Why does deploy of a simple app take so long to complete even on subsequent runs?

When testing locally using Cloud SQL Proxy we know that 127.0.0.1 is proxied to the Cloud SQL database that we specify in the command line like this:

./cloud_sql_proxy -instances=$INSTANCE_CONNECTION_NAME=tcp:3306 -credential_file=$GCLOUD_CERTIFICATE_FILE

but the tutorial does not explain how possibly after deployment it is supposed to connect to the database instance, since we don't have the proxy configuration on the server. And so it fails with the above error as one may expect.

Question 2: How is the app supposed to connect to the sql instance when deployed?

App.flexible.yaml file says "Do not add this file to your source control." Is that really the recommended way to handle app.yaml files? It does not make sense that the application configuration file should be maintained outside of the repository.

Question 3: What is the correct way to manage app.yaml and sensitive data in it?

Thanks!

@omidkrad
Copy link
Author

omidkrad commented Jun 15, 2018

I found the answer to my Question 2, the instance name is set in App.flexible.yaml env_variables.INSTANCE_CONNECTION_NAME. The confusing part in the doc is where it says "If you configured the proxy to use Unix sockets, set this additional environment variable" which implies that it may not be needed if using TCP Sockets. I think the documentation should mention that it is needed for deployment.

@fhinkel
Copy link
Contributor

fhinkel commented Nov 10, 2018

I'd recommend using the App Engine Standard Environment: https://cloud.google.com/appengine/docs/standard/nodejs/using-cloud-sql

Deployment only takes a few seconds instead of 10 minutes.

@fhinkel fhinkel closed this as completed Nov 10, 2018
@akedevs
Copy link

akedevs commented Sep 16, 2019

Too hard inplement this solution , 1 month try to connect local and when deploy still
error , I don't know why doucment on github never work .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants