Session and transaction errors
Use the following table to find the cause of a session error that the routing endpoint of a database cluster group for Aurora returns. For what to do about each error, see Fixing session and transaction errors. The table covers session pins, session settings, ending a session, XA transactions on a pinned session, and writes that the routing layer rejects during the cutover of a data movement job. Through the routing layer, each transaction runs on one member cluster. For how pins and transactions work, see Sessions, transactions, and session pinning.
For a retryable error after a mapping change, or a transaction refused across member clusters, see Routing and data mapping errors. For a connection that closes with no error, see Connection and sign-in errors.
Session and transaction error codes
The following table lists one error in each row.
| Aurora MySQL code (SQLSTATE) | Message | Cause |
|---|---|---|
| 1179 (25000) | You are not allowed to pin in a transaction. COMMIT or ROLLBACK first., or You are not allowed to unpin in a transaction. COMMIT or ROLLBACK first. |
The session set or cleared router_cluster_pin inside an open transaction. On Aurora MySQL with autocommit = 0, the first read or write opens a transaction. |
| 64004 (42000) | Member cluster '<alias>' doesn't exist |
The pin names an alias that isn't a member cluster alias of the group. |
| 1231 (42000) | The router_cluster_pin value must be a quoted string, The router_cluster_pin variable takes a single value, or Member cluster and database name must both be non-empty |
The value isn't a single-quoted string, assigns more than one value, has an empty alias or database part, or the session's character set isn't utf8mb4. |
| 1049 (42000) | Unknown database '<db>', or The member cluster rejected the pin |
The database in the pin doesn't exist on the target member cluster, or the member cluster refused the pin. The routing layer refuses the pin, and the previous pin stays in effect. |
| 1045 (28000) | Access denied for user '<user>'@'<host>' (no matching account on cluster) |
A pin couldn't sign in to the target member cluster, because the member cluster has no user with the router user's name. The routing layer refuses the pin, and the previous pin stays in effect. |
| 3170 (HY000) | The member cluster is not accepting new sessions. Retry later. |
The target member cluster isn't accepting new sessions. The routing layer refuses the pin, and the previous pin stays in effect. |
| 1429 (HY000) | The member cluster is unreachable, or Internal routing error |
The target member cluster can't be reached, or the routing layer couldn't commit the pin. The routing layer refuses the pin, and the previous pin stays in effect. |
| 1192 (HY000) | The session is not pinned, A pin is already in progress, or The session holds table locks. UNLOCK TABLES first. |
An unpin ran in a session that isn't pinned, a pin started while another pin was in progress, or the session holds table locks. |
| 1228 (HY000) | The router_cluster_pin variable may only be set at SESSION scope |
The statement set router_cluster_pin with SET GLOBAL or SET LOCAL. |
| 1162 (42000) | The session state to replay on the member cluster does not fit in one request. |
The session state to replay on the member cluster doesn't fit in one request. |
| 1049 or 1146 | Unknown database '<name>' or Table '<db>.<table>' doesn't exist in a pinned session |
The pinned session used a router name. A pinned session passes statements through to the member cluster unchanged, so it uses the cluster names on that member cluster. |
| 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. |
| 1927 (70100) | Connection was killed |
A member cluster session was lost while the session had an open transaction, a running statement, or prepared statements on it. The routing layer sends this as a fatal error and closes the connection. Reconnect and run the whole transaction again. During a cutover, error 1180 on COMMIT also means the transaction was rolled back; retry the whole transaction on the same connection. During a cutover, error 1317 stops the statement. If the connection is still open, roll the transaction back and retry it. If the connection closed, reconnect and retry the whole transaction. |
| 1094 (HY000) | Unknown thread id: <id> |
No session at the routing endpoint has this ID. KILL reaches sessions on every part of the routing layer. Error 1095 means that you don't own the session and lack dbclustergroup_connection_admin, or that another user's session is running a statement and your member cluster user lacks CONNECTION_ADMIN on that member cluster. |
| 1179 (25000) | You are not allowed to unpin in a transaction. COMMIT or ROLLBACK first. |
The pinned session has an XA transaction that is active, after XA START, or idle, after XA END. A prepared XA transaction, or one ended with XA COMMIT ... ONE PHASE, doesn't block the unpin. |
| 1399 | XAER_RMFAIL: The command cannot be executed when global transaction is in the ACTIVE state |
XA COMMIT ran while the XA transaction was still active. The transaction stays active. |
| 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 session isn't pinned. Query routing mode rejects every XA statement. |
| The member cluster's own error, such as 1193 (HY000) or 1231 (42000) | The member cluster's message, such as Unknown system variable '<name>', followed by - reset the connection (COM_RESET_CONNECTION, mysql 'resetconnection', or reconnect) and re-apply your session settings. |
The routing layer accepts a SET of a variable that it doesn't hold without checking it, and applies it with the session's next statement on each member cluster. A member cluster rejected the variable or its value, so that statement fails. The routing layer keeps the SET, so every later statement on a member cluster fails the same way. Reset the connection or reconnect, and then set only variables and values that every member cluster accepts. The same applies to other errors for a rejected setting, such as 1232, 1298, or 1273. |