Saturday, March 24, 2018

[google-cloud-sql-discuss] CloudSQL connection issues with deployed Bookshelf tutorial app (App Engine/NodeJS)

i deployed the my code on app engine with node js (flex environment). 
 ==========================================
config.json 

{
  "GCLOUD_PROJECT": "XXXXXX",
  "DATA_BACKEND": "cloudsql",
  "MYSQL_USER": "XXXX",
  "MYSQL_PASSWORD": "XXXXX",
  "INSTANCE_CONNECTION_NAME": "XXXXXX:us-central1:XXXXX"
}

===============================================================
model-cloudsql.js

const options = {
  user: config.get('MYSQL_USER'),
  password: config.get('MYSQL_PASSWORD'),
  database: 'XXXXX'
};

if (config.get('INSTANCE_CONNECTION_NAME') && config.get('NODE_ENV') === 'production') {
  options.socketPath = `/cloudsql/${config.get('INSTANCE_CONNECTION_NAME')}`;

}

const connection = mysql.createConnection(options);


i am getting the error : "Cannot enqueue Query after fatal error."

please provides any feedback on it. 

--
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/f8ffc157-8b6e-426e-8f5e-cf5da6f457ad%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment