View a markdown version of this page

Data movement errors - Amazon Aurora

Data movement errors

In a database cluster group for Aurora, data movement moves a collocation to another member cluster with minimal downtime. Use the tables in this topic to find the cause of an error from a move statement, a data movement job, or a limit on the group's routing metadata. For more information about fixing some of these errors, see Fixing data movement and group limit errors by code. A data movement job records its failure reason in move_info. For more information about causes and fixes by symptom, see A data movement job is stuck or failed. For instructions on handling a read or write that is refused during the cutover of a move (63927), see Session and transaction errors and Moving data between member clusters. The cutover can also end an open transaction on a moving object, so a routed session instead receives 1180, 1927, or 1317. For more information about handling these errors, see Moving data between member clusters.

Data movement error codes

The following table lists the errors for move statements and move jobs, one error in each row.

Code (SQLSTATE) Message Cause
1227 (42000) Access denied; you need the 'DBCLUSTERGROUP_MOVE_ADMIN' privilege for this operation Your router user lacks the dbclustergroup_move_admin privilege.
3168 (HY000) The database cluster group metadata is temporarily unavailable The metadata service is unreachable or failing over. Wait briefly, then retry the statement.
1064 (42000) A MySQL syntax error The syntax of the query is invalid.
1179 (25000) You are not allowed to execute this command in a transaction The statement cannot be executed within an explicit transaction. Run the statement outside of a transaction.
1221 (HY000) Only 1 active data movement job is allowed. Job job_id is still running. Check the 'dbclustergroup_data_movement.move_info' table for more details., or Only 1 active data movement job is allowed. Clean up has not yet completed for job job_id. Check the 'dbclustergroup_data_movement.move_info' table for more details. The database cluster group for Aurora runs one data movement job at a time. A job stays active until its cleanup completes.
1221 (HY000) Cannot start MOVE because of a conflicting move on collocation group 'collocation_group'. Please try again after the operation completes. Another data movement job is active for the collocation.
1221 (HY000) The source 'source_member_cluster_alias' and the target 'target_member_cluster_alias' resolve to the same member cluster The FROM and TO member cluster aliases refer to the same member cluster.
1221 (HY000) Collocation 'collocation_group' has no physical objects mapped to the source member cluster 'source_member_cluster_alias' There are no mappings within the collocation, or the mappings in the collocation aren't mapped to the FROM member cluster.
1221 (HY000) Cannot cut over a job in the phase phase. The job must be in the CDC phase to perform cutover The job isn't in the CDC Replication phase yet. phase is in capitals.
1221 (HY000) Replication lag (n seconds) is not below the maximum replication lag threshold (n seconds) Replication lag is at or above the bound. Read the lag in move_info, and run the statement again when it is lower.
1221 (HY000) Replication lag has not been reported for this job yet; retry once replication progress is available The job hasn't reported any lag yet.
1525 (HY000) Incorrect MAX_REPLICATION_LAG_SECONDS value: 'value'; it must be between 1 and 300 seconds The bound is outside 1 to 300.
1221 (HY000) Cannot cut over a job in the state state The job has ended. state is in capitals, for example COMPLETED.
1221 (HY000) Cannot cut over a job with a cancel in progress Someone canceled the job.
1221 (HY000) Cannot cancel a job that has reached the cutover phase The job is in CutoverInit or CutoverFlip, or past it. You can't cancel it.
1221 (HY000) Cannot cancel a job in the state state The job has ended. state is one of COMPLETED, ERROR, or CANCELLED.
1297 (40001) A data movement request for this job is still pending. Check the job status and retry once it clears. Another cutover or cancel for the job is still being processed.
1525 (HY000) Incorrect job ID value: 'value' The job ID isn't a valid ID.
1305 (42000) MOVE JOB 'job_id' does not exist No data movement job has this ID.
None (in move_info) Database 'name' already physically exists on the target member cluster 'target_member_cluster_alias', or Table 'db.table' already physically exists on the target member cluster 'target_member_cluster_alias' An object that the job moves already exists on the target member cluster. Drop or rename it there, then run the move again.
None (in move_info) Table 'table' references 'table' through foreign key 'fk'; a move cannot carry foreign-key relationships. Drop the constraint before moving. (or is referenced by 'table' in place of references 'table') A table in the move has a foreign key, or another table has a foreign key to it. Drop the constraint before the move, and re-create it on the target member cluster after the move.
None (in move_info) The object_type 'name' runs as definer 'user'@'host', which does not exist on the target 'target_member_cluster_alias'. Create the account there, or change the object's definer, before moving. A view, stored routine, trigger, or event in a moving database runs as an account that doesn't exist on the target member cluster.
None (in move_info) Table 'db.table' requires database 'db' to already exist on the target member cluster 'target_member_cluster_alias' A table mapping moves a table, but its database doesn't exist on the target member cluster. Create the database there, then run the move again.
None (in move_info) The job's status is Error, and the errors column holds the failure reason The job failed. The errors column holds the failure reason, and the warnings column holds non-fatal findings. Both are NULL while the job is healthy.
63927 (HY000) Cannot read `db`.`table` while data movement job 'job_id' is in progress, Cannot write to `db`.`table` while data movement job 'job_id' is in progress, or Cannot execute DDL on `db`.`table` while data movement job 'job_id' is in progress. When the job moves a database mapping, the message names only the database. Reads and writes are blocked during the cutover of a data movement job. Schema changes are blocked throughout the job. Retry the statement after the cutover.

Group limit errors

When an operation reaches a limit of the group's routing metadata, the routing layer returns an error and rolls back the operation. A count or size limit in Limitations and considerations for database cluster groups for Aurora returns error 1235 (42000), and the message names the limit. The error code doesn't separate a limit from an unsupported statement, so read the message. The following table describes the internal capacity error.

Aurora MySQL code (SQLSTATE) Message Cause
3170 (HY000, ER_CAPACITY_EXCEEDED) A metadata capacity limit was reached; the operation was rolled back Internal metadata capacity ran out. The routing layer rolled back the operation. A member cluster reached its limit on recently changed routing metadata. The limit frees up as earlier changes age out, so wait and retry, or make fewer distinct changes. A pin to a member cluster that isn't accepting new sessions also returns error 3170, with a different message, as described in Session and transaction errors. A move statement that reaches the limit returns error 1105, An internal error occurred while processing the statement., instead.

The limits in Routing metadata and naming limits on the data mappings that one statement changes, on the data mappings, routing functions, and scaleout tables that a group holds, and on the member tables of one scaleout table don't return this error. A statement that goes past one of these limits fails with error 1235 (SQLSTATE 42000) and changes nothing, and the message names the limit. An INSERT that adds too many data mappings fails with a message such as put of 1001 entries exceeds the per-request limit of 1000; split the write into smaller requests. A DELETE or UPDATE that changes too many rows fails with a message such as Remove of 1001 rows exceeds the per-request limit of 1000; narrow the filter or split the write into smaller requests, or Replace of 1001 rows exceeds the per-request limit of 1000; narrow the filter or split the write into smaller requests for an UPDATE.

A DELETE with no WHERE clause is an exception: it removes up to 1,000 data mappings, succeeds, and returns warning 1105 DELETE removed 1000 data mappings. Rows remain in the table. Run it again until it affects no rows.