GeezerVison is showing github.com — App Engine and Cloud SQL - connection lost issue · Issue #163 · GoogleCloudPlatform/nodejs-docs-samples
App Engine and Cloud SQL - connection lost issue #163Labels 🚨This issue needs some love.triage meI really want to be triaged. DescriptionHi,
I have forked the appengine/cloudsql project and deployed to google cloud however I am getting follow error Connection lost: The server closed the connection. each time I deploy the app. I am able to run application on my local machine using cloud_sql_proxy without any problem so it seems the issue is somewhere between app engine and cloud sql as Mysql connection is always dropping..
In app.yaml I am using follow MYSQL_SOCKET_PATH: /cloudsql/[YOUR_PROJECT_ID]:[YOUR_REGION]:[YOUR_INSTANCE_NAME]
Are there any changes in configuration or doc that I am missing?
P.S.: I am using second generation of Cloud SQL.
Thanks,
Martin Activityjmdobry commented on Aug 10, 2016 Can you post the exact contents of app.yaml? martinmicunda commented on Aug 10, 2016 The Connection lost: The server closed the connection error means that at least credentials are correct otherwise I would see ENOENT or access denied error message so there might be something wrong with socket.
runtime: nodejs
vm: true
env_variables:
MYSQL_USER: [YOUR_USER]
MYSQL_PASSWORD: [YOUR_PASSWORD]
MYSQL_DATABASE: [YOUR_DATABASE]
MYSQL_SOCKET_PATH: /cloudsql/[YOUR_PROJECT_ID]:[YOUR_REGION]:[YOUR_INSTANCE_NAME]
beta_settings:
cloud_sql_instances: [YOUR_PROJECT_ID]:[YOUR_REGION]:[YOUR_INSTANCE_NAME] jmdobry commented on Aug 10, 2016 You need to replace all of the variables with your actual values, e.g. [YOUR_PROJECT_ID] => my-project, [YOUR_USER] => my-user-name, etc. martinmicunda commented on Aug 10, 2016 I know :) so let's assume [YOUR_PROJECT_ID] is name of your project id that you can get from Cloud SQL console then app.yaml looks like this:
runtime: nodejs
vm: true
env_variables:
MYSQL_USER: root
MYSQL_PASSWORD: pass
MYSQL_DATABASE: test1
MYSQL_SOCKET_PATH: /cloudsql/[YOUR_PROJECT_ID]:us-central1:test
beta_settings:
cloud_sql_instances: [YOUR_PROJECT_ID]:us-central1:test jmdobry commented on Aug 10, 2016 I just successfully deployed the Cloud SQL sample to https://sql-dot-nodejs-docs-samples.appspot.com/ using:
runtime: nodejs
vm: true
env_variables:
MYSQL_USER: myuser
MYSQL_PASSWORD: mypassword
MYSQL_DATABASE: nodejs-docs-samples
MYSQL_SOCKET_PATH: /cloudsql/nodejs-docs-samples:us-central1:nodejs-docs-samples
beta_settings:
cloud_sql_instances: nodejs-docs-samples:us-central1:nodejs-docs-samples
Assuming you've made no alterations to the sample and you've already successfully connected to your Cloud SQL instance from your local computer to verify that your test1 database exists, then I don't know what the problem could be. I'll have to open an issue. martinmicunda commented on Aug 10, 2016 I found where the problem was. I had to enable the Cloud SQL Administration API and everything works fine now. Thanks for help ;) jmdobry commented on Aug 11, 2016 Ah, I didn't think of that.
MetadataMetadata🚨This issue needs some love.triage meI really want to be triaged. DevelopmentNo branches or pull requestsIssue actions
|