Updated on 2023-02-07 GMT+08:00

Canal Fails to Parse Binlogs

Scenario

An error occurred when Canal parsed binlogs, interrupting binlog collection. The error message is as follows:

xxx.otter.canal.parse.exception.CanalParseException: java.lang.NumberFormatException:- Caused by: java.lang.NumberFormatException:  - at xxx.fastsql.sql.parser.Lexer.integerValue(Lexer.java:2454)

Troubleshooting

Check whether the value of binlog_rows_query_log_events of your RDS for MySQL instance is set to 1 or ON.

  • Canal supports only subscriptions to binlogs in row format.
  • When the value of binlog_rows_query_log_events is set to 1 or ON, Rows_query events are generated in binlogs. These events are not in row format. In certain scenarios, blank topics may occur in Canal, resulting in a binlog parsing failure.

Solution

Change the value of binlog_rows_query_log_events to OFF and restart the interrupted Canal task.