Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

cloud instance refused to connect

Hi, I have created a cloud instance the server instance is working and and the forwarder instance is refusing to connect. can anyone help me on this please.

Thanks. 

0 1 302
1 REPLY 1

When facing connection refusals from a forwarder instance to a Cloud SQL instance, follow this structured approach for efficient troubleshooting:

Configuration Fundamentals

  1. Verify Instance Connection Name: Ensure the instance connection name matches exactly in your command string. For example, use cloud_sql_proxy -instances=<INSTANCE_CONNECTION_NAME>=tcp:3306 for MySQL. Common issues arise from typos or incorrect instance identifiers.

  2. IP Allowlisting: Check that your Cloud SQL instance's settings permit connections from the forwarder instance's IP address. This is crucial for establishing a secure connection pathway.

  3. Credentials Accuracy: Confirm that the username and password being used are correct and have the necessary permissions for database access.

Firewall Constraints

  1. Firewall Rules: Ensure no Google Cloud or external firewall rules are blocking access to the database port (3306 for MySQL, 5432 for PostgreSQL, 1433 for SQL Server) from the forwarder's IP address.

API and Logs

  1. Cloud SQL Admin API: This API must be enabled within your Google Cloud project to manage and operate Cloud SQL instances effectively.

  2. Log Inspection: Review the Cloud SQL instance logs for any specific error messages or warnings that could pinpoint the cause of the connection refusal.

Network Checkup

  1. Basic Connectivity Tests: Utilize ping and traceroute from the forwarder instance to the Cloud SQL instance's IP address to test the basic network connection.

  2. Port Accessibility: Test if the database port is reachable from the forwarder instance using telnet <Cloud SQL IP> <port>, replacing <port> with your database's specific port number.

If Using VPC Peering

  1. VPC Peering Configuration: Verify that the VPC peering setup is correct and that network routes are properly configured to allow traffic flow between the forwarder and the Cloud SQL instances.

SSL/TLS Considerations

  1. Certificate Checks: Ensure that any SSL certificates used for the connection have not expired and are correctly installed.

  2. SSL Configuration: Double-check that both the forwarder instance and the Cloud SQL instance are configured to support SSL connections.

Additional Notes

  • Cloud SQL Proxy Logs: The Cloud SQL Proxy generates its own set of logs, which can provide additional insights into connection issues.
  • Google Cloud Support: If you've worked through these steps and still encounter issues, reaching out to Google Cloud Support can provide more personalized troubleshooting assistance.