{"record":{"id":"a6c397893341fd32","repo":"apache/seatunnel","slug":"mysql-cdc-diagnostic-variable-not-found","errorCode":null,"errorMessage":"MySQL-CDC diagnostic: variable {} not found","messagePattern":"MySQL-CDC diagnostic: variable (.+?) not found","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"seatunnel-connectors-v2/connector-cdc/connector-cdc-mysql/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/mysql/source/reader/fetch/MySqlSourceFetchTaskContext.java","lineNumber":497,"sourceCode":"                    e.getMessage());\n        }\n    }\n\n    private void logMySqlBinlogRetentionVariables() {\n        logMySqlVariable(\"log_bin\");\n        logMySqlVariable(\"binlog_format\");\n        logMySqlVariable(\"binlog_expire_logs_seconds\");\n        logMySqlVariable(\"expire_logs_days\");\n    }\n\n    private void logMySqlVariable(String variableName) {\n        final String sql = String.format(\"SHOW VARIABLES LIKE '%s'\", variableName);\n        try {\n            connection.query(\n                    sql,\n                    rs -> {\n                        if (!rs.next()) {\n                            LOG.warn(\"MySQL-CDC diagnostic: variable {} not found\", variableName);\n                            return;\n                        }\n                        LOG.warn(\n                                \"MySQL-CDC diagnostic: variable {}={}\",\n                                rs.getString(1),\n                                rs.getString(2));\n                    });\n        } catch (SQLException e) {\n            LOG.warn(\n                    \"MySQL-CDC diagnostic: failed to query variable {}: {}\",\n                    variableName,\n                    e.getMessage());\n        }\n    }\n\n    private void logMySqlMasterStatus() {\n        try {\n            connection.query(","sourceCodeStart":479,"sourceCodeEnd":515,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-cdc/connector-cdc-mysql/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/mysql/source/reader/fetch/MySqlSourceFetchTaskContext.java#L479-L515","documentation":"Diagnostic WARN from logMySqlVariable: a SHOW VARIABLES LIKE '<name>' query for a specific MySQL variable (used by logMySqlBinlogRetentionVariables, e.g. binlog_expire_logs_seconds or expire_logs_days) returned no rows, meaning the variable does not exist on this server version. This indicates the retention analysis cannot be based on that variable.","triggerScenarios":"logMySqlBinlogRetentionVariables calls logMySqlVariable for a retention variable and rs.next() is false — typically because the MySQL version names the variable differently (binlog_expire_logs_seconds on 8.0 vs expire_logs_days on 5.7) or the variable was removed.","commonSituations":"Mixed MySQL 5.7/8.0 environments; Percona/MariaDB variants lacking a variable; checking both names and seeing one 'not found' warning per missing name.","solutions":["Verify which retention variable your MySQL version supports (binlog_expire_logs_seconds for 8.0, expire_logs_days for 5.7) and read it manually","Upgrade SeaTunnel/Debezium connector version if it needs to cover the other variable name","Treat the warning as benign if the counterpart variable was found"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"SELECT @@version; -- 8.0+: binlog_expire_logs_seconds, 5.7: expire_logs_days\nSHOW VARIABLES LIKE 'binlog_expire%';\nSHOW VARIABLES LIKE 'expire_logs_days';","typeGuard":null,"tryCatchPattern":"try (ResultSet rs = stmt.executeQuery(\"SHOW VARIABLES LIKE 'binlog_expire_logs_seconds'\")) {\n    if (!rs.next()) {\n        // fallback for MySQL 5.7\n        query(\"SHOW VARIABLES LIKE 'expire_logs_days'\");\n    }\n}","preventionTips":["Know your MySQL version's variable names; check both retention variables","Pin and test connector versions against your MySQL server version","Treat single 'variable not found' warnings as benign when a counterpart exists"],"tags":["mysql","cdc","diagnostics","variables","version-compat"],"backgroundTag":"record-not-found","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}