Status Update
Comments
su...@google.com <su...@google.com>
su...@google.com <su...@google.com> #2
Hello,
Thank you for contacting the Google Cloud support team.
I have gone through your reported issue, however I could not find any specific information from the description you provided and it seems it would need more specific debugging and analysis. The Issue Tracker is a forum for end users to report bugs and request features. I suggest you go through
To get your issue resolved I would recommend if you are still facing the issue ,please create a
ro...@foxglove.dev <ro...@foxglove.dev> #3
That's not a very helpful response.
Anyhow - for others that discover this. There was a bug filed and fixed related to this:
So if you encounter this, try to update your maintenance version.
Description
Background:
We have a node.js REST api web app deployed to cloud run. This applications uses the node-postgres module to connect to a postgres database (hosted in cloudsql) via the "Cloud sql connections" feature of cloud run. Our understanding is that this feature is powered by cloud sql proxy .
Problem:
A few times a week we will have database queries fail with "Connection terminated unexpectedly" errors. We've instrumented various parts of the node-postgres module and identified that this error happens when the server terminates our connection while we are performing a query.
When we encounter this error in our app, I see a correlated "disconnection" log on the cloudsql instance moments before we see the error in our app. I've been able to reproduce similar behavior by running a Cloud Sql Proxy instance on my dev machine, making a query in our app, and sending a SIGTERM to the sql proxy instance.
This leads us to believe that the cloud sql proxy that powers the unix socket "cloud sql connection" for our cloud run instance is restarting or otherwise re-setting its connections. This is a guess because we don't have logs or access to the cloud sql proxy instance deployed for our cloud run instance.
Our expected behavior is that we don't see such "connection terminated" errors which negatively impact our user's API experience.
What we'd like to understand is whether there is anything we can do to control when/how the cloud sql proxy for our cloud run instance is restarted? Are there more logs we have access to or can provide?
Steps to reproduce:
The issue does not reproduce on-demand in the cloud run deployment but I am able to reproduce it by "restarting" my local cloud sql proxy. Since we don't have visibility into when/how the sidebar cloud sql proxy for our cloud run instance is deployed we are not able to provide more insight.
Other information (workarounds you have tried, documentation consulted, etc):
I believe this issue describes similar behavior: https://issuetracker.google.com/issues/260517774
Most information online with cloud sql proxy and connection terminated errors points to restarts of the cloud sql proxy.