Wednesday, March 30, 2016

[google-cloud-sql-discuss] use of closed network connection

I found my CakePHP based app cannot connect to Cloud SQL 2nd generation instance via Cloud SQL Proxy.
I once succeeded to connect, and today I found this problem occurs. I build infrastructure as code and I believe there is not so big change from then. (But I'm not sure.)

I tried to connect from mysql client and following error message is shown.

$ mysql -u USERNAME -S /tmp/cloudsql/PROJECT_NAME:asia-east1:INSTANCE_NAME
ERROR 1045 (28000): Access denied for user 'USERNAME'@'localhost' (using password: NO)

I killed existing Cloud SQL Proxy and start Cloud SQL Proxy manually. Then following error message is shown.

$ sudo /usr/local/bin/cloud_sql_proxy -dir=/tmp/cloudsql -fuse
2016/03/30 10:58:57 Mounting "/tmp/cloudsql"...
2016/03/30 10:58:57 Mounted "/tmp/cloudsql"
2016/03/30 10:58:57 Socket prefix: /tmp/cloudsql
2016/03/30 10:59:01 to "PROJECT_NAME:asia-east1:INSTANCE_NAME" via INSTANCE_IP:3307: read unix /tmp/cloudsql-proxy-tmp/PROJECT_NAME:asia-east1:INSTANCE_NAME->@: use of closed network connection
2016/03/30 10:59:05 from "PROJECT_NAME:asia-east1:INSTANCE_NAME" via INSTANCE_IP:3307: read tcp GCE_INSTANCE_INTERNAL_IP:48482->INSTANCE_IP:3307: use of closed network connection
2016/03/30 10:59:24 to "PROJECT_NAME:asia-east1:INSTANCE_NAME" via INSTANCE_IP:3307: read unix /tmp/cloudsql-proxy-tmp/PROJECT_NAME:asia-east1:INSTANCE_NAME->@: use of closed network connection
2016/03/30 10:59:29 to "PROJECT_NAME:asia-east1:INSTANCE_NAME" via INSTANCE_IP:3307: read unix /tmp/cloudsql-proxy-tmp/PROJECT_NAME:asia-east1:INSTANCE_NAME->@: use of closed network connection
2016/03/30 10:59:29 to "PROJECT_NAME:asia-east1:INSTANCE_NAME" via INSTANCE_IP:3307: read unix /tmp/cloudsql-proxy-tmp/PROJECT_NAME:asia-east1:INSTANCE_NAME->@: use of closed network connection
...

I searched this Google Group with text "use of closed network connection" and find following posts. There is similar error message, but I'm not sure if it is related to my problem.

Trying to Connect to database in PHP using PDO and Cloud SQL Proxy
https://groups.google.com/forum/#!topicsearchin/google-cloud-sql-discuss/use$20of$20closed$20network$20connection/google-cloud-sql-discuss/AsVdpcRF5gA

Thanks in advance,
Jumpei

--
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/c7a658ba-afe8-4a97-b542-7159137c6611%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment