giip
SES Proposal
Aurora MySQLMediumDMSCDCレプリケーション障害対応

Why AWS DMS Reports Error 1032 and How to Investigate It

Published 2026-08-13 · Updated 2026-08-13 · Last Verified 2026-08-13

Answer

MySQL Error 1032 is `ER_KEY_NOT_FOUND`, and in a DMS CDC task it means "the target-side row that a change was supposed to apply to does not exist." The cause is almost always one of: a gap at the boundary between the full load and CDC, a primary key mismatch between source and target, a target table with no primary key, rows excluded by a filter or transformation rule, or another process writing to the target. Start by reading `awsdms_apply_exceptions` on the target to identify the failed statement and the target key.

Applicability of This Document

ProductAWS DMS (target: Aurora MySQL / RDS for MySQL)
Verified VersionsMySQL 5.7-compatible / 8.0-compatible targets. DMS task setting names vary by the replication instance's engine version, so verify using the actual task's JSON
EnvironmentAWS (DMS replication instance + Aurora MySQL target)
Required PermissionsReading the control tables requires `SELECT` on the target DB. Changing task settings requires IAM `dms:ModifyReplicationTask`
Execution ImpactNo impact for reading control tables. Changing task settings involves stopping and resuming the task
RestartNo DB restart required. Changing task settings requires stopping and resuming the DMS task
Last Verified2026-08-13

Ready-to-Run Commands

Check the placement of the DMS control tables on the targetRead-only
対象
Aurora MySQL / RDS for MySQL (DMS target)
権限
Connection privilege on the target DB
変更作業
None (read-only)
Production実行
Possible
-- 対象: Aurora MySQL / RDS for MySQL(DMSターゲット)
-- 権限: ターゲットDBへの接続権限
-- 変更作業: なし(参照のみ)
-- Production 実行: 可能
SELECT TABLE_SCHEMA, TABLE_NAME, TABLE_ROWS
FROM information_schema.TABLES
WHERE TABLE_NAME IN (
    'awsdms_apply_exceptions',
    'awsdms_validation_failures_v1',
    'awsdms_status',
    'awsdms_suspended_tables',
    'awsdms_history'
)
ORDER BY TABLE_SCHEMA, TABLE_NAME;

The schema where the control tables are created is determined by the task setting `ControlSchema`. Left at its default, which schema they end up in on the target varies by environment, so check the actual placement with this SQL first, then substitute the schema name in the next queries.

Read the apply-error details (awsdms_apply_exceptions)Read-only
対象
Control schema on the DMS target
権限
`SELECT` on the control schema
変更作業
None (read-only)
Production実行
Possible
-- 対象: DMSターゲット上の制御スキーマ(既定名は ControlSchema 設定に依存)
-- 権限: 制御スキーマへの SELECT
-- 変更作業: なし(参照のみ)
-- Production 実行: 可能
SELECT
    TASK_NAME,
    TABLE_OWNER,
    TABLE_NAME,
    ERROR_TIME,
    LEFT(STATEMENT, 500) AS statement_head,
    LEFT(ERROR, 500)     AS error_head
FROM awsdms_control.awsdms_apply_exceptions
ORDER BY ERROR_TIME DESC
LIMIT 50;

`STATEMENT` contains the failed UPDATE/DELETE statement, and `ERROR` contains the error text returned by the engine (including 1032). The value appearing in the `WHERE` clause of `STATEMENT` is the key that did not exist on the target.

Read rows flagged as mismatched by validationRead-only
対象
Control schema on the DMS target (generated only when `EnableValidation` is on)
権限
`SELECT` on the control schema
変更作業
None (read-only)
Production実行
Possible
-- 対象: DMSターゲット上の制御スキーマ(EnableValidation 有効時のみ生成)
-- 権限: 制御スキーマへの SELECT
-- 変更作業: なし(参照のみ)
-- Production 実行: 可能
SELECT
    TASK_NAME,
    TABLE_OWNER,
    TABLE_NAME,
    FAILURE_TIME,
    KEY_TYPE,
    `KEY`            AS row_key,
    FAILURE_TYPE,
    LEFT(DETAILS, 500) AS details_head
FROM awsdms_control.awsdms_validation_failures_v1
ORDER BY FAILURE_TIME DESC
LIMIT 50;

`KEY` is a MySQL reserved word, so it's wrapped in backticks. If a table reporting 1032 also shows up here, it's not a one-off apply failure — the data itself has diverged.

Cross-check the primary key definitions between source and targetRead-only
対象
Both the source and target MySQL-compatible DBs
権限
Metadata read privilege on the target schema
変更作業
None (read-only)
Production実行
Possible
-- 対象: ソース・ターゲット双方で同じSQLを実行して結果を比較する
-- 権限: 対象スキーマのメタデータ参照権限
-- 変更作業: なし(参照のみ)
-- Production 実行: 可能
SELECT
    t.TABLE_SCHEMA,
    t.TABLE_NAME,
    (SELECT GROUP_CONCAT(k.COLUMN_NAME ORDER BY k.ORDINAL_POSITION)
       FROM information_schema.KEY_COLUMN_USAGE k
      WHERE k.TABLE_SCHEMA    = t.TABLE_SCHEMA
        AND k.TABLE_NAME      = t.TABLE_NAME
        AND k.CONSTRAINT_NAME = 'PRIMARY')            AS pk_columns,
    (SELECT COUNT(DISTINCT s.INDEX_NAME)
       FROM information_schema.STATISTICS s
      WHERE s.TABLE_SCHEMA = t.TABLE_SCHEMA
        AND s.TABLE_NAME   = t.TABLE_NAME
        AND s.NON_UNIQUE   = 0)                        AS unique_index_count
FROM information_schema.TABLES t
WHERE t.TABLE_SCHEMA = 'SampleDB'
  AND t.TABLE_TYPE   = 'BASE TABLE'
ORDER BY t.TABLE_NAME;

A table where `pk_columns` is NULL has no primary key. For a table with no primary key, DMS looks up the target row by matching every column for CDC UPDATE/DELETE, which makes 1032 more likely due to differences in floating-point representation, character encoding, or LOB handling. The same applies when `pk_columns` differs between source and target.

Check whether the row for the key reported in 1032 exists on the targetRead-only
対象
Aurora MySQL on the DMS target
権限
`SELECT` on the target table
変更作業
None (read-only)
Production実行
Possible
-- 対象: DMSターゲットのAurora MySQL
-- 権限: 対象テーブルへの SELECT
-- 変更作業: なし(参照のみ)
-- Production 実行: 可能
-- awsdms_apply_exceptions の STATEMENT に出ていたキー値をそのまま当てる
SELECT COUNT(*) AS target_row_count
FROM SampleDB.sample_table
WHERE id = 1001;

-- 併せてソース側でも同じ条件で確認し、片方にしか無いのかを判定する
SELECT COUNT(*) AS source_row_count
FROM SampleDB.sample_table
WHERE id = 1001;

If the row exists on the source but not the target, it's either a full-load gap or a filter exclusion. If it exists on neither, it can be judged as a delayed change arriving for an already-deleted row (an ordering issue).

Retrieve the current settings of the DMS taskRead-only
対象
AWS DMS replication task
権限
IAM: `dms:DescribeReplicationTasks`
変更作業
None (read-only)
Production実行
Possible
# 対象: AWS DMS レプリケーションタスク
# 権限: IAM dms:DescribeReplicationTasks
# 変更作業: なし(参照のみ)
# Production 実行: 可能

# 1) タスク一覧と状態
aws dms describe-replication-tasks \
  --query 'ReplicationTasks[].{Id:ReplicationTaskIdentifier,Type:MigrationType,Status:Status}' \
  --output table

# 2) 対象タスクの設定JSONをそのまま取り出す(設定名の実体はここで確認する)
aws dms describe-replication-tasks \
  --filters Name=replication-task-id,Values=example-dms-task \
  --query 'ReplicationTasks[0].ReplicationTaskSettings' \
  --output text

Which DMS task settings are available varies by version. Don't take the setting names in this article at face value — output the actual task's JSON with this command and edit only the fields that exist. Task logs are written to the `dms-tasks-<replication-instance-name>` CloudWatch Logs log group.

Change the behavior on apply errors (task settings)Medium
対象
AWS DMS replication task settings
権限
IAM: `dms:ModifyReplicationTask` (requires stopping the task)
変更作業
Yes (changes behavior on apply errors; IGNORE_RECORD discards the change)
Production実行
Only with a clear understanding of the impact. `IGNORE_RECORD` causes data divergence
// 対象: AWS DMS レプリケーションタスク設定(抜粋)
// 権限: IAM dms:ModifyReplicationTask(変更にはタスク停止が必要)
// 変更作業: あり(適用エラー時の挙動が変わる)
// Production 実行: 影響を理解したうえでのみ。IGNORE_RECORD は変更を黙って捨てる
{
  "TargetMetadata": {
    "TargetTablePrepMode": "DO_NOTHING"
  },
  "ErrorBehavior": {
    "ApplyErrorInsertPolicy": "LOG_ERROR",
    "ApplyErrorUpdatePolicy": "LOG_ERROR",
    "ApplyErrorDeletePolicy": "IGNORE_RECORD",
    "ApplyErrorEscalationPolicy": "LOG_ERROR",
    "ApplyErrorEscalationCount": 0,
    "TableErrorPolicy": "SUSPEND_TABLE"
  },
  "ValidationSettings": {
    "EnableValidation": true,
    "ValidationMode": "ROW_LEVEL",
    "ThreadCount": 5
  }
}

Setting `ApplyErrorDeletePolicy` to `IGNORE_RECORD` silently discards changes that could not be deleted, without recording them. The error stops, but the source and target data diverge. Keep it at `LOG_ERROR` until you've finished isolating the cause, and if you do switch to `IGNORE_RECORD`, first make sure you can track "which table, which period of changes was discarded" through validation. Setting `TargetTablePrepMode` to `DROP_AND_CREATE` recreates the target table during a full load, losing existing data.

How to Read the Results

ColumnMeaningWhat to Check
TASK_NAMEName of the DMS task that recorded the errorCheck whether multiple tasks are writing to the same target
TABLE_OWNERSchema (owner) of the target tableWhether this is the expected migration target schema
TABLE_NAMETarget table nameIf concentrated on one table, suspect that table's primary key definition and mapping
ERROR_TIMETime the error occurredWhether errors cluster right after full-load completion or a task resume
statement_headBeginning of the failed statementWhether it is UPDATE or DELETE, and which key value is used in the WHERE clause
error_headError text returned by the engineWhether anything other than 1032 (such as 1062 duplicate key) is mixed in
row_key (validation side)Key value of the mismatched rowQuery the same key on the source to check which side it actually exists on
FAILURE_TYPE (validation side)Type of mismatchThe response differs depending on whether it is a missing row or a value difference

When to Use This

  • The DMS task log repeatedly shows `Error 1032` or `ER_KEY_NOT_FOUND`
  • Errors increase right after entering the CDC phase, and only a specific table is stuck
  • The task status stays `Running`, but the target's row count never catches up with the source
  • The DMS console's table statistics show a specific table as `Table error` / suspended
  • After enabling validation, a large number of rows appeared in `awsdms_validation_failures_v1`

Possible Causes (Most Likely First)

  1. 01

    The target row was never loaded at the full-load/CDC boundary

    A row inserted after the full-load snapshot and later updated or deleted may not exist on the target even if the CDC update arrives first. Check the relationship between the task start position and the full-load completion time.

  2. 02

    The primary key / unique key doesn't match between source and target

    If the target's primary key column differs, or the primary key has been redefined, the WHERE clause DMS generates won't match the target row. Cross-check `KEY_COLUMN_USAGE` on both sides.

  3. 03

    The target table has no primary key

    Without a primary key, DMS looks up the target row by matching all columns. Differences in floating-point representation, character encoding, or LOB handling can cause a mismatch, resulting in 1032. Tables targeted for CDC are expected to have a primary key or unique key.

  4. 04

    Rows or columns are excluded by selection/transformation rules

    If table mapping filters migrate only some rows, a CDC update for an excluded row arrives but doesn't exist on the target, causing an error. Column renaming or exclusion has the same effect.

  5. 05

    Another process is writing to the target

    If the application, another DMS task, or a batch job writes to the target, it breaks the row state DMS assumes. As a rule, writes to a migrating target should be limited to DMS alone.

  6. 06

    The binlog was purged sooner than needed, causing a gap in changes

    If the source's binlog retention period is too short, CDC can miss reads, and applying changes can start from an inconsistent state upon resume. See the related article for checking retention time.

Diagnostic Steps

  1. 1

    Check the substance of the error via the control tables

    Read-only

    Read `awsdms_apply_exceptions` in descending time order to identify the target table, statement, and key value. This is read-only and safe.

  2. 2

    Check the task log in CloudWatch Logs

    Read-only

    In the `dms-tasks-<replication-instance-name>` log group, check what happened around the error (resume, table suspension, connection drop).

  3. 3

    Cross-check the primary key definitions between source and target

    Read-only

    Run the metadata SQL above on both sides and check whether `pk_columns` match and whether any table shows NULL.

  4. 4

    Check whether the row for the given key exists on both source and target

    Read-only

    Which side it exists on determines whether this is a load gap or an ordering issue.

  5. 5

    Check the task's table mapping and settings JSON

    Read-only

    Pull the actual settings with `describe-replication-tasks` and check the current values of filters, transformation rules, and `ErrorBehavior`.

  6. 6

    Enable validation to measure the extent of the divergence

    Medium

    Enabling `EnableValidation` puts comparison load on both source and target. Run it during a window that can tolerate the load.

Solutions

Low-risk action that can be done immediately

  • Identify the table reporting errors and isolate it

    Read-only

    Before stopping everything, narrow it down to a specific table with `awsdms_apply_exceptions`. If it is just one table, reloading that table alone often resolves it.

  • Stop other processes from writing to the target

    Medium

    If there are writes other than DMS, the issue will recur even after a setting change. First consolidate to a single write path.

Change requiring advance review

  • Add a primary key or unique key to the table

    High

    If the cause is that the CDC target table has no primary key, define a key on the target (and on the source too, if needed). Since this is a schema change, it requires verification in a test environment and scheduling for an appropriate time window.

  • Reload only the affected table

    High

    Use DMS's "reload table" to rerun a full load for just that table. Since the target table passes through a temporarily inconsistent state, check the impact on readers before doing this.

  • Review the table mapping filters

    Medium

    If a row filter migrates only some rows, align it with the range of updates arriving via CDC. If they cannot be aligned, migrate that table without a filter.

Change involving a restart or service impact

  • Set `ApplyErrorDeletePolicy` to `IGNORE_RECORD`

    Medium

    The error stops, but since unapplicable deletes are discarded without being recorded, the data diverges. Do not use this as a "quick fix" before finishing the root-cause investigation.

  • Recreate the task and re-establish CDC

    High

    If restarting from a full load, first decide how to handle the existing target data (`TargetTablePrepMode`) and the cutover time. Re-establishing CDC is a high-impact operation.

!Warnings

  • `ApplyErrorDeletePolicy = IGNORE_RECORD` silently discards changes that could not be applied. The error disappears from view, but the source and target data diverge. Only make this setting after ensuring you can track the divergence through validation.
  • Setting `TargetTablePrepMode` to `DROP_AND_CREATE` drops and recreates the target table during a full load. Existing data is lost.
  • Validation places read load on both source and target. Do not enable it abruptly during a production time window.
  • The contents of the control tables include part of the migrated data (key values and statements). Handle them carefully when sharing or exporting.
  • DMS task setting names vary by version. Some items may be missing from this article or named differently, so always check the actual task JSON before editing.

Differences by Version and Environment

When the target is MySQL 8.0-compatible (Aurora MySQL 3.x)Since the default collation differs from the 5.7 series, match evaluation on composite keys involving strings can behave differently. See the related article for character set differences.
Differences across DMS versionsWhich items are available as task settings varies by the DMS engine version. This article lists only the items that could be verified; check the `describe-replication-tasks` output for whether additional conflict-handling settings exist (unverified).
Control table schemaFor a task that does not explicitly set `ControlSchema`, the placement varies by environment. Check the actual placement with `information_schema.TABLES` before running the SQL.

If This Doesn't Resolve It

  • Check the source's binlog retention period

    If retention is too short and CDC is missing reads, a setting change will not fix it.

  • Check the DMS replication instance's resources

    If CPU, memory, or storage is under pressure, apply delays and task resumes increase, making boundary issues more likely.

  • Check for cascading updates from triggers or foreign keys on the source

    Rows that cascade-update on the source may not be reproduced on the target.

  • Check whether errors other than 1032 are mixed in

    If duplicate key (1062) and others occur at the same time, the cause is a separate issue.

  • Cross-check the list of migrated tables against the application's write paths

    Confirm via actual connection sources — not just the design — that DMS is the only thing writing to the target.

Basis and Limitations of This Document

Explanation based on official product documentation

Based on the definition of MySQL error code `1032` (`ER_KEY_NOT_FOUND`) and the public specifications of AWS DMS control tables (`awsdms_apply_exceptions`, `awsdms_validation_failures_v1`, and others) and task settings (`ErrorBehavior`, `TargetMetadata`, `ValidationSettings`). Since which settings exist depends on the DMS version, this assumes verification against the actual task's JSON. It does not include any specific customer's migration case.

FAQ

What causes Error 1032?

It is MySQL's `ER_KEY_NOT_FOUND`, meaning the row that an UPDATE or DELETE was trying to apply to does not exist on the target. In DMS CDC, the main causes are a gap at the full-load/CDC boundary, a primary key mismatch, a table without a primary key, rows excluded by a filter, or another process writing to the target.

Can this be run in production?

All the control table and metadata lookup SQL is read-only and can be run in production as well. Changing task settings involves stopping and resuming the task, and `IGNORE_RECORD` causes data divergence, so check the impact before making these changes.

What permissions are required?

Reading the control tables requires `SELECT` on the target DB; retrieving or changing task settings requires IAM `dms:DescribeReplicationTasks` / `dms:ModifyReplicationTask`.

Does setting ApplyErrorDeletePolicy to IGNORE_RECORD resolve this?

The error stops, but it is not a resolution. Since unapplicable deletes are discarded, the source and target data diverge. Only make this setting after identifying the cause and deciding whether the divergence is acceptable.

How should the results be interpreted?

If the errors in `awsdms_apply_exceptions` are concentrated on a specific table, suspect that table's primary key definition and mapping. If they're spread across many tables and clustered around task resumes, suspect the CDC start position or a binlog gap. If a row exists only on the source, it's a full-load gap.

What should be done about a table with no primary key?

As a rule, you should provision a primary key or unique key if the table is a CDC target. If that is not possible, consider a design change such as synchronizing that one table via repeated full loads, or excluding it from migration and handling it through another means.

Questions This Document Covers

  • DMS CDC cannot apply an UPDATE and the task stops
  • How to read awsdms_apply_exceptions
  • Can a table with no primary key be migrated via DMS CDC
  • How to investigate a mismatch reported by DMS validation

What the Risk Labels Mean

  • Read-onlyDoes not change data or settings.
  • LowImpact is limited, but permissions and load should be checked.
  • MediumMay affect performance, locking, or cost.
  • HighMay cause an outage, data loss, or require recovery work.
  • Expert Review RequiredRequires a separate review before applying to production.

GIIP's Scope of Support

Tracking down a single Error 1032 is as simple as reading the control tables. What's difficult operationally is having to keep watching the task state and divergence status throughout the entire migration period. GIIP periodically collects the trend of DMS task status, error counts, and validation results, and also preserves the control table contents at the moment an error occurs. An AI agent handles the day-to-day isolation and initial reporting, and for decisions that involve data divergence, such as `IGNORE_RECORD`, human approval is always required.

Author & Technical Review

GIIP Production Operations Team

About 30 years of experience in designing, migrating, and operating large-scale web services, SQL Server, Oracle, AWS, and Azure. Experience includes 12 sets of x12large-class AWS RDS for SQL Server environments, an Oracle environment with roughly 120,000 tables, and migrating roughly 3TB from TiDB to Aurora MySQL. AI agents and human experts currently continue to monitor and operate multiple cloud databases and about 30 web services.

Related Knowledge

Related Services

Request an investigation into a DMS task error

If you need to repeat the same checks across multiple environments, we can discuss your entire operations setup.

Request an investigation into a DMS task error

← Back to Knowledge Base