1224
MariaDBERRORNotableReplication / LoggingHIGH confidence

Too many files open during binary log purge

Production Risk

Medium — binary log purge fails, log files accumulate and consume disk space.

What this means

ER_BINLOG_PURGE_EMFILE (1224, SQLSTATE HY000) is raised during PURGE BINARY LOGS when the OS reports too many open file descriptors, preventing the purge operation from completing.

Why it happens
  1. 1Operating system file descriptor limit (open_files_limit) reached
  2. 2Too many binary log files open simultaneously during purge
How to reproduce
trigger — this will error
trigger — this will error
PURGE BINARY LOGS BEFORE '2024-01-01';  -- fails if too many FDs open

expected output

ERROR 1224 (HY000): Too many files open; please close some files and try again

Fix

Increase OS file descriptor limits

Increase OS file descriptor limits
-- In my.cnf:
-- open_files_limit = 65535
-- Also set OS ulimit: ulimit -n 65535

Why this works

Higher file descriptor limits allow MySQL to open more files simultaneously.

Sources
Official documentation ↗

MySQL 8.0 — 1224 ER_BINLOG_PURGE_EMFILE

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

← All MariaDB errors