This page includes tips for troubleshooting Cloud SQL issues for supported database engines. Some of these tips apply only to specific database engines, while others are common to all.
For troubleshooting tips for specific database engines, see their individual pages:
Check if your question or problem has already been addressed on one of the following pages:
- FAQ
- Known issues
- Error messages
- Diagnose issues
- Debug connection issues
- Issues updating storage capacity
Topics in this page include:
- Backup and recovery
- Cloning
- Connectivity
- Creating instances
- External primary
- External replica
- Flags
- High availability
- Import and export
- Integrate with Vertex AI
- Linked servers
- Logging
- Managing instances
- Private Service Connect
- Replication
Backup and recovery
| Issue | Troubleshooting |
|---|---|
| You can't see the current operation's status. | The Google Cloud console reports only success or failure when the operation
is done. It isn't designed to show warnings or other updates.
Run the
|
| You want to find out who issued an on-demand backup operation. | The user interface doesn't show the user who started an operation.
Look in the logs and filter by text to find the user. You may need to use audit logs for private information. Relevant log files include:
|
| After an instance is deleted, you can't take a backup of the instance. | If you delete an instance without taking a final backup of the data, then no data recovery is possible. However, if you restore the instance, then Cloud SQL also restores the backups. For more information on recovering a deleted instance, see Retain backups after instance deletion. If you have done an export operation, create a new instance and then do an import operation to recreate the database. Exports are written to Cloud Storage and imports are read from there. |
| An automated backup is stuck for many hours and can't be canceled. | Backups can take a long time depending on the database size.
If you really need to cancel the operation, you can ask
customer support to |
| A restore operation can fail when one or more users referenced in the SQL dump file don't exist. | Before restoring a SQL dump, all the database users who own objects or
were granted permissions on objects in the dumped database must exist in the
target database. If they don't, the restore operation fails to recreate the
objects with the original ownership or permissions.
Create the database users before restoring the SQL dump. |
| You want to increase the number of days that you can keep automatic backups from seven to 30 days, or longer. | You can
configure the number of automated backups to retain. Automated backups get pruned
regularly based on the retention value configured. Unfortunately, this means that the
currently visible backups are the only automated backups you can restore from.
To keep backups indefinitely, you can create an on-demand backup, as they are not deleted in the same way as automated backups. On-demand backups remain indefinitely. That is, they remain until they're deleted or the instance they belong to is deleted. Because that type of backup is not deleted automatically, it can affect billing. |
| An automated backup failed and you didn't receive an email notification. | To have Cloud SQL notify you of the backup's status, configure a log-based alert. |
| An instance is repeatedly failing because it is cycling between the failure and backup restore states. Attempts to connect to and use the database following restore fail. |
Things to try:
|
| You find you are missing data when performing a backup/restore operation. | Tables were created as unlogged. For example:
These tables are not included in a restore from a backup:
The solution is to avoid using unlogged tables if you want to restore those
tables through a backup. If you're restoring from a database that already
has unlogged tables, then you can dump the database to a file, and reload the
data after modifying the dumped file to |
| Unable to delete an instance when you elect to take a final backup at instance deletion. |
When you delete an instance, you're required to confirm whether you want to
take a final backup for your instance prior to deleting it. If you enabled
final backup using the final-backup instance setting, then the selection
you make when you delete your instance must match the final backup
instance configuration you set when you enabled final backup for your
instance. To mitigate this issue, do one of the following:
|
| Unable to create a replica instance after successfully creating a primary instance with the final backup setting. |
If you create a new instance with the final backup instance setting
enabled, then you must update the final backup organization policy
to apply the backup configurations to the primary instance only.
Final backups aren't supported for replica instances. For more information, see Cloud SQL organization policies. |
Clone
| Issue | Troubleshooting |
|---|---|
Cloning fails with constraints/sql.restrictAuthorizedNetworks error. |
The cloning operation is blocked by the Authorized Networks configuration.
Authorized Networks are configured for public IP addresses in the Connectivity section
of the Google Cloud console, and cloning is not permitted due to
security considerations.
Remove all |
Error message: Failed to create subnetwork. Couldn't find free
blocks in allocated IP ranges. Please allocate new ranges for this service
provider. Help Token: [help-token-id]. |
You're trying to use the Google Cloud console to clone an instance with a private IP address, but you didn't specify the allocated IP range that you want to use and the source instance isn't created with the specified range. As a result, the cloned instance is created in a random range. Use |
Connect
| Issue | Troubleshooting |
|---|---|
Aborted connection. |
The issue might be:
Applications must tolerate network failures and follow best practices such as connection pooling and retrying. Most connection poolers catch these errors where possible. Otherwise the application must either retry or fail gracefully. For connection retry, we recommend the following methods:
Combining these methods helps reduce throttling. |
Error message: Login failed for user "" |
You might encounter this login error during Microsoft Entra ID authentication. To resolve this issue, make sure that a SQL Server login exists for this Microsoft Entra ID user. |
| Network connectivity issues with private IP instances | You might experience some of the following issues during integration
setup:
For more information on how to help address these issues, see Troubleshooting Microsoft Entra ID integration. |
FATAL: database 'user' does not exist. |
gcloud sql connect --user only works with the default
postgres user.
Connect with the default user, then change users. |
| You want to find out who is connected. | Log into the database and run this command:
SELECT datname, usename, application_name as appname, client_addr, state, now() - backend_start |