Uploaded image for project: 'Debezium'
  1. Debezium
  2. DBZ-5267

Invalid date 'SEPTEMBER 31'

XMLWordPrintable

    • False
    • None
    • False

      set following property can reproduce this issue.
      sql_mode=ALLOW_INVALID_DATES,NO_ENGINE_SUBSTITUTION

      CREATE TABLE `t_user_black_list` (
      `id` int(10) unsigned NOT NULL,
      `data` varchar(20) DEFAULT NULL,
      `create_time` datetime DEFAULT NULL,
      `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'update_time',
      PRIMARY KEY (`id`)
      ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
      insert into t_user_black_list values (1, 'test invalid datetime', '2022-09-31 13:56:57', now());

      error log:
      org.apache.kafka.connect.errors.ConnectException: An exception occurred in the change event producer. This connector will be stopped.
      at io.debezium.pipeline.ErrorHandler.setProducerThrowable(ErrorHandler.java:50)
      at io.debezium.connector.mysql.MySqlStreamingChangeEventSource$ReaderThreadLifecycleListener.onEventDeserializationFailure(MySqlStreamingChangeEventSource.java:1241)
      at com.github.shyiko.mysql.binlog.BinaryLogClient.listenForEventPackets(BinaryLogClient.java:970)
      at com.github.shyiko.mysql.binlog.BinaryLogClient.connect(BinaryLogClient.java:599)
      at com.github.shyiko.mysql.binlog.BinaryLogClient$7.run(BinaryLogClient.java:857)
      at java.base/java.lang.Thread.run(Thread.java:830)
      Caused by: io.debezium.DebeziumException: Invalid date 'SEPTEMBER 31'
      at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.wrap(MySqlStreamingChangeEventSource.java:1188)
      ... 5 more
      Caused by: java.time.DateTimeException: Invalid date 'SEPTEMBER 31'
      at java.base/java.time.LocalDate.create(LocalDate.java:459)
      at java.base/java.time.LocalDate.of(LocalDate.java:271)
      at java.base/java.time.LocalDateTime.of(LocalDateTime.java:361)
      at io.debezium.connector.mysql.RowDeserializers.deserializeDatetimeV2(RowDeserializers.java:419)
      at io.debezium.connector.mysql.RowDeserializers$WriteRowsDeserializer.deserializeDatetimeV2(RowDeserializers.java:207)
      at com.github.shyiko.mysql.binlog.event.deserialization.AbstractRowsEventDataDeserializer.deserializeCell(AbstractRowsEventDataDeserializer.java:183)
      at com.github.shyiko.mysql.binlog.event.deserialization.AbstractRowsEventDataDeserializer.deserializeRow(AbstractRowsEventDataDeserializer.java:143)
      at com.github.shyiko.mysql.binlog.event.deserialization.WriteRowsEventDataDeserializer.deserializeRows(WriteRowsEventDataDeserializer.java:64)
      at com.github.shyiko.mysql.binlog.event.deserialization.WriteRowsEventDataDeserializer.deserialize(WriteRowsEventDataDeserializer.java:56)
      at com.github.shyiko.mysql.binlog.event.deserialization.WriteRowsEventDataDeserializer.deserialize(WriteRowsEventDataDeserializer.java:32)
      at com.github.shyiko.mysql.binlog.event.deserialization.EventDeserializer.deserializeEventData(EventDeserializer.java:303)
      at com.github.shyiko.mysql.binlog.event.deserialization.EventDeserializer.nextEvent(EventDeserializer.java:232)
      at io.debezium.connector.mysql.MySqlStreamingChangeEventSource$1.nextEvent(MySqlStreamingChangeEventSource.java:230)
      at com.github.shyiko.mysql.binlog.BinaryLogClient.listenForEventPackets(BinaryLogClient.java:953)
      ... 3 more

              Unassigned Unassigned
              ywyuewei Harvey Yue (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: