Monday, November 6, 2017

[google-cloud-sql-discuss] Re: Cloud SQL periodic issues connecting OperationalError: (2062, 'Cloud SQL socket open failed with error: Transport endpoint is not connected')

The bug ended up being an issue of not closing DB connections. GAE instances have a per-instance limit of 8 connections and we had one endpoint using webapp instead of Django. By default Django closes DB connections at the end of each request but webapp doesn't do this, rewriting the endpoint to use Django fixed the problem.

On Sunday, October 8, 2017 at 10:12:20 PM UTC+2, Nikos Volakis wrote:
I have the same issue, for some reason when I reach 50QPS  in a second generation instance I get the same error. Did anyone find a solution for that? 

On Monday, June 19, 2017 at 2:16:49 PM UTC+1, Mohammad Rafi wrote:
I also got same error, its usually random but at 50 QPS it affects 10% of the requests, I have tried closing the connections explicitly as well, it dropped but didnt help completely.

Please help

On Thursday, 19 January 2017 06:29:58 UTC+5:30, Michoel Burger wrote:

Periodically connection attempts to the 2nd Gen MySQL server receives this error:


OperationalError: (2062, 'Cloud SQL socket open failed with error: Transport endpoint is not connected')


This will persist for ~10 minutes and then go away. It also seems to happen at the same time every day (across 3 different projects that all access the same server it'll happen for the first time within 2 minutes).


The only reference to this error in conjunction with Cloud SQL I could find is that it may be related to connection limits (https://groups.google.com/d/msg/google-cloud-sql-discuss/sdeD17oDBOQ/wtTewl4-EgAJ) but there is very little else going on with the instance outside of one TaskQueue task so I find it unlikely we're hitting even the 12 per-instance limit (and definitely not the 4k overall limit).


The code that causes this exception uses the same DB settings as the rest of the app and is simply trying toSELECT a row by primary key (so a small query).

In the DB logs there are a lot of entries of this error:


[Note] Aborted connection 39643 to db: 'my_schema' user: 'root' host: 'cloudsqlproxy~<instance_ip>' (Got an error reading communication packets)


but I'm not sure if they're related as they occur pretty consistently throughout the day and the above error only occurs at a certain time for ~10 minutes.

This only started after upgrading to 2nd Gen Cloud SQL.


Any insights on this? Is there some sort of instance maintenance that may be causing this?


Thanks!

--
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/5aad5e5d-cedd-457e-b461-50def43b8760%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment