Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CloudRun Suddenly got `Improper path /cloudsql/{SQL_CONNECTION_NAME} to connect to Postgres Cloud SQL instance "{SQL_CONNECTION_NAME}"`

We have been running a service using NestJS and TypeORM on fully managed CloudRun without issues for several months. Yesterday PM we started getting Improper path /cloudsql/{SQL_CONNECTION_NAME} to connect to Postgres Cloud SQL instance "{SQL_CONNECTION_NAME}" errors in our logs.

We didn't make any server/SQL changes around this timestamp. Currently there is no impact to the service so we are not sure if this is a serious issue.

This error is not from our code, and our third party modules shouldn't know if we use Cloud SQL, so I have no idea where this errors come from.

My assumption is Cloud SQL Proxy or any SQL client used in Cloud Run is making this error. We use --add-cloudsql-instances flag when deploying with "gcloud run deploy" CLI command.

Link to the issue here

like image 830
KalanyuZ Avatar asked May 18 '21 23:05

KalanyuZ


People also ask

How do I run a SQL script in Google Cloud?

Steps to run an sql file on my Google Cloud Sql instance using the gcloud sql console are as follows: Create a GCP storage bucket (ideally in the same project) Upload the file to this bucket. Import the sql file from this bucket in the overview section of the GCP SQL console.

How does Cloud run connect to Cloud SQL Server?

For public IP paths, Cloud Run provides encryption and connects using the Cloud SQL Auth proxy through Unix sockets. For private IP paths, your application will connect directly to your instance through Serverless VPC Access. This method uses TCP to connect directly to the Cloud SQL instance without using the Cloud SQL Auth proxy.

How do I connect to Cloud SQL over public IP?

After you configure Cloud Run, you can connect to your Cloud SQL instance. Cloud Run does not support connecting to Cloud SQL for SQL Server over public IP. Use private IP instead. For public IP paths, Cloud Run provides encryption and connects using the Cloud SQL Auth proxy through Unix sockets.

How does Cloud run connect to my instance?

For public IP paths, Cloud Run provides encryption and connects using the Cloud SQL Auth proxy through Unix sockets. For private IP paths, your application will connect directly to your instance through Serverless VPC Access.

How do I add a connection to a cloud SQL instance?

If you are adding a connection to a Cloud SQL instance in your project, select the desired Cloud SQL instance from the dropdown menu. If you are using a Cloud SQL instance from another project, select custom connection string in the dropdown and then enter the full instance connection name in the format PROJECT-ID:REGION:INSTANCE-ID .


1 Answers

This log was recently added in the Cloud Run data path to provide more context for debugging CloudSQL connectivity issues. However, the original logic was overly aggressive, emitting this message even for properly working CloudSQL connections. Your application is working correctly and should not receive this warning.

Thank you for reporting this issue. The fix is ready and should roll out soon. You should not see this message anymore after the fix is out.

like image 141
urosp Avatar answered Oct 19 '22 20:10

urosp