

# 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](databaseclustergroups-ts-operations.md#databaseclustergroups-ts-operations-error-fixes). 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](databaseclustergroups-ts-operations.md#databaseclustergroups-a-move-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](databaseclustergroups-errors-sessions.md) and [Moving data between member clusters](databaseclustergroups-data-movement.md). 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](databaseclustergroups-data-movement.md).

## Data movement error codes
<a name="databaseclustergroups-data-movement-errors"></a>

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
<a name="databaseclustergroups-capacity-errors"></a>

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](databaseclustergroups-limitations.md) 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](databaseclustergroups-errors-sessions.md). 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](databaseclustergroups-limitations.md#databaseclustergroups-limitations-routing-metadata-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.