Repository navigation
App Engine and Cloud SQL - connection lost issue #163
Description
Activity
Can you post the exact contents of
app.yaml?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]
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.I know :) so let's assume
[YOUR_PROJECT_ID]is name of your project id that you can get from Cloud SQL console thenapp.yamllooks 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
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
test1database exists, then I don't know what the problem could be. I'll have to open an issue.I found where the problem was. I had to enable the
Cloud SQL Administration APIand everything works fine now. Thanks for help ;)Ah, I didn't think of that.
- addedtriage meI really want to be triaged.I really want to be triaged.🚨This issue needs some love.This issue needs some love.
on Apr 6, 2020 - added a commit that references this issue
on Nov 7, 2022 - added a commit that references this issue
on Nov 8, 2022 - added 2 commits that reference this issue
on Nov 8, 2022 - added a commit that references this issue
on Nov 10, 2022 - added a commit that references this issue
on Nov 10, 2022 - added 2 commits that reference this issue
on Nov 11, 2022 - added a commit that references this issue
on Nov 16, 2022 - added 2 commits that reference this issue
on Nov 17, 2022 - added a commit that references this issue
on Nov 17, 2022 - added a commit that references this issue
on Nov 17, 2022 - added 2 commits that reference this issue
on Nov 18, 2022 - added a commit that references this issue
on Nov 21, 2022
Hi,
I have forked the
appengine/cloudsqlproject 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 usingcloud_sql_proxywithout any problem so it seems the issue is somewhere betweenapp engineandcloud sqlas Mysql connection is always dropping..In
app.yamlI 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