Routing and data mapping errors
The routing layer of a database cluster group for Aurora routes each statement by its data mappings and scaleout tables. Use the following table to find the cause of an error for a statement that the routing layer can't route, or for a write to data_mappings. For what to do about each error, see Fixing routing and data mapping errors. For causes and fixes by symptom, see Troubleshooting routing and data mappings.
A statement on data_mappings takes effect fully on its own, and a refused mapping write changes nothing. For when a mapping change reaches the routing layer, and what an open transaction does, see Applying data mapping changes.
Routing and data mapping error codes
The following table lists the errors for routed statements first, and then the errors for writes to the data mappings. Each row gives the Aurora MySQL code. Aurora MySQL error 1235 means that the routing layer refused the statement and ran it on no member cluster. A write to data_mappings that the routing layer refuses returns error 1235, an Aurora MySQL error number in the 64000–64099 range (SQLSTATE 42000), or another engine error, such as 1205 or 1227. The table lists the code for each refusal. For the routing functions available, see Routing functions.
| Aurora MySQL code (SQLSTATE) | Message | Cause |
|---|---|---|
| 1235 (42000) | Statements across member clusters are not supported. Ensure the statement targets a single member cluster. |
The statement reads or changes data, and its rows resolve to more than one member cluster, for example a multi-row INSERT whose rows target several member clusters. The routing layer returns this error for a data SELECT and for a write. Only catalog reads run on several member clusters. |
| 1235 (42000) | Transactions across member clusters are not supported |
A statement in the transaction reaches a second member cluster. The first routable statement bound the transaction to its member cluster. On Aurora MySQL, the routing layer rejects only that statement, and the transaction stays open. |
| 1235 (42000) | Queries referencing both Scaleout Tables and Router Tables in the same statement are not supported. Router Tables: [<tables>]; Scaleout Tables: [<tables>]. |
One statement names a scaleout table and a table with a table-level mapping. |
| 1235 (42000) | Cannot resolve routing target: insufficient routing information |
The routing layer can't find a routing key value in a statement on a scaleout table, for example because the statement has no WHERE clause or filters only on other columns. |
| 1235 (42000) | Unsupported predicate value type for routing key |
The routing key value is NULL, DEFAULT, an expression, a hex or bit literal, or a user variable. |
| 1235 (42000) | Operator '<operator>' is not supported on routing key columns, or Range predicate on table '<table>' is not supported: <reason> |
The routing layer selects a member cluster only from = or IN on the routing key, or from a range with literal bounds when the routing function is COLUMN. On the routing key, <>, NOT IN, NOT BETWEEN, NOT, LIKE, and IS NULL are refused under every routing function, and a range is refused under MOD, HASH, and PREFIX. These operators work on other columns when the statement also has = or IN on the routing key, for example WHERE id = 1 AND status <> 'closed'. |
| 1235 (42000) | UPDATE of routing key column '<column>' is not allowed |
The update assigns the routing key column. You can't update a routing key column. |
| 1235 (42000) | No collocation matched the evaluated routing function result, or Invalid constant value for routing function |
A read whose routing key value, or whose whole range, evaluates to a result that no target collocation of the routing function lists, for example a range predicate that lies wholly in a gap between ranges or above every range. Aurora MySQL returns no rows for the same read. The routing layer also returns this error when it can't evaluate the key, for example a MOD divisor of 0. For an INSERT of a row whose key is in no range, see error 1526. |
| 1526 (HY000) | Table '<table>' has no collocation for the row's routing key |
An INSERT of a row whose routing key value maps to no collocation of the routing function, for example, under COLUMN with VALUES IN RANGE, a key below the lowest range, in a gap between ranges, or above a range that doesn't end at MAXVALUE. Make sure that your ranges cover every key that you insert. |
| 1235 (42000) | Unsupported value for a temporal routing key: '<value>' (<reason>) |
A DATE, DATETIME, or TIMESTAMP key value that the routing layer doesn't read, for example a value with more fractional-second digits than the key's precision, a delimiter other than -, an impossible date such as '2024-02-30', or a zero date. Aurora MySQL rounds or converts some of these values; the routing layer refuses them. Write the value as 'YYYY-MM-DD' or 'YYYY-MM-DD hh:mm:ss[.fraction]' at the key's precision. |
| 1235 (42000) | Required routing key column '<column>' not found in the column list |
The INSERT column list doesn't include the routing key. |
| 1235 (42000) | Routing key column '<column>' has an invalid position in metadata |
The INSERT has no column list, and the scaleout table's ROUTE BY KEY gives no POSITION for the routing key. |
| 1235 (42000) | No member cluster could be resolved for this query |
The routing layer can't resolve a member cluster for the statement. |
| 1235 (42000) | This operation is not supported in query routing mode. Use the cluster endpoint directly or pin the session to a member cluster. |
The routing layer doesn't run this statement in query routing mode, for example DDL such as ALTER TABLE, DROP TABLE, or CREATE INDEX. |
| 1235 (42000) | This statement type is not supported |
The routing layer doesn't handle this type of statement. On a system table, a PREPARE or a binary-protocol prepare of a read returns this error. Send the read as plain text. |
| 1235 (42000) | A query on a dbclustergroup_sys table isn't supported, for example ORDER BY is not supported on this table, AND/OR are not supported in the WHERE clause on this table, DISTINCT is not supported on this table, or Only literal values are allowed. No expressions, subqueries, or variables. |
The WHERE clause on a dbclustergroup_sys table takes exactly one equality, column = 'value' or a tuple equality, with literal values. ORDER BY isn't accepted. LIMIT takes the forms LIMIT n, LIMIT n OFFSET m, and LIMIT m, n. |
| 1235 (42000) | Joining '<catalog object>' with '<db>.<table>' is not supported |
A statement mixes information_schema or another catalog with user tables. |
| 1235 (42000) | Multiple statements in a single request are not supported |
The text parsed on a single-statement path, such as the inner text of a SQL PREPARE, holds more than one statement. A client request that holds more than one statement doesn't return this error. With the client's multi-statement option on (CLIENT_MULTI_STATEMENTS, for example allowMultiQueries=true), the routing layer runs the statements one at a time, and each routes on its own. Without that option, the request returns error 1064, as on an Aurora DB cluster. |
| 1243 (HY000) | Unknown prepared statement handler (<id>) |
The statement ID isn't prepared on this session. Binary-protocol and SQL prepared statements run on scaleout tables, and the routing layer picks the member cluster at each execute. In a pinned session, a binary-protocol statement prepared before the pin changed returns error 1235, and a text PREPARE on a scaleout table or another member cluster returns error 4163. Prepare it again. |
| 4163 (42000) | User-level lock name 'Prepared statement cannot run in the current pin state. ' should not exceed 64 characters., or the same with Prepared statement needs to be re-prepared. The lock name is the message padded with spaces to 65 characters. |
In a pinned session, you ran a text PREPARE from before the pin that the routing layer couldn't prepare again on the pinned member cluster: a table it uses is on another member cluster or is a scaleout table, or the session's changed settings read it differently. The routing layer kept the name with a placeholder that fails when it runs. Prepare the statement again. |
| 1105 (HY000) | An internal error occurred while processing the statement., or Member cluster unavailable; reconnect and retry the statement |
The routing layer resolved the statement and couldn't deliver it to a member cluster. The message names no cause. One of the following applies: a data mapping names a collocation that the routing function doesn't cover, a mapping row names a table that doesn't exist on that member cluster, or a mapping names a member cluster that you removed from the group. When a member cluster has no matching member cluster user, the client gets error 1045 (28000), Access denied for user '<user>'@'<host>' (no matching account on cluster). A mapping that names an unknown member cluster alias doesn't cause this error, because the routing layer refuses that mapping when you write it. |
| 1429 (HY000) | Member cluster is currently unavailable: no healthy endpoint |
The routing layer has no available instance of the member cluster to send the statement to. |
| 1053 (08S01) | Member cluster is not accepting new sessions; reconnect and retry the statement, or Member cluster session did not open in time; reconnect and retry the statement |
The member cluster doesn't accept a new session, or doesn't open it in time. The routing layer closes the client connection. |
| 9501 (HY000) | Timed-out waiting to acquire database connection |
The routing layer's wait for a member cluster connection ran out. The client connection stays open, so you can retry the statement. |
| 3168 (HY000) | The database cluster group metadata is temporarily unavailable |
The metadata service is unreachable or failing over. Wait briefly, then retry the statement. |
| 1146 (42S02) | Table '<name>' doesn't exist |
The table isn't in the routing metadata of the group. There is no default member cluster to fall back to. A name routes only if it's a router name in data_mappings. On Aurora MySQL, inside a transaction, the error ends the statement, and the transaction stays open. |
| 1049 (42000) | Unknown database '<name>' |
On Aurora MySQL, the database has no data mapping. For this error in a pinned session, see Session and transaction errors. |
| 1412 (HY000) | Table definition has changed, please retry transaction |
A member cluster refused a statement that the routing layer routed on an older mapping. On Aurora MySQL, the routing layer resends a text-protocol statement up to 3 times first, and you get 1412 only when those resends are used up. The statement did not run, the session stays open, and an open transaction stays open, so retry the statement. |
| 63928 (40001) | Aurora DB Cluster Group routing mappings referenced by this transaction have changed. Transaction rolled back. Please retry |
Inside a transaction, a statement needed a routing mapping or definition that changed after the transaction's first routed statement. The routing layer rolled back the whole transaction. Retry the transaction from the start. If the routing layer can't confirm the rollback, or the session holds server-side prepared statements, it closes the connection instead, so reconnect and run the whole transaction again. |
| 1064 (42000) | You have an error in your SQL syntax |
The statement has a SQL syntax error. |
| 1227 (42000) | Access denied; you need the 'DBCLUSTERGROUP_METADATA_ADMIN' privilege for this operation for a write, or Access denied; you need (at least one of) the 'DBCLUSTERGROUP_METADATA_READ_ONLY' or 'DBCLUSTERGROUP_METADATA_ADMIN' privilege(s) for this operation for a read |
A write to data_mappings ran without the dbclustergroup_metadata_admin privilege. A read of data_mappings or member_cluster_mappings ran without dbclustergroup_metadata_read_only, dbclustergroup_metadata_admin, or dbclustergroup_super_admin. |
| 64004 (42000) | Member cluster '<alias>' doesn't exist |
The mapping row names an alias that isn't a member cluster alias of this group. The routing layer writes no row. member_cluster_mappings doesn't list a member cluster that is still joining until it can route. |
| 64021, 1235, 64080 (42000) | Table '<db>.<table>' already has a data mapping (64021), Reserved identifier: '<name>' cannot be used as a name (1235) for a dbclustergroup_sys table name, or Name '<name>' is reserved (64080) for another reserved name |
The router name is already mapped (router names are unique across the group), the name is a dbclustergroup_sys system table name, or the name is otherwise reserved. |
| 64062 (42000) | Collocation group '<group>' is not on member cluster '<alias>' |
A collocation is on one member cluster, and the row names a collocation that's already on another member cluster. |
| 64043 (42000) | member_cluster_alias can't be changed on one data mapping because '<mapping>' belongs to collocation group '<group>'. To move the whole group, update member_cluster_alias WHERE router_collocation_group = '<group>'. To move only this mapping, set router_collocation_group and member_cluster_alias together. |
An update tries to move one mapping of a collocation that other mappings share. |
| 64060 (42000) | Database '<alias>' is already mapped at a different level, or Table '<alias>' is already mapped at a different level |
The router name is already mapped at another mapping level. |
| 1235 (42000) | physical table '<db>.<table>' is already mapped on member cluster '<alias>' as '<router name>', physical database '<db>' is already mapped on member cluster '<alias>' as '<router name>', or ... overlaps the <level> mapping ... |
The object on that member cluster already has a mapping, at the same level or at another one, under the router name in the message. |
| 1235 (42000) | db_cluster_identifier is read-only |
The routing layer fills in db_cluster_identifier from member_cluster_alias. A mapping write can't set it. |
| 1235 (42000) | Writes (INSERT/UPDATE/DELETE) on dbclustergroup_sys.data_mappings are not allowed inside a transaction (opened by BEGIN/START TRANSACTION or SET autocommit=0) |
A mapping write ran inside a transaction. You can run a SELECT on the table inside a transaction. |
| 1235 (42000) | cannot remove data mapping '<db>.<table>': referenced by a scaleout table |
The mapping backs a scaleout table. The routing layer keeps it until you drop that scaleout table. |
| 1205 (HY000) | Metadata for <object> '<name>' is being changed by another operation |
Another operation, such as a data movement job on the collocation, holds the object's metadata. Retry after it ends. |
The routing layer refuses some statements itself. It passes others through to the member cluster, which returns its own error. The following table lists the cases where the member cluster, or the member cluster metadata, returns the error.
| Case | Error returned |
|---|---|
| A statement that uses a character set or collation that the routing layer doesn't accept | SET NAMES latin1 or utf8mb3, and SET character_set_client = latin1, return 1115 Unknown character set: 'latin1'. SET collation_connection = latin1_swedish_ci returns 1273 Unknown collation. COLLATE latin1_bin in a statement returns 1253 COLLATION 'latin1_bin' is not valid for CHARACTER SET 'utf8mb4'. The routing layer accepts CONVERT(… USING latin1) and _latin1'…' literals and passes them to the member cluster. |
| An insert that gives a value for a generated column | The member cluster's error, 3105 (HY000) The value specified for generated column 'b' in table 'g' is not allowed. |
| A duplicate key value on one member cluster | The member cluster's error, 1062 (23000) Duplicate entry '1' for key 'g.PRIMARY'. Uniqueness is checked only within one member cluster. |
| A foreign key whose parent table is on another member cluster | The member cluster's error, 1452 (23000) Cannot add or update a child row: a foreign key constraint fails …. The member cluster checks its own copy of the parent table, even though the parent row was visible through the routing endpoint on another member cluster. |
| A mapping change that affects a member cluster that the routing layer can't reach | 3168 (HY000) The database cluster group metadata is temporarily unavailable, when the member has no available writer and nothing is changed. 1105 (HY000) An internal error occurred while processing database cluster group metadata, when the member fails during the change, which is then rolled back. An UPDATE or DELETE affects the member cluster that the mapping names before the change. An INSERT of a new mapping never contacts a member cluster, so it doesn't return these errors. |