Skip to content

GCP Cloud SQL auth failure #800

@hulto

Description

@hulto

Work around

  1. Terraform apply
  2. Hit error
  3. Download connect auth proxy https://cloud.google.com/sql/docs/mysql/connect-auth-proxy
  4. Run it with correct SQL "Connection name". Eg. ./cloud-sql-proxy ccdc-red-team-infra:us-east4:tavern-db2
  5. Login with mysql
$ mysql --get-server-public-key -h 127.0.0.1 -u tavern -p
Enter password: 
  1. Paste password from cloud run YAML to login
    image
  2. Re-apply terraform

Describe the bug
When deploying Realm with Terraform the container fails to start with error:

2024/10/25 15:58:08 fatal error: failed to initialize graph schema: mysql: querying mysql version Error 1045 (28000): Access denied for user 'tavern2'@'cloudsqlproxy~34.34.234.112' (using password: YES)

To Reproduce
Follow terraform setup.
Terraform apply.

Expected behavior
Realm should be able to authenticate to the sql database.

Screenshots
image

Additional context
Able to reproduce locally using the cloud sql auth proxy https://cloud.google.com/sql/docs/mysql/connect-auth-proxy

Testing a manually created user tavern2 and an automated user created tavern-auto
image

image
The manually created user is able to authenticate the automatically created one is not (even after updating TF to explicitly allow "%")

image

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions