alibaba/canal · error · CanalParseException

Unsupported BinlogFormat + format

Error message

Unsupported BinlogFormat  + format

What it means

When supportBinlogFormats is configured, preDump() reads the master's binlog_format and rejects it with CanalParseException if it is not in the allowed set. This is an explicit compatibility gate so canal refuses to replicate from a master whose row format it cannot safely consume (canal requires ROW for reliable row-based replication).

Source

Thrown at parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/MysqlEventParser.java:102

            metaConnection = (MysqlConnection) connection.fork();
            try {
                metaConnection.connect();
            } catch (IOException e) {
                throw new CanalParseException(e);
            }

            if (supportBinlogFormats != null && supportBinlogFormats.length > 0) {
                BinlogFormat format = ((MysqlConnection) metaConnection).getBinlogFormat();
                boolean found = false;
                for (BinlogFormat supportFormat : supportBinlogFormats) {
                    if (supportFormat != null && format == supportFormat) {
                        found = true;
                        break;
                    }
                }

                if (!found) {
                    throw new CanalParseException("Unsupported BinlogFormat " + format);
                }
            }

            if (supportBinlogImages != null && supportBinlogImages.length > 0) {
                BinlogImage image = ((MysqlConnection) metaConnection).getBinlogImage();
                boolean found = false;
                for (BinlogImage supportImage : supportBinlogImages) {
                    if (supportImage != null && image == supportImage) {
                        found = true;
                        break;
                    }
                }

                if (!found) {
                    throw new CanalParseException("Unsupported BinlogImage " + image);
                }
            }

View on GitHub (pinned to 87be50e876)

Solutions

  1. Set the master to ROW: `SET GLOBAL binlog_format = 'ROW'` and persist in my.cnf.
  2. If MIXED is acceptable for your use case, include BinlogFormat.MIXED in supportBinlogFormats (not recommended — canal is row-oriented).
  3. Remove the supportBinlogFormats constraint if you want canal to accept any format (at your own risk).

Example fix

-- make the master match canal's required format
SET GLOBAL binlog_format = 'ROW';
Defensive patterns

Strategy: validation

Validate before calling

// Validate the master's binlog_format against the allowed set before preDump
BinlogFormat actual = connection.getBinlogFormat();
boolean ok = false;
for (BinlogFormat allowed : supportBinlogFormats) {
    if (allowed == actual) { ok = true; break; }
}
if (!ok) {
    throw new IllegalStateException("Master binlog_format " + actual + " not in allowed " + Arrays.toString(supportBinlogFormats));
}

Prevention

When it happens

Trigger: canal.instance.supportBinlogFormats (or the setter) is set to a subset (e.g. {ROW}) and the connected master reports a binlog_format outside that subset (e.g. MIXED or STATEMENT).

Common situations: Master configured with binlog_format=MIXED/STATEMENT while canal's supportBinlogFormats whitelists only ROW; promoting a server whose format differs from what canal expects.

Related errors


AI-assisted analysis of alibaba/canal@87be50e876 (2026-08-14). Data as JSON: /api/errors/42d24db5a4d84913. Report an issue: GitHub.