3,872 questions
0
votes
0
answers
25
views
cloudsql gcp PGAUDIT
I activated pgaudit on my Cloud SQL instance by adding the two flags enable and pgaudit.log, and I immediately saw audit logs in Cloud Logging without having to create the extension. When I connect to ...
0
votes
0
answers
36
views
How to create a vecs client using a Google Cloud connector based SQLAlchemy engine
I am trying to use vecs this library here and GitHub page but I have a big issue. When trying to create a vecs client it needs only the connection string Client(connection_string="...
0
votes
0
answers
64
views
Google Cloud Run service fails to connect to Cloud SQL despite all correct configurations and successful network tests
I'm facing a persistent deployment issue with a standard n8n application on Cloud Run and would appreciate any insights. My service consistently fails to deploy, with the container exiting due to a ...
0
votes
1
answer
53
views
Cloud Run Spring Boot App fails to connect to Cloud SQL (PostgreSQL) via Proxy: Connection refused [closed]
I'm deploying a Spring Boot application ( forestplus-back ) to Google Cloud Run ( europe-southwest1 ) and trying to connect it to a Cloud SQL PostgreSQL instance ( forsest-plus-db , also in europe-...
0
votes
2
answers
167
views
PostgreSQL 17.5: "canceling statement due to conflict with recovery or timeout" when creating logical replication slot on replica
I'm trying to create a logical replication slot on a GCP managed PostgreSQL 17 read replica but getting intermittent failures with two different errors. The replica was recently upgraded from ...
0
votes
1
answer
89
views
Cloud Run Fails to Connect to Cloud SQL (Server Not Found) After Exhaustive Troubleshooting
The Problem
I'm attempting to connect a .NET application running on Google Cloud Run to a Cloud SQL for SQL Server instance. I'm using the standard and recommended method with the Cloud SQL Auth Proxy ...
0
votes
2
answers
82
views
gunicorn.errors.HaltServer: <HaltServer 'App failed to load.' 4> in Google Cloud Run Function
I have deployed a Cloud Run Function and am frequently seeing this error:
2025-08-26 13:08:18.052 PDT DEBUG: False
2025-08-26 13:08:18.052 PDT Type of DEBUG: <class 'bool'>
2025-08-26 13:08:18....
1
vote
2
answers
186
views
How to find the table name and when it is last used in PostgreSQL?
I am using PostgreSQL (on GCP Cloud SQL) and I want to find out when each table in the database was last used (read or write).
So far, I have checked:
pg_stat_user_tables → this shows row counts, ...
0
votes
1
answer
71
views
What is the closest a role can be to a superuser in Google Cloud PostgreSQL? [closed]
I'm re-organizing the user structure in my Google Cloud PostgreSQL instance. Originally, we had a single user with broad access to everything. I'm now aiming for a more granular approach, where each ...
0
votes
1
answer
133
views
How can I track Cloud SQL backup costs per instance in GCP if resource.id is missing in the billing export?
I'm trying to analyze and optimize the cost of Cloud SQL backups in Google Cloud. In the GCP billing export, I see multiple line items with the SKU:
"Cloud SQL: Backups in [region]" (e.g., ...
2
votes
1
answer
137
views
cloud_sql_proxy giving auth: "invalid_grant" "Bad Request" though user has all permissions - how to debug?
A coworker has a problem with cloud_sql_proxy in GCP. We have a very simple setup, connections are done with the Google account, not service accounts, no IP restrictions or any other specialities.
For ...
0
votes
1
answer
254
views
Issues with Datastream (maybe related to pSQL 17.5)
Okay, so I had this all working. PSQL -> Datastream -> BigQuery. It's all in Terraform, so presumably repeatable.
I deleted the database, and restored from a backup, and now Datastream refuses ...
1
vote
2
answers
87
views
How do I create Cloud SQL connection in apphosting.yaml?
The documentation for configuring cloud run with cloud SQL (https://cloud.google.com/sql/docs/mysql/connect-run#configure) shows how to add the connection for a new rollout using the UI, but when you ...
1
vote
0
answers
77
views
Postgres (Cloudsql) shows lock wait on write transactions during an index creation (on unrelated table)
I am using Postgresql on CloudSQL (GCP), in version 15.
(Running on 4vCPU, 16Gb RAM, with SSD disk)
We are observing an unexpected issue during index creation.
While creating an index on a large-ish ...
1
vote
1
answer
379
views
Can't connect to PostgreSQL, from Google Cloud Run to Google Cloud SQL
Sup?
I want to connect to my PostgreSQL database on Cloud SQL from Cloud Run, and whatever I do, I get errors. The most annoying one is the "connection refused" error. I have tried anything ...
1
vote
1
answer
364
views
Why I get connection timeout to Cloud SQL in GCP Cloud Functions Gen 2 randomly on some requests?
I have several Google Cloud Functions (Gen 2) functions that access a PostgreSQL database hosted in Cloud SQL, using node-postgres (pg).
These functions can be called multiple times by the same ...
0
votes
1
answer
73
views
How to prevent deletions from source (GCP CloudSQL MySQL) reflecting in GCP BigQuery using Datastream?
Description:
We are currently using Google Cloud Datastream to replicate data from a CloudSQL (MySQL) instance into BigQuery in near real-time. The replication works perfectly for insert and update ...
0
votes
1
answer
306
views
Error: googleapi: Error 404: The Cloud SQL instance does not exist., instanceDoesNotExist
Planning to create the Postgres Instance using the Backstage, Terraform via pre-defined templates.
While running the Terraform plan, stuck with the below error:
Error: googleapi\*\*: Error 404: The ...
0
votes
1
answer
91
views
When the Cloudsql restarted, all the Cloudrun service stops working
When the Cloudsql restarted, all the Cloudrun services linked to the Cloudsql(Database version is MySQL 8.4.4) stops working. with below error
Fatal error: Uncaught mysqli_sql_exception: Access denied ...
0
votes
2
answers
126
views
Support to node crypto module is required - gcloud sql connector
Any idea on what can cause the following issue? We're trying to migrate to the official Cloud SQL Node.js Connector but for some reason I'm getting the following issue when running a test connection ...
0
votes
1
answer
104
views
Is checkForServerUpgrade available in mySQL 5.7?
Specifically, is checkForServerUpgrade() available in google cloud's sql for mySQL? When I log into the cloud shell, connect to the db, and run the command, I get this.
I'm trying to update a db ...
1
vote
1
answer
71
views
MySQL, go-sql-driver with google auth token
I am looking to connect to a gcp managed db (running on GCP) via a cloud proxy (jump box with local port to connect to managed instance) with go-sql-driver but everything I've tried gcp MySQL instance ...
0
votes
1
answer
305
views
IAM roles tables permissions for cloud sql
I am trying to understand how to set up the postgres permissions such that my database tables can be read and edited by both a service account and other database users. This has proved impossible. [1]
...
0
votes
1
answer
54
views
CloudSQL Postgres ALTER USER name with "-"
I am trying to grant a service account with - in postgres. Google Cloud service accounts are setup like user-action@project-environment.
so far I tried:
ALTER USER '[email protected]....
1
vote
0
answers
91
views
Cloud SQL mysql database became very slow after disk got full and upgrade to add more space
the web service was working well before the mysql database instance in Cloud SQL went unavaialable because the disk got full. After adding more space, enough space , the db and the web service start ...
0
votes
1
answer
77
views
Connect to Cloud SQL in another project and VPC using Cloud Run and Serveless VPC Access
I'm trying to access a cloud sql that is in another vpc with cloud run. I peered the vpc but I can't. What should I do so that cloud run sees cloud sql? cloud run is in project A and cloud sql is in ...
0
votes
1
answer
231
views
Unable to connect to Cloud SQL PostgreSQL from Cloud Run using Unix Domain Socket
Environment
Google Cloud Run
Cloud SQL PostgreSQL instance
Node.js 18
TypeORM
Cloud SQL Auth Proxy (running in same container)
Current Setup
My Cloud Run service is configured with:
VPC Connector: ...
1
vote
1
answer
89
views
CI pipe failing to connect to test database
When I try to run my app's test suite in a CI pipe using Google Cloud Build, the process fails during the tests step with a database authentication error:
error: password authentication failed for ...
0
votes
1
answer
49
views
Deploying a working local piece of code to Google app engine
My site loads but one can't login. The issue is with database connection. When running on localhost, I had 3 files where this connection took code to get established.
Extensions.py
db = SQLAlchemy()
...
1
vote
1
answer
61
views
CakePHP connect to Google SQL Proxy Container
For starters, I have a docker container running for "cloud-sql-connectors/cloud-sql-proxy:2.14.3" and it has credentials and appears to have started and is running fine.
2025-01-29 12:31:44 ...
1
vote
1
answer
66
views
How to connect Google App Engine in Cloud SQL (MySQL 8.0) instance using Cloud IAM
I'm trying to connect my .NET app(MySqlConnector 2.4.0) running in App Engine to my MySQL instance running in Cloud SQL using Cloud IAM. I'm using the App Engine default service account for the IAM ...
-1
votes
1
answer
237
views
How to create a trigger in CloudSQL PostgreSQL that sends an HTTP POST request?
I have a table in a CloudSQL PostgreSQL database, and I want to create a trigger that sends an HTTP POST request whenever a new record is inserted into the table.
I know that PostgreSQL supports the ...
0
votes
1
answer
258
views
Why PostgreSQL postgres user's password is not needed with the Cloud SQL Auth Proxy
When connecting directly to a PostgreSQL Cloud SQL instance the password is required:
> psql --host=12.34.56.78 --dbname=mydb --username=postgres
Password for user postgres:
psql (17.2)
WARNING: ...
0
votes
0
answers
70
views
Managing Cloud SQL user grants at scale
I have multiple Cloud SQL instances some private and some public (working on getting all to be private). I use IAM authorization on the databases. The instances and users are created/managed using ...
1
vote
1
answer
199
views
Unable to connect to Google Cloud SQL PostgreSQL instance (private IP) using Go SQL Connector: iam.serviceAccounts.getAccessToken permission denied
I am trying to connect to a PostgreSQL database instance in Google Cloud (with a private IP connection) using the SQL Connector library in Go. However, I am encountering the following error:
ERROR ...
0
votes
0
answers
103
views
OpenTofu google_sql_database.sql_database creation leads to Error 403
I create a GCP Cloud-SQL instance with Open Tofu & Terragrunt in a GitHub Action with:
resource "google_sql_database_instance" "sql_instance" {
name = var....
0
votes
1
answer
107
views
JDBCIO.write ignoring batch size and inserting single record
I'm using Java Dataflow to insert huge data to Cloud SQL. What is observed in performance tests is Apache beam is not inserting records in a batch. Instead one insert query is triggered for each row.
...
0
votes
1
answer
54
views
flask-session on sqlalchemy does not accept db address info
I am trying to use flask-session to save session data in a MySQL db using SQLAlchemy. It works on my local machine. It also works in a Docker container. However, when I try to run it on Google Cloud, ...
2
votes
0
answers
80
views
Connecting MySQL Workbench to GCP [closed]
I have created MYSQL Instance on GCP.
I then added the IP Address of my laptop - 43.100...
Firewall permissions to for Ingres has been granted pass right with with an IP range of my computer IP ...
0
votes
2
answers
274
views
Google Cloud SQL Postgres connection issue from Springboot application in cloud run
I'm trying to deploy a Springboot application on Cloud Run and running into the issue of connection not getting connected for Prostgres Cloud SQL. I tried everything possible that I know of including ...
0
votes
0
answers
83
views
GCP database migration fails while recreating indexes
I created a continuous database migration job from an AWS RDS MySQL database to GCP Cloud SQL instance. Everything seemed to go well, until 8 hours in, I notice the new database size went to 0 and I ...
1
vote
1
answer
425
views
Google Cloud Run - Postgres SQL connection
I'm trying to deploy a container on Google Cloud Run that connects to a postgres db. I've followed the steps in this guide using the Cloud SQL connection setting on the container which I understand ...
0
votes
1
answer
531
views
How to connect Airflow 2 in Composer 3 to Cloud SQL via Private Service Connect (PSC)?
I'm using Google Cloud Composer v3 (Airflow 2) and need help with networking. I'm trying to connect Airflow DAGs running in Composer to a Cloud SQL PostgreSQL instance, which is accessed via Private ...
0
votes
0
answers
308
views
GoogleCloudSQL (PostgreSQL) Copy
I have a PostgreSQL instance on Google Cloud SQL, and I am trying a simple COPY command to load a CSV file in a Cloud Storage bucket.
COPY shapes (key_code, pref, city)
FROM 'gs://my_bucket/data.csv'
...
2
votes
2
answers
122
views
Most basic "bring your own data" query in GQL
In SQL, I can write a query that already includes the data such as the following:
SELECT 1
Or, with a slightly less trivial example:
WITH users as (
SELECT 1 id, "tom" name UNION ALL
...
0
votes
1
answer
278
views
"FATAL: remaining connection slots are reserved for non-replication superuser connections" triggers despite closing connections
I've created a simple program that repeatedly creates a connection to my database then closes the connection. The program produces an error on the sixth or seventh iteration. If I pause the program ...
0
votes
1
answer
350
views
Creating a cloudsql instance in the VPC network of my Project
I am trying to create a cloudsql instance with Private IP address as there is organization constraint for configuring Public IP on Cloud SQL instances. The VPC network of my project is not a shared ...
1
vote
1
answer
161
views
.NET Core Blazor Server cannot access to Cloud SQL in Cloud Run
I have several applications in my cloud run using PHP and .NET Core. My existing ASP.NET Core Web API does not have an issue when trying to connect with my Cloud SQL (MySQL). The access with either ...
0
votes
1
answer
77
views
Can't connect to MySQL db from cloud function
We're breaking some functionality out of our app engine project and moving it to google cloud functions (GCF).
For the life of me, I can't get a db connection from the GCF. The exact same code is ...
1
vote
1
answer
223
views
Having problems connecting a local Django project to a Cloud SQL database instance
I have a Cloud SQL database running on MySQL 8.0.31. Now, I have a Django 5.1 project that I want to connect the database with (with root permissions). However, whenever I run any python manage.py <...