Visitar URL original
[Dataconnect] Cannot setup Postgres SQL permissions of Cloud SQL database · Issue #9314 · firebase/firebase-tools · GitHub
Skip to content

[Dataconnect] Cannot setup Postgres SQL permissions of Cloud SQL database #9314

Closed

Description

@JJeeff248

[REQUIRED] Environment info

firebase-tools: 14.19.1

Platform: Windows

[REQUIRED] Test case

./firebase.json

{
    "dataconnect": {
        "source": "dataconnect"
    }
}

./dataconnect/dataconnect.yaml

specVersion: "v1"
serviceId: "my-service"
location: "australia-southeast1"

schema:
  source: "./schema"
  datasource:
    postgresql:
      database: "my-database"
      cloudSql:
        instanceId: "my-instance"

connectorDirs: ["./connector"]

./dataconnect/connector/connector.yaml

connectorId: my-service
generate:
  javascriptSdk:
    - outputDir: ../../src/dataconnect-generated
      package: "@dataconnect/generated"
      packageJsonDir: ../..
      react: true
      angular: false

[REQUIRED] Steps to reproduce

  1. Initial deploy using firebase deploy
  2. Wait for database to be created
  3. Redeploy

[REQUIRED] Expected behavior

The new schema and connector are deployed

[REQUIRED] Actual behavior

Throws error

Error: Cannot setup Postgres SQL permissions of Cloud SQL database my-instance:my-database
Error: Connection terminated due to connection timeout
[2025-10-14T09:28:51.547Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
[2025-10-14T09:28:51.548Z] > authorizing via signed-in user (me@example.com)
[2025-10-14T09:28:51.548Z] [iam] checking project my-project-id for permissions ["cloudsql.instances.connect","firebase.projects.get","firebasedataconnect.schemas.list","firebasedataconnect.schemas.update","firebasedataconnect.services.list"]
[2025-10-14T09:28:51.549Z] Checked if tokens are valid: true, expires at: 1760437709331
[2025-10-14T09:28:51.549Z] Checked if tokens are valid: true, expires at: 1760437709331
[2025-10-14T09:28:51.550Z] >>> [apiv2][query] POST https://cloudresourcemanager.googleapis.com/v1/projects/my-project-id:testIamPermissions [none]
[2025-10-14T09:28:51.550Z] >>> [apiv2][(partial)header] POST https://cloudresourcemanager.googleapis.com/v1/projects/my-project-id:testIamPermissions x-goog-quota-user=projects/my-project-id
[2025-10-14T09:28:51.550Z] >>> [apiv2][body] POST https://cloudresourcemanager.googleapis.com/v1/projects/my-project-id:testIamPermissions {"permissions":["cloudsql.instances.connect","firebase.projects.get","firebasedataconnect.schemas.list","firebasedataconnect.schemas.update","firebasedataconnect.services.list"]}
[2025-10-14T09:28:51.961Z] <<< [apiv2][status] POST https://cloudresourcemanager.googleapis.com/v1/projects/my-project-id:testIamPermissions 200
[2025-10-14T09:28:51.961Z] <<< [apiv2][body] POST https://cloudresourcemanager.googleapis.com/v1/projects/my-project-id:testIamPermissions {"permissions":["cloudsql.instances.connect","firebase.projects.get","firebasedataconnect.schemas.list","firebasedataconnect.schemas.update","firebasedataconnect.services.list"]}
[2025-10-14T09:28:51.961Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
[2025-10-14T09:28:51.961Z] > authorizing via signed-in user (me@example.com)
i  dataconnect: ensuring required API firebasedataconnect.googleapis.com is enabled... 
i  dataconnect: ensuring required API sqladmin.googleapis.com is enabled... 
[2025-10-14T09:28:51.981Z] Checked if tokens are valid: true, expires at: 1760437709331
[2025-10-14T09:28:51.981Z] Checked if tokens are valid: true, expires at: 1760437709331
[2025-10-14T09:28:51.981Z] >>> [apiv2][query] GET https://firebasedataconnect.googleapis.com/v1/projects/my-project-id/locations/australia-southeast1/services/my-service/schemas/main [none]
[2025-10-14T09:28:52.421Z] <<< [apiv2][status] GET https://firebasedataconnect.googleapis.com/v1/projects/my-project-id/locations/australia-southeast1/services/my-service/schemas/main 200
[2025-10-14T09:28:52.421Z] <<< [apiv2][body] GET https://firebasedataconnect.googleapis.com/v1/projects/my-project-id/locations/australia-southeast1/services/my-service/schemas/main {"name":"projects/my-project-id/locations/australia-southeast1/services/my-service/schemas/main","createTime":"2025-10-14T09:06:38.842052996Z","updateTime":"2025-10-14T09:17:34.424851998Z","source":{"files":[{"path":"schema.gql","content":"type User @table {\n    id: UUID! @default(expr: \"uuidV4()\")\n    username: String!\n    email: String!\n    createdAt: Timestamp! @default(expr: \"request.time\")\n    updatedAt: Timestamp! @default(expr: \"request.time\")\n    authUid: String! @unique\n    avatarUrl: String\n    # Relationships\n    # Reverse relationships are automatically generated by Data Connect\n}\n\ntype Group @table {\n    id: UUID! @default(expr: \"uuidV4()\")\n    name: String!\n    description: String\n    createdAt: Timestamp! @default(expr: \"request.time\")\n    updatedAt: Timestamp! @default(expr: \"request.time\")\n    creatorId: UUID!\n\n    # Relationships\n    creator: User! @ref(fields: [\"creatorId\"], references: [\"id\"])\n    # Reverse relationships are automatically generated by Data Connect\n}\n\ntype Event @table {\n    id: UUID! @default(expr: \"uuidV4()\")\n    title: String!\n    description: String\n    startDate: Date!\n    endDate: Date\n    startTime: Timestamp\n    endTime: Timestamp\n    isAllDay: Boolean! @default(value: false)\n    color: String\n    createdAt: Timestamp! @default(expr: \"request.time\")\n    updatedAt: Timestamp!\n\n    # Relationships\n    creatorId: UUID!\n    creator: User! @ref(fields: [\"creatorId\"], references: [\"id\"])\n    groupId: UUID\n    group: Group @ref(fields: [\"groupId\"], references: [\"id\"])\n}\n\ntype List @table {\n    id: UUID! @default(expr: \"uuidV4()\")\n    title: String!\n    description: String\n    color: String\n    createdAt: Timestamp! @default(expr: \"request.time\")\n    updatedAt: Timestamp!\n\n    # Relationships\n    creatorId: UUID!\n    creator: User! @ref(fields: [\"creatorId\"], references: [\"id\"])\n    groupId: UUID\n    group: Group @ref(fields: [\"groupId\"], references: [\"id\"])\n    # Reverse relationships are automatically generated by Data Connect\n}\n\ntype Task @table {\n    id: UUID! @default(expr: \"uuidV4()\")\n    title: String!\n    description: String\n    completed: Boolean! @default(value: false)\n    priority: Int @default(value: 0)\n    dueDate: Date\n    createdAt: Timestamp! @default(expr: \"request.time\")\n    updatedAt: Timestamp!\n\n    # Relationships\n    creatorId: UUID!\n    creator: User! @ref(fields: [\"creatorId\"], references: [\"id\"])\n    listId: UUID!\n    list: List! @ref(fields: [\"listId\"], references: [\"id\"])\n}\n\nenum GroupRole {\n    OWNER\n    ADMIN\n    MEMBER\n    CHILD\n    PET\n}\n\ntype GroupMember @table(key: [\"groupId\", \"userId\"]) {\n    groupId: UUID!\n    userId: UUID!\n    role: GroupRole! @default(value: MEMBER)\n    joinedAt: Timestamp! @default(expr: \"request.time\")\n\n    # Relationships\n    group: Group! @ref(fields: [\"groupId\"], references: [\"id\"])\n    user: User! @ref(fields: [\"userId\"], references: [\"id\"])\n}\n"}]},"uid":"d6b6aa2d-f49b-49d5-9ecb-28dc43d9d2d8","reconciling":false,"datasources":[{"postgresql":{"database":"my-database","cloudSql":{"instance":"projects/my-project-id/locations/australia-southeast1/instances/my-instance"},"schemaMigration":"MIGRATE_COMPATIBLE"}}],"etag":"KX-BFzTTR4LU9gALqK3qLLUXmzuaTt5wEkc_VWMkjZk"}
[2025-10-14T09:28:52.421Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
[2025-10-14T09:28:52.421Z] > authorizing via signed-in user (me@example.com)
[2025-10-14T09:28:52.422Z] Checked if tokens are valid: true, expires at: 1760437709331
[2025-10-14T09:28:52.422Z] Checked if tokens are valid: true, expires at: 1760437709331
[2025-10-14T09:28:52.422Z] >>> [apiv2][query] POST https://sqladmin.googleapis.com/v1/projects/my-project-id/instances/my-instance/users [none]
[2025-10-14T09:28:52.422Z] >>> [apiv2][body] POST https://sqladmin.googleapis.com/v1/projects/my-project-id/instances/my-instance/users {"name":"me@example.com","instance":"my-instance","project":"my-project-id","sqlserverUserDetails":{"disabled":false,"serverRoles":["cloudsqlsuperuser"]},"type":"CLOUD_IAM_USER"}
[2025-10-14T09:28:53.074Z] <<< [apiv2][status] POST https://sqladmin.googleapis.com/v1/projects/my-project-id/instances/my-instance/users 200
[2025-10-14T09:28:53.074Z] <<< [apiv2][body] POST https://sqladmin.googleapis.com/v1/projects/my-project-id/instances/my-instance/users {"kind":"sql#operation","targetLink":"https://sqladmin.googleapis.com/v1/projects/my-project-id/instances/my-instance","status":"DONE","user":"me@example.com","insertTime":"2025-10-14T09:28:54.938Z","startTime":"2025-10-14T09:28:55.059Z","endTime":"2025-10-14T09:28:55.185Z","operationType":"CREATE_USER","name":"d796701a-b8ff-4677-aa7e-c3fc00000034","targetId":"my-instance","selfLink":"https://sqladmin.googleapis.com/v1/projects/my-project-id/operations/d796701a-b8ff-4677-aa7e-c3fc00000034","targetProject":"my-project-id"}
[2025-10-14T09:28:53.074Z] Checked if tokens are valid: true, expires at: 1760437709331
[2025-10-14T09:28:53.074Z] Checked if tokens are valid: true, expires at: 1760437709331
[2025-10-14T09:28:53.075Z] >>> [apiv2][query] GET https://sqladmin.googleapis.com/v1/projects/my-project-id/operations/d796701a-b8ff-4677-aa7e-c3fc00000034 [none]
[2025-10-14T09:28:53.171Z] <<< [apiv2][status] GET https://sqladmin.googleapis.com/v1/projects/my-project-id/operations/d796701a-b8ff-4677-aa7e-c3fc00000034 200
[2025-10-14T09:28:53.172Z] <<< [apiv2][body] GET https://sqladmin.googleapis.com/v1/projects/my-project-id/operations/d796701a-b8ff-4677-aa7e-c3fc00000034 {"kind":"sql#operation","targetLink":"https://sqladmin.googleapis.com/v1/projects/my-project-id/instances/my-instance","status":"DONE","user":"me@example.com","insertTime":"2025-10-14T09:28:54.938Z","startTime":"2025-10-14T09:28:55.059Z","endTime":"2025-10-14T09:28:55.185Z","operationType":"CREATE_USER","name":"d796701a-b8ff-4677-aa7e-c3fc00000034","targetId":"my-instance","selfLink":"https://sqladmin.googleapis.com/v1/projects/my-project-id/operations/d796701a-b8ff-4677-aa7e-c3fc00000034","targetProject":"my-project-id"}
[2025-10-14T09:28:53.173Z] Checked if tokens are valid: true, expires at: 1760437709331
[2025-10-14T09:28:53.173Z] Checked if tokens are valid: true, expires at: 1760437709331
[2025-10-14T09:28:53.173Z] >>> [apiv2][query] GET https://cloudresourcemanager.googleapis.com/v1/projects/my-project-id [none]
[2025-10-14T09:28:53.411Z] <<< [apiv2][status] GET https://cloudresourcemanager.googleapis.com/v1/projects/my-project-id 200
[2025-10-14T09:28:53.411Z] <<< [apiv2][body] GET https://cloudresourcemanager.googleapis.com/v1/projects/my-project-id {"projectNumber":"698202006599","projectId":"my-project-id","lifecycleState":"ACTIVE","name":"my-project-id","labels":{"firebase":"enabled","firebase-core":"disabled"},"createTime":"2025-08-30T06:43:24.553242Z","parent":{"type":"organization","id":"783254436661"}}
[2025-10-14T09:28:53.412Z] Checked if tokens are valid: true, expires at: 1760437709331
[2025-10-14T09:28:53.412Z] Checked if tokens are valid: true, expires at: 1760437709331
[2025-10-14T09:28:53.412Z] >>> [apiv2][query] POST https://sqladmin.googleapis.com/v1/projects/my-project-id/instances/my-instance/users [none]
[2025-10-14T09:28:53.412Z] >>> [apiv2][body] POST https://sqladmin.googleapis.com/v1/projects/my-project-id/instances/my-instance/users {"name":"service-698202006599@gcp-sa-firebasedataconnect.iam","instance":"my-instance","project":"my-project-id","sqlserverUserDetails":{"disabled":false,"serverRoles":["cloudsqlsuperuser"]},"type":"CLOUD_IAM_SERVICE_ACCOUNT"}
[2025-10-14T09:28:53.678Z] <<< [apiv2][status] POST https://sqladmin.googleapis.com/v1/projects/my-project-id/instances/my-instance/users 200
[2025-10-14T09:28:53.678Z] <<< [apiv2][body] POST https://sqladmin.googleapis.com/v1/projects/my-project-id/instances/my-instance/users {"kind":"sql#operation","targetLink":"https://sqladmin.googleapis.com/v1/projects/my-project-id/instances/my-instance","status":"DONE","user":"me@example.com","insertTime":"2025-10-14T09:28:55.639Z","startTime":"2025-10-14T09:28:55.662Z","endTime":"2025-10-14T09:28:55.787Z","operationType":"CREATE_USER","name":"d73a4858-dce2-4a2b-818e-72dd00000034","targetId":"my-instance","selfLink":"https://sqladmin.googleapis.com/v1/projects/my-project-id/operations/d73a4858-dce2-4a2b-818e-72dd00000034","targetProject":"my-project-id"}
[2025-10-14T09:28:53.679Z] Checked if tokens are valid: true, expires at: 1760437709331
[2025-10-14T09:28:53.679Z] Checked if tokens are valid: true, expires at: 1760437709331
[2025-10-14T09:28:53.679Z] >>> [apiv2][query] GET https://sqladmin.googleapis.com/v1/projects/my-project-id/operations/d73a4858-dce2-4a2b-818e-72dd00000034 [none]
[2025-10-14T09:28:53.761Z] <<< [apiv2][status] GET https://sqladmin.googleapis.com/v1/projects/my-project-id/operations/d73a4858-dce2-4a2b-818e-72dd00000034 200
[2025-10-14T09:28:53.761Z] <<< [apiv2][body] GET https://sqladmin.googleapis.com/v1/projects/my-project-id/operations/d73a4858-dce2-4a2b-818e-72dd00000034 {"kind":"sql#operation","targetLink":"https://sqladmin.googleapis.com/v1/projects/my-project-id/instances/my-instance","status":"DONE","user":"me@example.com","insertTime":"2025-10-14T09:28:55.639Z","startTime":"2025-10-14T09:28:55.662Z","endTime":"2025-10-14T09:28:55.787Z","operationType":"CREATE_USER","name":"d73a4858-dce2-4a2b-818e-72dd00000034","targetId":"my-instance","selfLink":"https://sqladmin.googleapis.com/v1/projects/my-project-id/operations/d73a4858-dce2-4a2b-818e-72dd00000034","targetProject":"my-project-id"}
[2025-10-14T09:28:53.762Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
[2025-10-14T09:28:53.762Z] > authorizing via signed-in user (me@example.com)
[2025-10-14T09:28:53.763Z] Checked if tokens are valid: true, expires at: 1760437709331
[2025-10-14T09:28:53.763Z] Checked if tokens are valid: true, expires at: 1760437709331
[2025-10-14T09:28:53.763Z] >>> [apiv2][query] GET https://sqladmin.googleapis.com/v1/projects/my-project-id/instances/my-instance [none]
[2025-10-14T09:28:53.851Z] <<< [apiv2][status] GET https://sqladmin.googleapis.com/v1/projects/my-project-id/instances/my-instance 200
[2025-10-14T09:28:53.851Z] <<< [apiv2][body] GET https://sqladmin.googleapis.com/v1/projects/my-project-id/instances/my-instance {"kind":"sql#instance","state":"RUNNABLE","databaseVersion":"POSTGRES_15","settings":{"authorizedGaeApplications":[],"tier":"db-f1-micro","kind":"sql#settings","userLabels":{"firebase-data-connect":"nt"},"availabilityType":"ZONAL","pricingPlan":"PER_USE","replicationType":"SYNCHRONOUS","activationPolicy":"ALWAYS","ipConfiguration":{"authorizedNetworks":[{"value":"my-ip-address","name":"pc","kind":"sql#aclEntry"}],"sslMode":"ALLOW_UNENCRYPTED_AND_ENCRYPTED","ipv4Enabled":true,"requireSsl":false,"enablePrivatePathForGoogleCloudServices":false,"serverCaMode":"GOOGLE_MANAGED_INTERNAL_CA"},"locationPreference":{"zone":"australia-southeast1-b","kind":"sql#locationPreference"},"databaseFlags":[{"name":"cloudsql.iam_authentication","value":"on"}],"dataDiskType":"PD_SSD","backupConfiguration":{"startTime":"10:00","kind":"sql#backupConfiguration","backupRetentionSettings":{"retentionUnit":"COUNT","retainedBackups":7},"enabled":false,"transactionLogRetentionDays":7,"transactionalLogStorageState":"TRANSACTIONAL_LOG_STORAGE_STATE_UNSPECIFIED","backupTier":"STANDARD"},"insightsConfig":{"queryInsightsEnabled":true,"queryStringLength":1024,"queryPlansPerMinute":5},"edition":"ENTERPRISE","connectorEnforcement":"NOT_REQUIRED","settingsVersion":"3","storageAutoResizeLimit":"0","storageAutoResize":false,"dataDiskSizeGb":"10","deletionProtectionEnabled":false,"replicationLagMaxSeconds":31536000,"enableGoogleMlIntegration":false},"etag":"c7cca4971aafe7deea90139dfd055224bbfc99c3e5fd070b10d729d0dec66a0b","ipAddresses":[{"type":"PRIMARY","ipAddress":"primary-ip"},{"type":"OUTGOING","ipAddress":"outgoing-ip"}],"serverCaCert":{"kind":"sql#sslCert","certSerialNumber":"0","cert":"---pub-key---","commonName":"C=US,O=Google\\, Inc,CN=Google Cloud SQL Server CA,dnQualifier=5ac647be-97d5-467f-9995-3827cc20e105","sha1Fingerprint":"47c1438a46fb6ac1acb44dcda1a27434c750348a","instance":"my-instance","createTime":"2025-10-14T09:06:34.779Z","expirationTime":"2035-10-12T09:07:34.779Z"},"instanceType":"CLOUD_SQL_INSTANCE","project":"my-project-id","serviceAccountEmailAddress":"p698202006599-l2n2ez@gcp-sa-cloud-sql.iam.gserviceaccount.com","backendType":"SECOND_GEN","selfLink":"https://sqladmin.googleapis.com/v1/projects/my-project-id/instances/my-instance","connectionName":"my-project-id:australia-southeast1:my-instance","name":"my-instance","region":"australia-southeast1","gceZone":"australia-southeast1-b","databaseInstalledVersion":"POSTGRES_15_14","maintenanceVersion":"POSTGRES_15_14.R20250727.00_29","createTime":"2025-10-14T09:06:33.849Z","sqlNetworkArchitecture":"NEW_NETWORK_ARCHITECTURE","satisfiesPzi":false,"includeReplicasForMajorVersionUpgrade":false}
[2025-10-14T09:28:53.851Z] Checked if tokens are valid: true, expires at: 1760437709331
[2025-10-14T09:28:53.851Z] Checked if tokens are valid: true, expires at: 1760437709331
[2025-10-14T09:28:53.851Z] >>> [apiv2][query] GET https://sqladmin.googleapis.com/v1/projects/my-project-id/instances/my-instance/users/me@example.com [none]
[2025-10-14T09:28:53.994Z] <<< [apiv2][status] GET https://sqladmin.googleapis.com/v1/projects/my-project-id/instances/my-instance/users/me@example.com 200
[2025-10-14T09:28:53.994Z] <<< [apiv2][body] GET https://sqladmin.googleapis.com/v1/projects/my-project-id/instances/my-instance/users/me@example.com {"kind":"sql#user","etag":"7e7dc64fc6c0041832e2690db29c922db54926916afeed3a4e6718205ce138fb","name":"me@example.com","host":"","instance":"my-instance","project":"my-project-id","type":"CLOUD_IAM_USER","iamStatus":"IAM_STATUS_UNSPECIFIED"}
[2025-10-14T09:28:54.018Z] Checked if tokens are valid: true, expires at: 1760437709331
[2025-10-14T09:28:54.018Z] Checked if tokens are valid: true, expires at: 1760437709331
[2025-10-14T09:28:54.018Z] >>> [apiv2][query] GET https://sqladmin.googleapis.com/sql/v1beta4/projects/my-project-id/instances/my-instance/connectSettings [none]
[2025-10-14T09:28:54.095Z] <<< [apiv2][status] GET https://sqladmin.googleapis.com/sql/v1beta4/projects/my-project-id/instances/my-instance/connectSettings 200
[2025-10-14T09:28:54.096Z] <<< [apiv2][body] GET https://sqladmin.googleapis.com/sql/v1beta4/projects/my-project-id/instances/my-instance/connectSettings {"kind":"sql#connectSettings","serverCaCert":{"kind":"sql#sslCert","certSerialNumber":"0","cert":"---pub-key---","commonName":"C=US,O=Google\\, Inc,CN=Google Cloud SQL Server CA,dnQualifier=5ac647be-97d5-467f-9995-3827cc20e105","sha1Fingerprint":"47c1438a46fb6ac1acb44dcda1a27434c750348a","instance":"my-instance","createTime":"2025-10-14T09:06:34.779Z","expirationTime":"2035-10-12T09:07:34.779Z"},"ipAddresses":[{"type":"PRIMARY","ipAddress":"primary-ip"},{"type":"OUTGOING","ipAddress":"outgoing-ip"}],"region":"australia-southeast1","databaseVersion":"POSTGRES_15","backendType":"SECOND_GEN","serverCaMode":"GOOGLE_MANAGED_INTERNAL_CA"}
[2025-10-14T09:28:54.096Z] Checked if tokens are valid: true, expires at: 1760437709331
[2025-10-14T09:28:54.096Z] Checked if tokens are valid: true, expires at: 1760437709331
[2025-10-14T09:28:54.097Z] Checked if tokens are valid: true, expires at: 1760437709331
[2025-10-14T09:28:54.097Z] Checked if tokens are valid: true, expires at: 1760437709331
[2025-10-14T09:28:54.097Z] >>> [apiv2][query] POST https://sqladmin.googleapis.com/sql/v1beta4/projects/my-project-id/instances/my-instance:generateEphemeralCert [none]
[2025-10-14T09:28:54.097Z] >>> [apiv2][body] POST https://sqladmin.googleapis.com/sql/v1beta4/projects/my-project-id/instances/my-instance:generateEphemeralCert {"public_key":"---pub-key---","access_token":"---access_token---"}
[2025-10-14T09:28:54.170Z] <<< [apiv2][status] POST https://sqladmin.googleapis.com/sql/v1beta4/projects/my-project-id/instances/my-instance:generateEphemeralCert 200
[2025-10-14T09:28:54.170Z] <<< [apiv2][body] POST https://sqladmin.googleapis.com/sql/v1beta4/projects/my-project-id/instances/my-instance:generateEphemeralCert {"ephemeralCert":{"kind":"sql#sslCert","certSerialNumber":"","cert":"---pub-key---"}}
[2025-10-14T09:28:55.188Z] Error: Connection terminated due to connection timeout
    at C:\Users\USER\AppData\Roaming\nvm\v24.10.0\node_modules\firebase-tools\node_modules\pg-pool\index.js:45:11
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async execute (C:\Users\USER\AppData\Roaming\nvm\v24.10.0\node_modules\firebase-tools\lib\gcp\cloudsql\connect.js:61:18)
    at async executeSqlCmdsAsIamUser (C:\Users\USER\AppData\Roaming\nvm\v24.10.0\node_modules\firebase-tools\lib\gcp\cloudsql\connect.js:88:12)
    at async getSchemaMetadata (C:\Users\USER\AppData\Roaming\nvm\v24.10.0\node_modules\firebase-tools\lib\gcp\cloudsql\permissionsSetup.js:135:31)
    at async Command.actionFn (C:\Users\USER\AppData\Roaming\nvm\v24.10.0\node_modules\firebase-tools\lib\commands\dataconnect-sql-setup.js:36:24)

Error: An unexpected error has occurred.

Activity

  1. google-oss-bot commented on Oct 14, 2025

    @google-oss-bot
    Collaborator

    This issue does not have all the information required by the template. Looks like you forgot to fill out some sections. Please update the issue with more information.

  2. self-assigned this
    on Oct 14, 2025
  3. ssingh076 commented on Oct 15, 2025

    @ssingh076

    Hello, I'm also experiencing deployment issues and wanted to share my debug logs from a local machine deployment, which might be related or offer additional clues.

    Environment:

    Operating System: Windows 10
    Firebase Tools Version: (14.19.1)
    Platform: Windows, deploying from VS Code terminal
    Command: firebase deploy --only dataconnect --debug
    Configuration:

    dataconnect.yaml:
    specVersion: "v1"
    serviceId: "my-service-id"
    location: "us-central1"
    schema:
    source: "./schema"
    datasource:
    postgresql:
    database: "dbname"
    cloudSql:
    instanceId: "my-instance-id"
    connectorDirs: ["./example"]

    Cloud SQL Instance: The instance has both a Public and Private IP enabled, and "Authorized networks" is configured to allow connections from my IP.
    Behavior: The debug log shows that the CLI successfully authenticates with the SQL Admin API and receives an ephemeral certificate. However, the subsequent attempt to connect to the database to manage permissions fails with a connection timeout.

    Debug Log Snippet: This log is from my local machine. It shows the successful API call followed by the timeout.

    [2025-10-15T13:03:05.696Z] >>> [apiv2][query] POST https://sqladmin.googleapis.com/sql/v1beta4/projects/my-project/instances/instance-id:generateEphemeralCert [none]
    [2025-10-15T13:03:06.425Z] <<< [apiv2][status] POST https://sqladmin.googleapis.com/sql/v1beta4/projects/my-project/instances/instance-id:generateEphemeralCert 200
    [2025-10-15T13:03:06.426Z] <<< [apiv2][body] POST https://sqladmin.googleapis.com/sql/v1beta4/projects/my-project/instances/instance-id:generateEphemeralCert {"ephemeralCert":{...}}

    Error: Cannot setup Postgres SQL permissions of Cloud SQL database serviceid:dbname
    Error: Connection terminated due to connection timeout

  4. genorbiter commented on Oct 31, 2025

    @genorbiter

    @joehan Can we have an update or eta on this issue? *please and thank you.

  5. genorbiter commented on Nov 30, 2025

    @genorbiter

    Has anyone been able to resolve this themselves? Perhaps provide direction/steps to get passed this?

  6. assigned and unassigned on Dec 2, 2025
  7. Amaimaya commented on Dec 17, 2025

    @Amaimaya

    Hi, I am also experiencing the same issue and cannot deploy. Anyone has some updates?

  8. tammam-g commented on Dec 17, 2025

    @tammam-g
    Contributor

    Hey @Amaimaya can you share what region your data connect service and sql database are in?

  9. Amaimaya commented on Dec 18, 2025

    @Amaimaya

    Hey @Amaimaya can you share what region your data connect service and sql database are in?

    europe-west1

  10. AdityaChaudhary commented on Dec 25, 2025

    @AdityaChaudhary

    I'm facing the same issue.

  11. AdityaChaudhary commented on Dec 26, 2025

    @AdityaChaudhary

    Used Firebase Studio to deploy the same app. Everything works fine there.

  12. kiranmarshall commented on Jan 1, 2026

    @kiranmarshall

    @tammam-g I am facing this exact issue in australia-southeast1

    EDIT: just a note for anyone using data connect - downgrading to 14 will disable admin sdk generation for your dc schemas, so you'll need to run 14 and 15 in parallel.

  13. ssingh076 commented on Jan 2, 2026

    @ssingh076

    Has anyone been able to resolve this themselves? Perhaps provide direction/steps to get passed this?

    I have to use firebase-tools@14.17.0

  14. BobReal0822 commented on Jan 11, 2026

    @BobReal0822

    Has anyone been able to resolve this themselves? Perhaps provide direction/steps to get passed this?

    I have to use firebase-tools@14.17.0

    This solved my problem. 👍

  15. fredzqm commented on Jan 12, 2026

    @fredzqm
    Contributor

    Thank you! Good insights. Maybe there is a regression introduced that we can narrow down.

    Has anyone been able to resolve this themselves? Perhaps provide direction/steps to get passed this?

    I have to use firebase-tools@14.17.0

  16. fredzqm commented on Jan 22, 2026

    @fredzqm
    Contributor

    Has anyone still experienced this issue in the latest CLi release?

    I am hoping #9725 would help with it.

  17. fredzqm commented on Jan 29, 2026

    @fredzqm
    Contributor

    Thank you everyone for reporting and +1 this important issues.

    Going to close it and it looks like the above fixed have worked.

    Let us know if you can still reproduce this issue in latest CLI release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions