<p>MySQL throws error 1379 when an unknown problem stops the server from deleting old binary or relay log files.</p>
<p>MySQL Error 1379 ER_LOG_PURGE_UNKNOWN_ERR happens when the server cannot remove a binary log during PURGE BINARY LOGS. Check file permissions, stop replication threads, then purge the log again to resolve the issue.</p>
Unknown error during log purge
Error 1379 (SQLSTATE HY000) occurs when MySQL tries to delete a binary or relay log file and receives an unrecognized return code from the operating system or storage engine. The server reports "Unknown error during log purge" and aborts the purge operation.
The failure usually appears during PURGE BINARY LOGS, RESET MASTER, or the automatic purge driven by expire_logs_days or binlog_expire_logs_seconds. Replication can stall and disk space may keep shrinking until the purge succeeds.
File system anomalies often block log removal. Missing files, permission mismatches, or locks held by antivirus or backup agents can generate an unknown OS error that bubbles up as 1379.
Replication threads reading the target log, a crashed I/O thread, or InnoDB corruption may also stop the purge and trigger the generic error code.
First, inspect the MySQL error log to capture the underlying OS error number. Then confirm the binary log file exists and has correct ownership. Stop replication threads with STOP SLAVE or STOP REPLICA before retrying PURGE BINARY LOGS.
If the file is locked externally, pause the backup or antivirus service. On corrupted logs, copy them aside, run RESET MASTER, and restart MySQL.
On Linux, wrong SELinux labels often block file deletion. Relabel the datadir or disable SELinux enforcement temporarily, then purge again.
On Windows, open file handles from mysqldump or mysqlbinlog keep the log busy. Close those programs or reboot the host to release the handle.
Enable automatic expiration with binlog_expire_logs_seconds so purges happen regularly while the log is still fresh and less likely to be locked.
Maintain ample disk space, monitor replication lag, and ensure backup tools use --lock-binlog or --read-from-remote-master to avoid holding file locks.
Error 1380 ER_LOG_PURGE_NO_FILE refers to a missing binary log during purge. Error 1092 ER_BINLOG_PURGE_PROHIBITED appears when binlog purging is disabled. Each requires different checks but follows similar troubleshooting steps.
The mysqld user lacks delete rights on the datadir, causing the OS to refuse the unlink request.
Slave SQL or I/O threads still reading the log prevent its removal and raise the unknown purge error.
Backup utilities, antivirus software, or manual tail commands can keep a handle on the binary log, blocking deletion.
Disk errors or an unclean shutdown may corrupt directory metadata and make the log unreachable to DELETE calls.
The specified binary log does not exist, often due to typo or earlier deletion.
Purge operation denied because binlog deletion is disabled via gtid_mode or server settings.
Purge failed due to insufficient file permissions rather than an unknown OS error.
No user data is lost, but disk usage grows and replication may lag until the purge succeeds.
Ignoring the error risks running out of disk space, which can crash the server. Always resolve promptly.
RESET MASTER clears all binary logs and removes the blockage, but you lose point-in-time recovery; use only after a full backup.
Galaxy tracks purge commands in versioned SQL, highlights failed runs, and suggests permission fixes via its AI copilot, reducing human error.