This page discusses some of the error messages encountered in Cloud SQL.
Overview
Error messages in Cloud SQL come from many sources and appear in many places. Some error messages come from the database engines themselves, some from the Cloud SQL service, some from client applications, and some are returned by calls to the Cloud SQL Admin API.
This page includes some of the most common errors seen in Cloud SQL. If you do not find the error code or message you are looking for here, you can look for source reference material here:
If you don't find the reference material for the error message that you're seeing, you can also search in some of these places where other users may have relevant experience:
- Cloud SQL questions on Stack Overflow
- Public issue tracker for Cloud SQL
- DBA Stack Exchange
- Cloud SQL discuss group
- Google Cloud Slack community
- Google Cloud on Reddit
Operational errors
A | B | C | D | E | F | G | I | L | M | N | O | P | Q | R | S | T | U | W
Error message | Troubleshooting |
---|---|
Aborted connection xxx to db: DB_NAME. | The application isn't ending connections properly.
Check for the following conditions:
|
Access denied; you need (at least one of) the SUPER privilege(s) for this operation. | There could be a view, a function, or a procedure in the source
database referencing DEFINER in a way that's not supported
by Cloud SQL.
Update the definer in the external databases, for example
from |
Access denied for user 'XXX'@'XXX' (using password: XXX) | There could be several causes, including:
Try these things ...
|
Allocated IP range not found in network. | VPC peerings were not updated after an allocated range was modified
or removed.
You need to
modify the private connection. Use the following command, and make
sure to use the gcloud services vpc-peerings update \ --network=VPC_NETWORK \ --ranges=ALLOCATED_RANGES \ --service=servicenetworking.googleapis.com \ --force |
ANY command denied to user 'root'@'%' for table ... | The user doesn't have all the permissions it needs for this operation.
Try this:
|
Error message | Troubleshooting |
---|---|
Bad request. | This message can have many causes. Illegal Argument is one
of the most common. In this case, the request is using either the wrong
argument or an invalid value for the argument. For the many other
causes, the error message might contain a useful hint.
For |
Error message | Troubleshooting |
---|---|
Cannot modify allocated ranges in CreateConnection. Please use UpdateConnection. | VPC peerings were not updated after an allocated range was modified or removed.
You need to modify the private connection.
Use the following command, and make sure to use the gcloud services vpc-peerings update \ --network=VPC_NETWORK \ --ranges=ALLOCATED_RANGES \ --service=servicenetworking.googleapis.com \ --force |
Constraints/sql.restrictAuthorizedNetworks. | 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 isn't permitted due to
security considerations.
Remove all |
Error message | Troubleshooting |
---|---|
Disk is full. | The primary instance disk size can become full during replica creation.
Edit the primary instance to upgrade it to a larger disk size. |
Error message | Troubleshooting |
---|---|
Failed to create subnetwork. | No more available addresses in the IP range.
Couldn't find free blocks in allocated IP ranges. Please allocate new ranges for this service provider. There are no more available addresses in the allocated IP range. Consider these possible scenarios:
For each of the above scenarios, you can elect to either expand the existing or allocate an additional IP range to the private service connection. If you're allocating a new range, take care to not create an allocation that overlaps with any existing allocations. After creating a new IP range, update the VPC peering with the following command: gcloud services vpc-peerings update \ --service=servicenetworking.googleapis.com --ranges=OLD_RESERVED_RANGE_NAME,NEW_RESERVED_RANGE_NAME \ --network=VPC_NETWORK --project=PROJECT_ID \ --force If you're expanding an existing allocation, take care to only increase the allocation range and not decrease it. For example, if the original allocation was 10.0.10.0/24, make the new allocation at least 10.0.10.0/23. In general, if starting from a /24 allocation, decrementing the /mask by 1 for each condition (additional instance type group, additional region) is a good rule of thumb. For example, if trying to create both instance type groups on the same allocation, going from /24 to /23 is enough. After expanding an existing IP range, update the vpc peering with following command: gcloud services vpc-peerings update \ --service=servicenetworking.googleapis.com --ranges=RESERVED_RANGE_NAME \ --network=VPC_NETWORK \ --project=PROJECT_ID \ --force |
Error message | Troubleshooting |
---|---|
(gcloud.sql.connect) It seems your client does not have ipv6 connectivity and the database instance does not have an ipv4 address. | You're trying to connect to your private IP instance using Cloud Shell.
Connecting from Cloud Shell to an instance with only a private IP address isn't currently supported. |
Got packet bigger than max_allowed_packet bytes when
dumping table. |
The packet was larger than allowed by settings.
Use To learn more about using |
Error message | Troubleshooting |
---|---|
InnoDB: Write to file ./ibtmp1 failed at offset XXXX, YYYY bytes should have been written, only 0 were written. | The instance reached a hard limit when conducting an automated backup.
Check that your OS and file system support files of this size. Check that the disk isn't full or out of disk quota. You can request an increase to your quotas from the Google Cloud console or edit the instance to upgrade it to a larger disk size. |
Internal error. | The project could be missing the Service Networking service account
required for this feature.
To repair service permissions, disable the
|
Invalid request: Incorrect Service Networking config for instance. | Service Networking API isn't enabled in the project.
Enable the |
Error message | Troubleshooting |
---|---|
Network association failed. | The Service Networking API isn't enabled in the project.
Enable the |
Error message | Troubleshooting |
---|---|
Operation failed because another operation was already in progress. | Most operations in Cloud SQL are synchronous. You can
run only one at a time.
Wait for the previous operation to finish before beginning another. |
Operation isn't valid for this instance. | This error is returned from an API call to instances.restoreBackup ,
and it means that you cannot restore from backup to an instance with a storage size
(XX GB) smaller than the backup size (YY GB).
Edit the target instance to increase its storage size. |
Error message | Troubleshooting |
---|---|
Quota exceeded. | You reached the limit of your per-minute or daily quota. Review the
quotas and limits for Cloud SQL.
Request an increase to your quotas from the Google Cloud console. |
Error message | Troubleshooting |
---|---|
Remaining connection slots are reserved. | The maximum allowed connections have been reached.
Increase the value of the |
Request is missing a valid API key. | You might not have a valid service account key JSON file, or it might
not be stored in the expected location.
Verify that you have a valid service account key JSON file in
the location stored in the |
Error message | Troubleshooting |
---|---|
Specified key was too long; max key length is 767 bytes. | The external primary instance might have the variable innodb_large_prefix set.
Set the |
SSL error: invalid padding. | Server certificate error.
Create a new server certificate and rotate. |
System error occurred. |
Try these things ...
|
Error message | Troubleshooting |
---|---|
Table definition changed. | During the export process a change occurred in the table.
The dump transaction can fail if you use the following statements during the export operation:
Remove any of these statements from the dump operation. |
Temporary file size exceeds temp_file_limit. | The temp_file_limit flag is set too low for your database usage.
Increase the |
Table db.table doesn't exist | If one or more InnoDB table(s) disappeared after a MySQL restart and
the MySQL error log has the following warnings at the same time, it is due to
the foreign key and referenced key columns being out-of-sync.
[Warning] InnoDB: Load table db.table failed, the table has missing foreign key indexes. Turn off 'foreign_key_checks' and try again. [Warning] InnoDB: Cannot open table db/table from the internal data dictionary of InnoDB though the .frm file for the table exists. See InnoDB troubleshooting for more information. After a database restart, MySQL needs to load table(s) into the InnoDB dictionary cache on first access. If it detects the discrepancy, it blocks the access to that table. mysql> select * from db.table; ERROR 1146 (42S02): Table db.table doesn't exist Turning off The foreign key mismatch should be fixed to avoid any further issues.
|
(Timeout) during export. | CSV and SQL formats do export differently. The SQL format includes the entire
database and is likely to take longer to complete.
Use the CSV format and run multiple, smaller export jobs to reduce the size and length of each operation. |
Too many connections. | Setting the max_connections flag value too high can cause this
error. This can also be caused by enabling a flag out of sequence.
Lower the |
Error message | Troubleshooting | |
---|---|---|
x509: certificate isn't valid for any names. | Known issue: The
Cloud SQL Proxy Dialer isn't compatible with Go 1.15 at this time.
Until fixed, see this discussion on GitHub, which includes a workaround. |
Operation | The issue might be... | Things to try... |
---|---|---|
Add user | If the user already exists in the database, this error can occur when you try to add them. | Check to make sure the user doesn't already exist in the database. |
Backup | If you see this during automated or manual backups, it's likely the instance disk is full. | If the temporary file size is taking up too much space, you can restart the instance to remove the file and free up the disk space. Otherwise, you might need to upgrade your instance to a larger disk size. |
Clone | This can occur when there is a shortage of resources in the selected zone. | Try another zone in the region, or wait and try again later. |
Create instance |
|
|
Create replica | It's likely that a more specific error is in the log files. | Inspect the logs in Cloud Logging
to find the actual error.
If the error is If the error is
|
Export | If you see this while trying to export a database to a Cloud Storage bucket, the transfer may be failing due to a bandwidth issue. | The Cloud SQL instance may be located in a different region than the Cloud Storage bucket. Reading and writing data from one continent to another involves a lot of network usage, and can cause intermittent issues like this. |
Failover (legacy) | If you're using the legacy failover configuration, this can happen when the failover replica machine is not large enough to handle the failover. | The best solution is to migrate to the current high availability configuration. Otherwise you need to update the failover replica to a larger machine. |
Failover (automatic) | An automatic failover operation can produce this error message when the service detects that the primary instance is still responsive. | There is nothing to be done in this case. The failover won't occur because it isn't needed. |
Import | The import file may contain statements which require the superuser role. | Edit the file to remove any statements which require the superuser role. |
Cloud SQL also uses some third-party binaries (for example,
mysqld
), which can generate unknown error messages. Such errors are
internal to the third-party binaries and are outside the scope of Cloud SQL.
However, sometimes a more specific error can be found in the
Cloud SQL log files at around the same
time.
Also, sometimes it is an error code that is unknown. In this case,
the complete message can be Unknown Error Code
.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-12-19 UTC.