2002
MariaDBERRORCommonReplicationHIGH confidence

Network write error to replica during replication

Production Risk

Critical — replication halts.

What this means

The source server encountered a network write error while sending binary log events to the replica. This is the source-side complement of 2001 and causes the binlog dump thread to terminate.

Why it happens
  1. 1Replica disconnected abruptly while source was writing an event.
  2. 2Network failure or TCP reset between source and replica.
  3. 3Replica crashed or was restarted during streaming.
How to reproduce
trigger — this will error
trigger — this will error
-- Observed in source server error log, not triggered by SQL

expected output

ERROR 2002: Got error writing communication packets.

Fix 1

Restart replication from the replica side

Restart replication from the replica side
-- On replica:
START SLAVE;

Why this works

The replica reconnects and the source resumes the binlog dump.

Fix 2

Investigate source error log for the root cause

Investigate source error log for the root cause
-- Review /var/log/mysql/error.log on source

Why this works

Detailed packet-level errors are recorded in the source error log.

What not to do

Version notes

Sources
Official documentation ↗

MySQL 8.0 — 2002 ER_MASTER_NET_WRITE

Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev

← All MariaDB errors