DMS Task Troubleshooter
What this skill does
Diagnoses AWS DMS replication task failures by walking a symptom (task
status failed, source connection test failed, CDC latency climbing,
full-load table-statistics stuck, target constraint violation) to the
specific failed layer using a deterministic diagnostic tree. Each layer
has a single probe (CLI command, CloudWatch metric, or CloudWatch Logs
query) that proves or disproves it. Verifies the root cause with
positive evidence — a failing probe whose output matches the symptom —
then emits a fix with verification steps. Covers source-side failures
(binary logging disabled on MySQL, pglogical extension missing on
PostgreSQL, MS-Replication not enabled on SQL Server, LogMiner not
configured on Oracle), network/IAM failures (source SG ingress,
dms-vpc-role / dms-cloudwatch-logs-role trust policy), target-side
failures (PK missing, FK constraint, unique constraint), task-level
failures (table-mapping wildcards excluding the failing table, Logging
disabled hiding the cause), data-level failures (Oracle NUMBER to
PostgreSQL NUMERIC precision loss, LOB size limit at 32KB), and
instance-capacity failures (memory pressure on CDC, disk swap on the
replication instance). Emits ROOT_CAUSE_FOUND with the failing layer
and fix, NEED_MORE_INFO when a probe needs operator input, or
ESCALATE for AWS-side DMS service incidents.
Quick navigation
| If the symptom is... |
Go to |
First probe |
Task status failed immediately at start |
Step 1 |
describe-replication-tasks LastFailureMessage + task logs |
Task status failed mid-migration |
Step 2 |
describe-table-statistics (which table?) + task logs |
| Source connection test fails |
Step 3a |
describe-endpoints + test-connection + source SG |
| Source CDC not capturing changes (Postgres) |
Step 4a |
pg_create_logical_replication_slot, pglogical extension |
| Source CDC not capturing changes (MySQL) |
Step 4b |
binlog_format=ROW, binlog_retention |
| Source CDC not capturing changes (SQL Server) |
Step 4c |
MS-Replication / MS-CDC enabled |
| Target connection test fails |
Step 5a |
describe-endpoints + test-connection + target SG |
| Target constraint violation (FK/PK/unique) |
Step 5b |
task logs + target schema inspection |
| CDC latency climbing, task running |
Step 6a |
CloudWatch CDCLatencySource, CDCLatencyTarget |
| Memory pressure on CDC |
Step 6b |
CloudWatch FreeableMemory, SwapUsage |
| Full-load table-statistics stuck at 0 rows |
Step 7a |
describe-table-statistics + table-mapping rules |
| Data type mismatch error in logs |
Step 7b |
task logs + source/target column types |
| LOB size limit error |
Step 7c |
task logs + LobMaxSize task setting |
| Task logs missing (Logging disabled) |
Step 8 |
task Logging setting + dms-cloudwatch-logs-role |
| Need the source engine's CDC requirements |
Reference |
references/source-cdc-requirements.md |
| Need the task settings reference |
Reference |
references/task-settings-and-logging.md |
Pre-flight: task metadata and gather-info gate
Before running symptom-specific probes, gather the canonical task,
endpoint, instance, and table-statistics metadata. Misidentifying the
source engine (MySQL vs PostgreSQL vs Oracle) or the migration mode
(full load vs CDC vs full load + CDC) produces false root causes.
Account-wide pre-flight commands
Full pre-flight command block moved to
references/diagnostic-commands.md.
Source-engine short-circuit
EngineName |
CDC mechanism |
Effect on diagnosis |
mysql |
Binary log (binlog). Requires binlog_format=ROW, binlog_row_image=FULL, and the DMS user with REPLICATION SLAVE + REPLICATION CLIENT privileges. Binlog retention must be sufficient (default 0 hours on RDS — DMS falls behind). |
Check show binary logs;, show variables like 'binlog%';. RDS parameter group must set binlog_format=ROW. |
postgres |
Logical replication slot (pglogical or test_decoding). Requires wal_level=logical, max_replication_slots >= 1, and the pglogical extension on the source database (for Aurora/RDS PostgreSQL 9.6+). Source must have a replication slot owned by the DMS user. |
Check select * from pg_replication_slots;, select * from pg_extension where extname='pglogical';. RDS parameter group must set wal_level=logical. |
sqlserver |
MS-Replication (for SQL Server 2008+) or MS-CDC (for SQL Server 2012+). Requires the database enabled for MS-Replication (sp_replicationdboption) or MS-CDC (sys.sp_cdc_enable_db), and the DMS user as sysadmin (MS-Replication) or db_owner (MS-CDC). |
Check select name, is_cdc_enabled, is_published from sys.databases;. SQL Server Express does NOT support CDC. |
oracle |
LogMiner (default) or Binary Reader. Requires ARCHIVELOG mode, supplemental logging (ALTER DATABASE ADD SUPPLEMENTAL LOG DATA), and the DMS user with SELECT ANY TRANSACTION + EXECUTE on DBMS_LOGMNR. Oracle Source 12c+ needs LOGMINING role. |
Check select log_mode from v$database;, select supplemental_log_data_min from v$database;. |
mariadb |
Same as MySQL (binlog). |
Same as MySQL. |
docdb |
Change streams (not binlog). Requires change_streams enabled on the cluster parameter group. |
Check the cluster parameter group for change_streams: enabled. |
Migration-type short-circuit
MigrationType |
Effect on diagnosis |
full-load |
Full load only. No CDC. Failures are in the load phase (table mapping, data type, LOB, target constraints). Source binary logging is NOT required. |
cdc |
CDC only (no initial full load). Source MUST have the CDC mechanism enabled (binlog / pglogical / MS-CDC / LogMiner) BEFORE the task starts. Failures are typically source-CDC-configuration issues. |
full-load-and-cdc |
Full load followed by CDC. The most common migration type. Full-load failures show in table-statistics; CDC failures show as CDCLatencySource climbing after the full load completes. |
If the input is malformed (missing task ARN, missing source engine type,
ambiguous error message), emit:
TARGET: <task-arn or unknown>
VERDICT: NEED_MORE_INFO
REASON: Input is missing required context — at minimum the DMS task
ARN or ID, the source and target engine types, and the observed
symptom (task failed, CDC latency, full-load stuck). Cannot drive a
diagnostic tree without the error layer.
LAYER: UNKNOWN
EVIDENCE:
- Missing: <list specific missing fields>
REMEDIATION: Re-prompt the operator for: (1) the DMS task ID or ARN,
(2) the source and target engine types (mysql, postgres, sqlserver,
oracle, docdb), (3) the observed symptom (task status, error message
from task logs, CDC latency value), and (4) for live diagnosis, the
time window of the failure.
Process — Diagnostic decision tree (apply in symptom order)
Step 0: Expert knowledge — non-obvious DMS behaviors
Expert-knowledge behaviors (LastFailureMessage limits, binlog retention
defaults, LOB defaults, shared instances) moved to references/advanced-patterns.md.
Step 1: task-failed-at-start
Task status is failed immediately or within seconds of starting.
Probes:
aws dms describe-replication-tasks --filters Name=replication-task-id,Values=<task-id> — capture Status,
StopReason, LastFailureMessage.
aws logs filter-log-events --log-group-name dms-task-<id> --filter-pattern ERROR — capture the engine-specific error.
aws dms describe-endpoints — capture source and target
EngineName, ServerName, Port, SslMode, and
ExternalTableDefinition / ExtraConnectionAttributes.
aws dms test-connection --replication-instance-arn <inst-arn> --endpoint-arn <source-arn> — verify the source is reachable.
Decision:
- If task logs show "binary logging is not enabled" (MySQL) -> Step 4b.
- If task logs show "could not access file $libdir/pglogical" or
"logical decoding requires wal_level >= logical" (PostgreSQL) ->
Step 4a.
- If task logs show "MS-CDC is not enabled" (SQL Server) -> Step 4c.
- If task logs show "ORA-01331 LogMiner" (Oracle) -> Step 4 (Oracle).
- If
test-connection fails for source -> Step 3a (source SG / VPC).
- If
test-connection fails for target -> Step 5a (target SG / VPC).
- If task logs show "ResourceNotFound: role dms-vpc-role" -> Step 8
(IAM).
- If none match -> NEED_MORE_INFO with the raw error.
Step 2: task-failed-mid-migration
Task status is failed after the full load started or during CDC.
Probes:
aws dms describe-table-statistics --replication-task-arn <arn> —
find the table with LastErrorMessage set or FullLoadRowCount at
0 when others have rows.
aws logs filter-log-events --log-group-name dms-task-<id> --filter-pattern ERROR — capture the per-table error.
aws cloudwatch get-metric-statistics --namespace AWS/DMS --metric-name CDCLatencySource ... — check if CDC lag preceded
the failure.
Decision:
- If task logs show "foreign key constraint violation" -> Step 5b.
- If task logs show "primary key missing on target table" -> Step 5b.
- If task logs show "ORA-01722 invalid number" or "value too long for
type" -> Step 7b (data type mismatch).
- If task logs show "LOB size exceeds maximum" -> Step 7c (LOB).
- If
FreeableMemory dropped to near zero before the failure -> Step
6b (memory pressure).
- If
SwapUsage was high before the failure -> Step 6c (disk swap).
Step 3: source connection failures
Step 3a: source SG / network
Probe: aws dms test-connection --replication-instance-arn <inst> --endpoint-arn <source> returns
ConnectionState: failed. Verify: aws ec2 describe-security-groups --group-ids <source-sg> — check inbound rules allow the DMS instance's
SG on the source port (3306 MySQL, 5432 PostgreSQL, 1433 SQL Server,
1521 Oracle). Fix: Add an inbound rule allowing the DMS instance SG.
Step 3b: source IAM / credentials
Probe: Task logs show "Access denied for user" (MySQL) or
"authentication failed" (PostgreSQL). Verify: The DMS source
endpoint's Username / Password (Secrets Manager or inline). The
user must have replication privileges for the engine (see Step 4).
Step 4: source CDC configuration (engine-specific)
Step 4a: PostgreSQL source — pglogical / wal_level
Probes: On the source: select name, setting from pg_settings where name in ('wal_level', 'max_replication_slots'); (wal_level must be
logical); select * from pg_extension where extname='pglogical';
(must return a row); select * from pg_replication_slots where slot_name like 'awsdms_%'; (must return the DMS slot, active: t).
Fix: Set wal_level=logical in the RDS parameter group and reboot.
Install pglogical via CREATE EXTENSION pglogical;. Grant the DMS
user REPLICATION attribute and pglogical role.
Step 4b: MySQL source — binlog
Probes: show variables like 'binlog_format'; (must be ROW);
show variables like 'binlog_row_image'; (must be FULL); show variables like 'binlog_retention_hours'; (should be >= 24; RDS default
0 causes CDC stalls); show grants for '<dms-user>'; (must include
REPLICATION SLAVE, REPLICATION CLIENT). Fix: Set
binlog_format=ROW and binlog_row_image=FULL in the RDS parameter
group and reboot. Set binlog_retention_hours=24. Grant
REPLICATION SLAVE, REPLICATION CLIENT.
Step 4c: SQL Server source — MS-Replication / MS-CDC
Probes: select name, is_cdc_enabled, is_published from sys.databases where name='<db>'; (one must be 1); the DMS user must
be sysadmin (MS-Replication) or db_owner (MS-CDC). Fix: Enable
MS-CDC: use <db>; exec sys.sp_cdc_enable_db;. Or enable MS-Replication
via SSMS. SQL Server Express does NOT support CDC — upgrade to
Web/Standard/Enterprise.
Step 5: target connection and constraints
Step 5a: target SG / network
Probe: aws dms test-connection --replication-instance-arn <inst> --endpoint-arn <target> returns failed. Verify: aws ec2 describe-security-groups --group-ids <target-sg> — check inbound rules
allow the DMS instance SG on the target port.
Step 5b: target constraints (PK / FK / unique)
Probes: Task logs show FK/PK/unique constraint violation (engine-
specific message); describe-table-statistics shows the failing table
with Inserts at non-zero but FullLoadRowCount not advancing; inspect
the target schema for FK constraints referencing unloaded tables.
Fix: Disable FK constraints on the target during full load
(ForeignKeyChecks=0 MySQL, session_replication_role=replica
PostgreSQL, ALTER TABLE ... NOCHECK CONSTRAINT SQL Server). Use DMS
TargetTablePrepMode=TRUNCATE_BEFORE_LOAD. Load parent tables before
child tables (via table-mapping table-order or by splitting tasks).
Step 6: CDC latency and capacity
Step 6a: CDC latency climbing
Probes: aws cloudwatch get-metric-statistics --namespace AWS/DMS --metric-name CDCLatencySource ... (climbing = source bottleneck:
binlog/pglogical throughput); --metric-name CDCLatencyTarget ...
(climbing = target bottleneck: constraint checks, triggers, single-
threaded apply). Decision: High CDCLatencySource -> source CDC
mechanism is slow (increase binlog_retention_hours for MySQL, verify
max_replication_slots for PostgreSQL). High CDCLatencyTarget ->
target apply is slow (increase ParallelApplyThreads and
ParallelApplyBufferSize, disable triggers on target during sync).
Step 6b: memory pressure
Probes: CloudWatch FreeableMemory near zero (under 500MB for
dms.r5.large) + CPUUtilization sustained > 80%. Fix: Upgrade the
instance class (dms.r5.large -> dms.r5.xlarge). Move tasks off the
shared instance. Reduce MaxFileSize in task settings.
Step 6c: disk swap
Probes: CloudWatch SwapUsage non-zero and climbing + non-zero
CDCChangesDiskSource (DMS spilling CDC changes to disk). Fix:
Upgrade the instance class (more RAM). Increase AllocatedStorage if
storage-bound. Reduce the number of tasks on the shared instance.
Step 7: full-load and data errors
Step 7a: table-mapping exclusions
Probes: describe-table-statistics — compare loaded tables vs
expected list. Missing tables indicate a table-mapping filter or
exclude rule. Inspect TableMappings JSON for selection rules with
exclusionary filter conditions. Fix: Adjust the selection rule
to include all required tables. Re-run the task.
Step 7b: data type mismatch
Probes: Task logs show "ORA-01722 invalid number" (Oracle source),
"value too long for type character varying(N)" (PostgreSQL target), or
"Data truncation: Data too long for column" (MySQL target). Compare
source/target column types (Oracle NUMBER(38,0) -> PostgreSQL
NUMERIC precision loss; MySQL DATETIME -> PostgreSQL TIMESTAMP
timezone; SQL Server NVARCHAR(MAX) -> PostgreSQL TEXT). Fix:
Add explicit transformation rules in TableMappings to cast types.
Or pre-create the target schema with wider columns and use
TargetTablePrepMode=DO_NOTHING.
Step 7c: LOB size limit
Probes: Task logs show "LOB size exceeds maximum"; task settings
LobMaxSize (default 32KB) vs actual LOB column sizes. Fix: Set
LobMaxSize=0 (unlimited — slower) for LOB-heavy tables. Or use
BulkMaxSize with InlineLob for small LOBs. Pre-create the target
table with TEXT / BYTEA / VARBINARY(MAX) sized to the source.
Step 8: task settings and IAM
Probes: Task logs empty/missing — Logging is ESSENTIAL (default)
or disabled. aws iam get-role --role-name dms-cloudwatch-logs-role —
trust policy must include dms.amazonaws.com and permissions for
logs:CreateLogGroup, logs:CreateLogStream, logs:PutLogEvents.
aws iam get-role --role-name dms-vpc-role — trust policy must include
dms.amazonaws.com and permissions for ec2:CreateNetworkInterface,
ec2:DescribeNetworkInterfaces, ec2:DeleteNetworkInterface. Fix:
Recreate the IAM roles via the console or create-replication-instance
(which prompts to create them). Set Logging to DETAILED to capture
engine-specific error messages.
STRICT output contract
Every response MUST be a single block in this exact format. No prose
before or after. Substitute the angle-bracket placeholders.
TARGET: <task-arn> (source: <engine>, target: <engine>, instance: <class>)
VERDICT: ROOT_CAUSE_FOUND | NEED_MORE_INFO | ESCALATE
REASON: <1-2 sentences naming the failed layer and the failing probe>
LAYER: <SOURCE_CONNECTION | SOURCE_BINARY_LOGGING | SOURCE_PERMISSIONS |
TARGET_CONNECTION | TARGET_CONSTRAINTS | TARGET_PERMISSIONS |
TASK_SETTINGS | TABLE_MAPPING | DATA_TYPE_MISMATCH | LOB_LIMIT |
INSTANCE_CAPACITY | MEMORY_PRESSURE | DISK_SWAP | NETWORK_SG |
IAM_ROLE | DMS_SERVICE | UNKNOWN>
EVIDENCE:
- <observed symptom — task status, error message, metric anomaly>
- <failing probe — command and its output that confirms the cause>
- <passing probes — layers ruled out>
REMEDIATION:
1. <specific action with CLI command>
2. <verification command after the fix>
CONFIRM: Before executing any state-changing CLI, emit and await operator
approval: "CONFIRM: About to <action> on <task-arn>/<endpoint>. Proceed?
(yes/no)"
Worked example — PostgreSQL source CDC (wal_level=replica)
TARGET: arn:aws:dms:us-east-1:111:task:TASK001 (source: postgres,
target: postgres, instance: dms.r5.large)
VERDICT: ROOT_CAUSE_FOUND
REASON: The PostgreSQL source has wal_level=replica, which does not
support logical replication. Task started in CDC mode and failed
immediately with "logical decoding requires wal_level >= logical."
LAYER: SOURCE_BINARY_LOGGING
EVIDENCE:
- Symptom: task status failed within 10s of start.
- Probe: task logs: "logical decoding requires wal_level >= logical."
- Probe (source): select setting from pg_settings where
name='wal_level'; returns: replica.
- Passing: source SG allows DMS SG on 5432; pglogical installed;
DMS user has REPLICATION attribute.
REMEDIATION:
1. aws rds modify-db-parameter-group --db-parameter-group-name
<pg-name> --parameters ParameterName=wal_level,
ApplyMethod=pending-reboot,ParameterValue=logical
2. aws rds reboot-db-instance --db-instance-identifier <pg-id>
3. Verify wal_level=logical, then: aws dms start-replication-task
--replication-task-arn <task-arn> --start-replication-task-type
start-replication
CONFIRM: "About to set wal_level=logical on <pg-id> and reboot.
Brief connection drop. Proceed? (yes/no)"
Worked example — CDC latency from binlog retention (MySQL RDS)
Full worked example moved to
references/worked-examples.md.
Worked example — FK constraint violation on full load
Full worked example moved to
references/worked-examples.md.
Worked example — memory pressure causing CDC stall
Full worked example moved to
references/worked-examples.md.
Anti-Patterns — NEVER
NEVER diagnose a DMS task failure without first pulling the task's
CloudWatch Logs. The LastFailureMessage in
describe-replication-tasks is a high-level signal; the actual
engine-specific error (binlog disabled, constraint name, column type,
LOB size) is only in the logs. Without logs, you are guessing.
NEVER start a CDC task on a MySQL source without verifying
binlog_format=ROW AND binlog_retention_hours >= 24. RDS MySQL
defaults to binlog_retention_hours=0, causing binlogs to be purged
before DMS reads them. The task runs for hours then silently stalls.
NEVER start a CDC task on a PostgreSQL source without verifying
wal_level=logical. Changing wal_level requires a reboot; the task
fails immediately if it's still replica. Check the parameter group
BEFORE starting the task.
NEVER assume the DMS task Logging setting is DETAILED by default.
The default is ESSENTIAL. Without DETAILED logging, engine-
specific errors are absent from CloudWatch Logs and diagnosis is
impossible. Set Logging to DETAILED first when logs are empty.
NEVER assume a replication instance has capacity headroom. A single
dms.r5.large (8GB RAM) running 3+ CDC tasks will exhaust memory and
swap to disk. Always check FreeableMemory, SwapUsage, and
CPUUtilization before per-task latency — the root cause may be the
instance, not the task.
Pre-flight safety checks (run before any state-changing CLI)
MANDATORY CONFIRMATION GATE. Before any state-changing operation
(start-replication-task, stop-replication-task,
modify-replication-task, modify-replication-instance,
reboot-db-instance, modify-db-parameter-group), emit:
CONFIRM: About to <operation> on <task-arn / instance / db> in account <account> region <region>. This will <consequence>. Proceed? (yes/no). Do NOT execute until the operator confirms.
Capture pre-state for audit. Before remediation: aws dms describe-replication-tasks --filters Name=replication-task-id, Values=<task-id> --output json > /tmp/<task-id>-pre-$(date +%s).json.
Verify source CDC is enabled before restarting. A task restart on
a misconfigured source will fail again. Always run the source-specific
probes (Step 4) before start-replication-task.
Verify the target can accept the load. For full-load restarts,
ensure FK constraints are disabled or ordered, and target tables are
truncated if TargetTablePrepMode=TRUNCATE_BEFORE_LOAD.
Verify IAM roles exist. dms-vpc-role and dms-cloudwatch-logs- role must exist with trust policy dms.amazonaws.com. Missing roles
cause connection/logging failures that masquerade as engine errors.
Prefer source-side parameter changes over task-side workarounds.
Setting binlog_format=ROW or wal_level=logical on the source is
the correct fix; increasing ParallelApplyThreads is a workaround.
Expert heuristic — the top 5 non-obvious signals
Top-5 non-obvious signal checklist moved to
references/advanced-patterns.md.
Recent AWS features (2024-2026)
2024-2026 DMS feature notes moved to
references/advanced-patterns.md.
References (load on demand)
- references/diagnostic-commands.md — account-wide pre-flight command block (moved out of the Pre-flight section)
- references/worked-examples.md — secondary worked examples: binlog retention latency, FK constraint violation, memory pressure
- references/advanced-patterns.md — Step 0 expert knowledge, top-5 signals, recent DMS features (moved from this file)
- references/source-cdc-requirements.md — source engine CDC requirements
- references/task-settings-and-logging.md — task settings and logging reference
Domain
AWS CloudOps / Database Migration Service Replication, CDC Pipeline
Health, and Cross-Engine Migration Diagnostics.
AWS documentation
1---2name: dms-task-troubleshooter3description: 'Diagnoses AWS Database Migration Service (DMS) replication task failures through a systematic diagnostic tree covering task status (stopped, failed, running with errors), source connection failures (security group ingress, IAM trust policy, missing pglogical/MySQL binlog/MS-Replication/Oracle LogMiner), target connection failures (IAM, PK/FK constraint violations), CDC latency (memory pressure, disk swap, Logging disabled), full load errors (table mapping, data type mismatches, LOB limits), and task settings (Logging, validation, ParallelLoadThreads). Walks symptoms to root cause with describe-replication-tasks, task logs, table-statistics, and CDC metrics (CDCLatencySource, CDCLatencyTarget). Emits ROOT_CAUSE_FOUND with the specific failure layer or ESCALATE. Latest coverage: DMS Serverless, DMS with Babelfish, DMS Fleet Advisor. Use when a DMS task is stopped, failed, or showing high CDC latency.'4license: Apache-2.05compatibility: 'Agent runtime that reads SKILL.md (Claude Code, Cursor, Windsurf, Codex, Gemini). Offline symptom classification works from pasted task status and error messages. Live-account diagnosis uses aws dms describe-replication-tasks, describe-replication-instances, describe- endpoints, describe-table-statistics, aws logs filter-log-events (CloudWatch Logs for dms-task-<id>), aws cloudwatch get-metric- statistics (DMS namespace: CDCLatencySource, CDCLatencyTarget, CDCChangesDiskSource...'6metadata:7 source: https://skillmd.com/skills/jhkchan/dms-task-troubleshooter8 domain: aws-cloudops9 complexity: high10 requires_llm: 'true'11 phase: '2'12 supports_pipeline: 'true'13 entry_point: 'false'14 family: Migration15 task_type: troubleshoot16 skill_class: capability17 lifecycle_status: active18 verdict_shape: ROOT_CAUSE_FOUND | NEED_MORE_INFO | ESCALATE19 when_to_use: Diagnosing a DMS replication task that is stopped, failed, or running with errors; walking a symptom (task failed, source connection test failed, CDC latency climbing, full load table- statistics stuck at 0 rows, target constraint violation) to the failed layer (source endpoint, network, IAM, target endpoint, schema, task settings, replication instance capacity) with verify and fix commands; triaging a "DMS task is failing" or "CDC lag is growing" page where the root cause may be source binary logging disabled, source SG ingress blocked, IAM role trust policy wrong, target PK/FK constraints, memory pressure on CDC, disk swap on the replication instance, table-mapping wildcards excluding tables, data type mismatches, or LOB size limits — not necessarily the DMS service itself.20 when_not_to_use: Pre-migration assessment and database inventory (use Amazon DMS Fleet Advisor directly, not the troubleshooter), choosing source and target engines (use the deploy task type for endpoint creation), or cost optimization of DMS resources (use the optimize task type). This skill diagnoses runtime task failures and CDC latency, not greenfield planning.21 activation_triggers: DMS task failed, DMS task stopped, DMS replication task error, DMS source connection failed, DMS target connection failed, DMS CDC latency, DMS CDC lag growing, DMS full load stuck, DMS table statistics zero rows, DMS binary logging disabled, DMS pglogical not installed, DMS constraint violation, DMS data type mismatch, DMS LOB size limit, DMS memory pressure, DMS disk swap, DMS Serverless, DMS Babelfish, DMS Fleet Advisor22 invocation_schema: 'Input: either (a) a symptom description (task status failed, observed error message, failing table, CDC latency value), paired with the DMS task metadata (describe-replication-tasks, describe- endpoints, describe-replication-instances, table-statistics output), OR (b) a task ARN or name for live-account diagnosis. Output: a deterministic TARGET / VERDICT / REASON / LAYER / EVIDENCE / REMEDIATION block where VERDICT is in {ROOT_CAUSE_FOUND, NEED_MORE_INFO, ESCALATE} and LAYER is in {SOURCE_CONNECTION, SOURCE_BINARY_LOGGING, SOURCE_PERMISSIONS, TARGET_CONNECTION, TARGET_CONSTRAINTS, TARGET_PERMISSIONS, TASK_SETTINGS, TABLE_MAPPING, DATA_TYPE_MISMATCH, LOB_LIMIT, INSTANCE_CAPACITY, MEMORY_PRESSURE, DISK_SWAP, NETWORK_SG, IAM_ROLE, DMS_SERVICE, UNKNOWN}.'23 version: 0.1.024 author: Jacky Chan — AWS Community Builder25 keywords: AWS DMS, Database Migration Service, replication task, CDC, change data capture, full load, source endpoint, target endpoint, binary logging, binlog, pglogical, MS-Replication, LogMiner, task status failed, task stopped, CDC latency, memory pressure, disk swap, table mapping, data type mismatch, LOB, primary key, foreign key, constraint violation, DMS Serverless, Babelfish, DMS Fleet Advisor, CloudWatch Logs, troubleshooting26 tags: aws, dms, database-migration, rds, aurora, cdc, replication, troubleshooting27---2829# DMS Task Troubleshooter3031## What this skill does3233Diagnoses AWS DMS replication task failures by walking a symptom (task34status failed, source connection test failed, CDC latency climbing,35full-load table-statistics stuck, target constraint violation) to the36specific failed layer using a deterministic diagnostic tree. Each layer37has a single probe (CLI command, CloudWatch metric, or CloudWatch Logs38query) that proves or disproves it. Verifies the root cause with39positive evidence — a failing probe whose output matches the symptom —40then emits a fix with verification steps. Covers source-side failures41(binary logging disabled on MySQL, pglogical extension missing on42PostgreSQL, MS-Replication not enabled on SQL Server, LogMiner not43configured on Oracle), network/IAM failures (source SG ingress,44`dms-vpc-role` / `dms-cloudwatch-logs-role` trust policy), target-side45failures (PK missing, FK constraint, unique constraint), task-level46failures (table-mapping wildcards excluding the failing table, Logging47disabled hiding the cause), data-level failures (Oracle NUMBER to48PostgreSQL NUMERIC precision loss, LOB size limit at 32KB), and49instance-capacity failures (memory pressure on CDC, disk swap on the50replication instance). Emits `ROOT_CAUSE_FOUND` with the failing layer51and fix, `NEED_MORE_INFO` when a probe needs operator input, or52`ESCALATE` for AWS-side DMS service incidents.5354## Quick navigation5556| If the symptom is... | Go to | First probe |57|---|---|---|58| Task status `failed` immediately at start | Step 1 | `describe-replication-tasks` LastFailureMessage + task logs |59| Task status `failed` mid-migration | Step 2 | `describe-table-statistics` (which table?) + task logs |60| Source connection test fails | Step 3a | `describe-endpoints` + `test-connection` + source SG |61| Source CDC not capturing changes (Postgres) | Step 4a | `pg_create_logical_replication_slot`, `pglogical` extension |62| Source CDC not capturing changes (MySQL) | Step 4b | `binlog_format=ROW`, `binlog_retention` |63| Source CDC not capturing changes (SQL Server) | Step 4c | MS-Replication / MS-CDC enabled |64| Target connection test fails | Step 5a | `describe-endpoints` + `test-connection` + target SG |65| Target constraint violation (FK/PK/unique) | Step 5b | task logs + target schema inspection |66| CDC latency climbing, task running | Step 6a | CloudWatch `CDCLatencySource`, `CDCLatencyTarget` |67| Memory pressure on CDC | Step 6b | CloudWatch `FreeableMemory`, `SwapUsage` |68| Full-load table-statistics stuck at 0 rows | Step 7a | `describe-table-statistics` + table-mapping rules |69| Data type mismatch error in logs | Step 7b | task logs + source/target column types |70| LOB size limit error | Step 7c | task logs + `LobMaxSize` task setting |71| Task logs missing (Logging disabled) | Step 8 | task `Logging` setting + `dms-cloudwatch-logs-role` |72| Need the source engine's CDC requirements | Reference | `references/source-cdc-requirements.md` |73| Need the task settings reference | Reference | `references/task-settings-and-logging.md` |7475## Pre-flight: task metadata and gather-info gate7677Before running symptom-specific probes, gather the canonical task,78endpoint, instance, and table-statistics metadata. Misidentifying the79source engine (MySQL vs PostgreSQL vs Oracle) or the migration mode80(full load vs CDC vs full load + CDC) produces false root causes.8182### Account-wide pre-flight commands83Full pre-flight command block moved to84[references/diagnostic-commands.md](references/diagnostic-commands.md).8586### Source-engine short-circuit8788| `EngineName` | CDC mechanism | Effect on diagnosis |89|---|---|---|90| `mysql` | Binary log (binlog). Requires `binlog_format=ROW`, `binlog_row_image=FULL`, and the DMS user with `REPLICATION SLAVE` + `REPLICATION CLIENT` privileges. Binlog retention must be sufficient (default 0 hours on RDS — DMS falls behind). | Check `show binary logs;`, `show variables like 'binlog%';`. RDS parameter group must set `binlog_format=ROW`. |91| `postgres` | Logical replication slot (`pglogical` or `test_decoding`). Requires `wal_level=logical`, `max_replication_slots >= 1`, and the `pglogical` extension on the source database (for Aurora/RDS PostgreSQL 9.6+). Source must have a replication slot owned by the DMS user. | Check `select * from pg_replication_slots;`, `select * from pg_extension where extname='pglogical';`. RDS parameter group must set `wal_level=logical`. |92| `sqlserver` | MS-Replication (for SQL Server 2008+) or MS-CDC (for SQL Server 2012+). Requires the database enabled for MS-Replication (`sp_replicationdboption`) or MS-CDC (`sys.sp_cdc_enable_db`), and the DMS user as `sysadmin` (MS-Replication) or `db_owner` (MS-CDC). | Check `select name, is_cdc_enabled, is_published from sys.databases;`. SQL Server Express does NOT support CDC. |93| `oracle` | LogMiner (default) or Binary Reader. Requires `ARCHIVELOG` mode, supplemental logging (`ALTER DATABASE ADD SUPPLEMENTAL LOG DATA`), and the DMS user with `SELECT ANY TRANSACTION` + `EXECUTE on DBMS_LOGMNR`. Oracle Source 12c+ needs `LOGMINING` role. | Check `select log_mode from v$database;`, `select supplemental_log_data_min from v$database;`. |94| `mariadb` | Same as MySQL (binlog). | Same as MySQL. |95| `docdb` | Change streams (not binlog). Requires `change_streams` enabled on the cluster parameter group. | Check the cluster parameter group for `change_streams: enabled`. |9697### Migration-type short-circuit9899| `MigrationType` | Effect on diagnosis |100|---|---|101| `full-load` | Full load only. No CDC. Failures are in the load phase (table mapping, data type, LOB, target constraints). Source binary logging is NOT required. |102| `cdc` | CDC only (no initial full load). Source MUST have the CDC mechanism enabled (binlog / pglogical / MS-CDC / LogMiner) BEFORE the task starts. Failures are typically source-CDC-configuration issues. |103| `full-load-and-cdc` | Full load followed by CDC. The most common migration type. Full-load failures show in table-statistics; CDC failures show as `CDCLatencySource` climbing after the full load completes. |104105If the input is malformed (missing task ARN, missing source engine type,106ambiguous error message), emit:107108```text109TARGET: <task-arn or unknown>110VERDICT: NEED_MORE_INFO111REASON: Input is missing required context — at minimum the DMS task112 ARN or ID, the source and target engine types, and the observed113 symptom (task failed, CDC latency, full-load stuck). Cannot drive a114 diagnostic tree without the error layer.115LAYER: UNKNOWN116EVIDENCE:117 - Missing: <list specific missing fields>118REMEDIATION: Re-prompt the operator for: (1) the DMS task ID or ARN,119 (2) the source and target engine types (mysql, postgres, sqlserver,120 oracle, docdb), (3) the observed symptom (task status, error message121 from task logs, CDC latency value), and (4) for live diagnosis, the122 time window of the failure.123```124125## Process — Diagnostic decision tree (apply in symptom order)126127### Step 0: Expert knowledge — non-obvious DMS behaviors128Expert-knowledge behaviors (LastFailureMessage limits, binlog retention129defaults, LOB defaults, shared instances) moved to [references/advanced-patterns.md](references/advanced-patterns.md).130131### Step 1: task-failed-at-start132133Task status is `failed` immediately or within seconds of starting.134135**Probes:**1361371. `aws dms describe-replication-tasks --filters138 Name=replication-task-id,Values=<task-id>` — capture `Status`,139 `StopReason`, `LastFailureMessage`.1402. `aws logs filter-log-events --log-group-name dms-task-<id>141 --filter-pattern ERROR` — capture the engine-specific error.1423. `aws dms describe-endpoints` — capture source and target143 `EngineName`, `ServerName`, `Port`, `SslMode`, and144 `ExternalTableDefinition` / `ExtraConnectionAttributes`.1454. `aws dms test-connection --replication-instance-arn <inst-arn>146 --endpoint-arn <source-arn>` — verify the source is reachable.147148**Decision:**149150- If task logs show "binary logging is not enabled" (MySQL) -> Step 4b.151- If task logs show "could not access file $libdir/pglogical" or152 "logical decoding requires wal_level >= logical" (PostgreSQL) ->153 Step 4a.154- If task logs show "MS-CDC is not enabled" (SQL Server) -> Step 4c.155- If task logs show "ORA-01331 LogMiner" (Oracle) -> Step 4 (Oracle).156- If `test-connection` fails for source -> Step 3a (source SG / VPC).157- If `test-connection` fails for target -> Step 5a (target SG / VPC).158- If task logs show "ResourceNotFound: role dms-vpc-role" -> Step 8159 (IAM).160- If none match -> NEED_MORE_INFO with the raw error.161162### Step 2: task-failed-mid-migration163164Task status is `failed` after the full load started or during CDC.165166**Probes:**1671681. `aws dms describe-table-statistics --replication-task-arn <arn>` —169 find the table with `LastErrorMessage` set or `FullLoadRowCount` at170 0 when others have rows.1712. `aws logs filter-log-events --log-group-name dms-task-<id>172 --filter-pattern ERROR` — capture the per-table error.1733. `aws cloudwatch get-metric-statistics --namespace AWS/DMS174 --metric-name CDCLatencySource ...` — check if CDC lag preceded175 the failure.176177**Decision:**178179- If task logs show "foreign key constraint violation" -> Step 5b.180- If task logs show "primary key missing on target table" -> Step 5b.181- If task logs show "ORA-01722 invalid number" or "value too long for182 type" -> Step 7b (data type mismatch).183- If task logs show "LOB size exceeds maximum" -> Step 7c (LOB).184- If `FreeableMemory` dropped to near zero before the failure -> Step185 6b (memory pressure).186- If `SwapUsage` was high before the failure -> Step 6c (disk swap).187188### Step 3: source connection failures189190#### Step 3a: source SG / network191192**Probe:** `aws dms test-connection --replication-instance-arn <inst>193--endpoint-arn <source>` returns194`ConnectionState: failed`. **Verify:** `aws ec2 describe-security-groups195--group-ids <source-sg>` — check inbound rules allow the DMS instance's196SG on the source port (3306 MySQL, 5432 PostgreSQL, 1433 SQL Server,1971521 Oracle). **Fix:** Add an inbound rule allowing the DMS instance SG.198199#### Step 3b: source IAM / credentials200201**Probe:** Task logs show "Access denied for user" (MySQL) or202"authentication failed" (PostgreSQL). **Verify:** The DMS source203endpoint's `Username` / `Password` (Secrets Manager or inline). The204user must have replication privileges for the engine (see Step 4).205206### Step 4: source CDC configuration (engine-specific)207208#### Step 4a: PostgreSQL source — pglogical / wal_level209210**Probes:** On the source: `select name, setting from pg_settings where211name in ('wal_level', 'max_replication_slots');` (`wal_level` must be212`logical`); `select * from pg_extension where extname='pglogical';`213(must return a row); `select * from pg_replication_slots where214slot_name like 'awsdms_%';` (must return the DMS slot, `active: t`).215**Fix:** Set `wal_level=logical` in the RDS parameter group and reboot.216Install `pglogical` via `CREATE EXTENSION pglogical;`. Grant the DMS217user `REPLICATION` attribute and `pglogical` role.218219#### Step 4b: MySQL source — binlog220221**Probes:** `show variables like 'binlog_format';` (must be `ROW`);222`show variables like 'binlog_row_image';` (must be `FULL`); `show223variables like 'binlog_retention_hours';` (should be >= 24; RDS default2240 causes CDC stalls); `show grants for '<dms-user>';` (must include225`REPLICATION SLAVE`, `REPLICATION CLIENT`). **Fix:** Set226`binlog_format=ROW` and `binlog_row_image=FULL` in the RDS parameter227group and reboot. Set `binlog_retention_hours=24`. Grant228`REPLICATION SLAVE, REPLICATION CLIENT`.229230#### Step 4c: SQL Server source — MS-Replication / MS-CDC231232**Probes:** `select name, is_cdc_enabled, is_published from233sys.databases where name='<db>';` (one must be `1`); the DMS user must234be `sysadmin` (MS-Replication) or `db_owner` (MS-CDC). **Fix:** Enable235MS-CDC: `use <db>; exec sys.sp_cdc_enable_db;`. Or enable MS-Replication236via SSMS. SQL Server Express does NOT support CDC — upgrade to237Web/Standard/Enterprise.238239### Step 5: target connection and constraints240241#### Step 5a: target SG / network242243**Probe:** `aws dms test-connection --replication-instance-arn <inst>244--endpoint-arn <target>` returns failed. **Verify:** `aws ec2245describe-security-groups --group-ids <target-sg>` — check inbound rules246allow the DMS instance SG on the target port.247248#### Step 5b: target constraints (PK / FK / unique)249250**Probes:** Task logs show FK/PK/unique constraint violation (engine-251specific message); `describe-table-statistics` shows the failing table252with `Inserts` at non-zero but `FullLoadRowCount` not advancing; inspect253the target schema for FK constraints referencing unloaded tables.254**Fix:** Disable FK constraints on the target during full load255(`ForeignKeyChecks=0` MySQL, `session_replication_role=replica`256PostgreSQL, `ALTER TABLE ... NOCHECK CONSTRAINT` SQL Server). Use DMS257`TargetTablePrepMode=TRUNCATE_BEFORE_LOAD`. Load parent tables before258child tables (via table-mapping `table-order` or by splitting tasks).259260### Step 6: CDC latency and capacity261262#### Step 6a: CDC latency climbing263264**Probes:** `aws cloudwatch get-metric-statistics --namespace AWS/DMS265--metric-name CDCLatencySource ...` (climbing = source bottleneck:266binlog/pglogical throughput); `--metric-name CDCLatencyTarget ...`267(climbing = target bottleneck: constraint checks, triggers, single-268threaded apply). **Decision:** High `CDCLatencySource` -> source CDC269mechanism is slow (increase `binlog_retention_hours` for MySQL, verify270`max_replication_slots` for PostgreSQL). High `CDCLatencyTarget` ->271target apply is slow (increase `ParallelApplyThreads` and272`ParallelApplyBufferSize`, disable triggers on target during sync).273274#### Step 6b: memory pressure275276**Probes:** CloudWatch `FreeableMemory` near zero (under 500MB for277dms.r5.large) + `CPUUtilization` sustained > 80%. **Fix:** Upgrade the278instance class (dms.r5.large -> dms.r5.xlarge). Move tasks off the279shared instance. Reduce `MaxFileSize` in task settings.280281#### Step 6c: disk swap282283**Probes:** CloudWatch `SwapUsage` non-zero and climbing + non-zero284`CDCChangesDiskSource` (DMS spilling CDC changes to disk). **Fix:**285Upgrade the instance class (more RAM). Increase `AllocatedStorage` if286storage-bound. Reduce the number of tasks on the shared instance.287288### Step 7: full-load and data errors289290#### Step 7a: table-mapping exclusions291292**Probes:** `describe-table-statistics` — compare loaded tables vs293expected list. Missing tables indicate a table-mapping `filter` or294`exclude` rule. Inspect `TableMappings` JSON for `selection` rules with295exclusionary `filter` conditions. **Fix:** Adjust the `selection` rule296to `include` all required tables. Re-run the task.297298#### Step 7b: data type mismatch299300**Probes:** Task logs show "ORA-01722 invalid number" (Oracle source),301"value too long for type character varying(N)" (PostgreSQL target), or302"Data truncation: Data too long for column" (MySQL target). Compare303source/target column types (Oracle `NUMBER(38,0)` -> PostgreSQL304`NUMERIC` precision loss; MySQL `DATETIME` -> PostgreSQL `TIMESTAMP`305timezone; SQL Server `NVARCHAR(MAX)` -> PostgreSQL `TEXT`). **Fix:**306Add explicit `transformation` rules in `TableMappings` to cast types.307Or pre-create the target schema with wider columns and use308`TargetTablePrepMode=DO_NOTHING`.309310#### Step 7c: LOB size limit311312**Probes:** Task logs show "LOB size exceeds maximum"; task settings313`LobMaxSize` (default 32KB) vs actual LOB column sizes. **Fix:** Set314`LobMaxSize=0` (unlimited — slower) for LOB-heavy tables. Or use315`BulkMaxSize` with `InlineLob` for small LOBs. Pre-create the target316table with `TEXT` / `BYTEA` / `VARBINARY(MAX)` sized to the source.317318### Step 8: task settings and IAM319320**Probes:** Task logs empty/missing — `Logging` is `ESSENTIAL` (default)321or disabled. `aws iam get-role --role-name dms-cloudwatch-logs-role` —322trust policy must include `dms.amazonaws.com` and permissions for323`logs:CreateLogGroup`, `logs:CreateLogStream`, `logs:PutLogEvents`.324`aws iam get-role --role-name dms-vpc-role` — trust policy must include325`dms.amazonaws.com` and permissions for `ec2:CreateNetworkInterface`,326`ec2:DescribeNetworkInterfaces`, `ec2:DeleteNetworkInterface`. **Fix:**327Recreate the IAM roles via the console or `create-replication-instance`328(which prompts to create them). Set `Logging` to `DETAILED` to capture329engine-specific error messages.330331## STRICT output contract332333Every response MUST be a single block in this exact format. No prose334before or after. Substitute the angle-bracket placeholders.335336```text337TARGET: <task-arn> (source: <engine>, target: <engine>, instance: <class>)338VERDICT: ROOT_CAUSE_FOUND | NEED_MORE_INFO | ESCALATE339REASON: <1-2 sentences naming the failed layer and the failing probe>340LAYER: <SOURCE_CONNECTION | SOURCE_BINARY_LOGGING | SOURCE_PERMISSIONS |341 TARGET_CONNECTION | TARGET_CONSTRAINTS | TARGET_PERMISSIONS |342 TASK_SETTINGS | TABLE_MAPPING | DATA_TYPE_MISMATCH | LOB_LIMIT |343 INSTANCE_CAPACITY | MEMORY_PRESSURE | DISK_SWAP | NETWORK_SG |344 IAM_ROLE | DMS_SERVICE | UNKNOWN>345EVIDENCE:346 - <observed symptom — task status, error message, metric anomaly>347 - <failing probe — command and its output that confirms the cause>348 - <passing probes — layers ruled out>349REMEDIATION:350 1. <specific action with CLI command>351 2. <verification command after the fix>352CONFIRM: Before executing any state-changing CLI, emit and await operator353 approval: "CONFIRM: About to <action> on <task-arn>/<endpoint>. Proceed?354 (yes/no)"355```356357### Worked example — PostgreSQL source CDC (wal_level=replica)358359```text360TARGET: arn:aws:dms:us-east-1:111:task:TASK001 (source: postgres,361 target: postgres, instance: dms.r5.large)362VERDICT: ROOT_CAUSE_FOUND363REASON: The PostgreSQL source has wal_level=replica, which does not364 support logical replication. Task started in CDC mode and failed365 immediately with "logical decoding requires wal_level >= logical."366LAYER: SOURCE_BINARY_LOGGING367EVIDENCE:368 - Symptom: task status failed within 10s of start.369 - Probe: task logs: "logical decoding requires wal_level >= logical."370 - Probe (source): select setting from pg_settings where371 name='wal_level'; returns: replica.372 - Passing: source SG allows DMS SG on 5432; pglogical installed;373 DMS user has REPLICATION attribute.374REMEDIATION:375 1. aws rds modify-db-parameter-group --db-parameter-group-name376 <pg-name> --parameters ParameterName=wal_level,377 ApplyMethod=pending-reboot,ParameterValue=logical378 2. aws rds reboot-db-instance --db-instance-identifier <pg-id>379 3. Verify wal_level=logical, then: aws dms start-replication-task380 --replication-task-arn <task-arn> --start-replication-task-type381 start-replication382CONFIRM: "About to set wal_level=logical on <pg-id> and reboot.383 Brief connection drop. Proceed? (yes/no)"384```385386### Worked example — CDC latency from binlog retention (MySQL RDS)387Full worked example moved to388[references/worked-examples.md](references/worked-examples.md).389390### Worked example — FK constraint violation on full load391Full worked example moved to392[references/worked-examples.md](references/worked-examples.md).393394### Worked example — memory pressure causing CDC stall395Full worked example moved to396[references/worked-examples.md](references/worked-examples.md).397398## Anti-Patterns — NEVER399400- NEVER diagnose a DMS task failure without first pulling the task's401 CloudWatch Logs. The `LastFailureMessage` in402 `describe-replication-tasks` is a high-level signal; the actual403 engine-specific error (binlog disabled, constraint name, column type,404 LOB size) is only in the logs. Without logs, you are guessing.405406- NEVER start a CDC task on a MySQL source without verifying407 `binlog_format=ROW` AND `binlog_retention_hours >= 24`. RDS MySQL408 defaults to `binlog_retention_hours=0`, causing binlogs to be purged409 before DMS reads them. The task runs for hours then silently stalls.410411- NEVER start a CDC task on a PostgreSQL source without verifying412 `wal_level=logical`. Changing `wal_level` requires a reboot; the task413 fails immediately if it's still `replica`. Check the parameter group414 BEFORE starting the task.415416- NEVER assume the DMS task `Logging` setting is `DETAILED` by default.417 The default is `ESSENTIAL`. Without `DETAILED` logging, engine-418 specific errors are absent from CloudWatch Logs and diagnosis is419 impossible. Set `Logging` to `DETAILED` first when logs are empty.420421- NEVER assume a replication instance has capacity headroom. A single422 dms.r5.large (8GB RAM) running 3+ CDC tasks will exhaust memory and423 swap to disk. Always check `FreeableMemory`, `SwapUsage`, and424 `CPUUtilization` before per-task latency — the root cause may be the425 instance, not the task.426427## Pre-flight safety checks (run before any state-changing CLI)428429- **MANDATORY CONFIRMATION GATE.** Before any state-changing operation430 (`start-replication-task`, `stop-replication-task`,431 `modify-replication-task`, `modify-replication-instance`,432 `reboot-db-instance`, `modify-db-parameter-group`), emit:433 `CONFIRM: About to <operation> on <task-arn / instance / db> in434 account <account> region <region>. This will <consequence>. Proceed?435 (yes/no)`. Do NOT execute until the operator confirms.436437- **Capture pre-state for audit.** Before remediation: `aws dms438 describe-replication-tasks --filters Name=replication-task-id,439 Values=<task-id> --output json > /tmp/<task-id>-pre-$(date +%s).json`.440441- **Verify source CDC is enabled before restarting.** A task restart on442 a misconfigured source will fail again. Always run the source-specific443 probes (Step 4) before `start-replication-task`.444445- **Verify the target can accept the load.** For full-load restarts,446 ensure FK constraints are disabled or ordered, and target tables are447 truncated if `TargetTablePrepMode=TRUNCATE_BEFORE_LOAD`.448449- **Verify IAM roles exist.** `dms-vpc-role` and `dms-cloudwatch-logs-450 role` must exist with trust policy `dms.amazonaws.com`. Missing roles451 cause connection/logging failures that masquerade as engine errors.452453- **Prefer source-side parameter changes over task-side workarounds.**454 Setting `binlog_format=ROW` or `wal_level=logical` on the source is455 the correct fix; increasing `ParallelApplyThreads` is a workaround.456457## Expert heuristic — the top 5 non-obvious signals458Top-5 non-obvious signal checklist moved to459[references/advanced-patterns.md](references/advanced-patterns.md).460461## Recent AWS features (2024-2026)4622024-2026 DMS feature notes moved to463[references/advanced-patterns.md](references/advanced-patterns.md).464465## References (load on demand)466467- [references/diagnostic-commands.md](references/diagnostic-commands.md) — account-wide pre-flight command block (moved out of the Pre-flight section)468- [references/worked-examples.md](references/worked-examples.md) — secondary worked examples: binlog retention latency, FK constraint violation, memory pressure469- [references/advanced-patterns.md](references/advanced-patterns.md) — Step 0 expert knowledge, top-5 signals, recent DMS features (moved from this file)470- [references/source-cdc-requirements.md](references/source-cdc-requirements.md) — source engine CDC requirements471- [references/task-settings-and-logging.md](references/task-settings-and-logging.md) — task settings and logging reference472473## Domain474475AWS CloudOps / Database Migration Service Replication, CDC Pipeline476Health, and Cross-Engine Migration Diagnostics.477478## AWS documentation479480- **AWS Database Migration Service User Guide** — https://docs.aws.amazon.com/dms/latest/userguide/481- **Troubleshooting migration tasks** — https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Troubleshooting.html482- **DMS task settings** — https://docs.aws.amazon.com/dms/latest/userguide/TASK_Settings.html483- **Source engines for DMS** — https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Source.html484- **Target engines for DMS** — https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Target.html485- **Using a PostgreSQL source** — https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Source.PostgreSQL.html486- **Using a MySQL source** — https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Source.MySQL.html487- **DMS Serverless** — https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Serverless.html488- **DMS data validation** — https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Validating.html489- **DMS Fleet Advisor** — https://docs.aws.amazon.com/dms/latest/userguide/fleet-advisor.html