Category : google-cloud-sql

We migrated a service from GCP App Engine to Cloud Run. This service is connected to Cloud SQL. and its parameters are: max requests per container: 1 min instances: 0 max instances: 200 After receiving spikes, we have experienced this error multiple times: Cloud SQL connection failed. Please see https://cloud.google.com/sql/docs/mysql/connect-overview for additional details: googleapi: Error ..

Read more

I am trying to automate the process of building a Django app on Google Cloud Build. This app has to communicate with a PostgreSQL DB hosted on Cloud SQL and there’re three stages I would like to complete: Building the image with a Dockerfile Pushing the image to Artifact Registry Running Django migrations python manage.py ..

Read more

I have spring boot application, that works in docker container, and database configuration is quiet simple: spring: datasource: url: jdbc:postgresql://35.225.172.41/postgres username: root password: somePassword Docker file is also simple as possible: FROM adoptopenjdk/openjdk14:slim ARG JAR_FILE=build/libs/*.jar COPY ${JAR_FILE} app.jar ENTRYPOINT ["java","-jar","/app.jar"] I find out how to access database when I run application locally. I add my ..

Read more

I am connecting to my database using pg via TCP connection. index.js file: const pool = new Pool({ user: process.env.DB_USER_NAME, database: process.env.DB_NAME, password: process.env.DB_PASSWORD, host: process.env.MODE == "DEV" ? ‘cloud-sql-proxy’ : `/cloudsql/${process.env.DB_CONNECTION_NAME}`, port: process.env.DB_PORT }) Below is my docker-compose file for development environment. I have a DEVdatabase in my sql which the docker connects to ..

Read more

I can’t seem to connect to the cloudsql using docker container. Here is my docker-compose file version: ‘3.8’ services: cloud-sql-proxy: image: gcr.io/cloudsql-docker/gce-proxy:1.21.0 volumes: //the service credential is in the same folder. – "./google_service_acct.json:/tmp/keys/keyfile.json" command: /cloud_sql_proxy -instances=test-game-199281:us-east1:testgame=tcp:0.0.0.0:5432 -credential_file=/tmp/keys/keyfile.json expose: – 5432 app: build: context: . dockerfile: DockerFile.dev env_file: – ./.env volumes: – "./src:/app/src" ports: – "5000:5001" ..

Read more

I can’t seem to connect to the CloudSQL using Docker container. Here is my docker-compose file: version: ‘3.8’ services: cloud-sql-proxy: image: gcr.io/cloudsql-docker/gce-proxy:1.21.0 volumes: //the service credential is in the same folder. – "./google_service_acct.json:/tmp/keys/keyfile.json" command: /cloud_sql_proxy -instances=test-game-199281:us-east1:testgame=tcp:0.0.0.0:5432 -credential_file=/tmp/keys/keyfile.json expose: – 5432 app: build: context: . dockerfile: DockerFile.dev env_file: – ./.env volumes: – "./src:/app/src" ports: – "5000:5001" ..

Read more

I have a VM instance booting on container optimised OS and with the following Startup script: docker pull gcr.io/cloudsql-docker/gce-proxy:1.16 docker run -d -p 0.0.0.0:3306:3306 gcr.io/cloudsql-docker/gce-proxy:1.16 /cloud_sql_proxy -instances=<cloudsql-connection-name>=tcp:0.0.0.0:3306 When trying to connect to the db running the following command from the cloud shell mysql -ppass -u root I have the following error: ERROR 2002 (HY000): Can’t ..

Read more