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

NullPointerException while processing binlog event

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Major
    • None
    • 1.9.0.Final
    • core-library
    • None
    • False
    • None
    • False
    • Hide

      Create a mysql connector with `read.only` mode turned on and GTID's enabled. 

      Execute the following GRANT query to any user

      GRANT SELECT ON `db`.`table` TO 'user' 

       

      Show
      Create a mysql connector with `read.only` mode turned on and GTID's enabled.  Execute the following GRANT query to any user GRANT SELECT ON `db`.`table` TO 'user'  

    Description

      When processing a binlog event while in `read.only` mode with GTID's enabled the  `AbstractIncrementalSnapshotChangeEventSource.processSchemaChange` throws a NullPointerException when the event doesn't contain a `TableId`.

      io.debezium.DebeziumException: Error processing binlog event
      	at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.handleEvent(MySqlStreamingChangeEventSource.java:369)
      	at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.lambda$execute$25(MySqlStreamingChangeEventSource.java:869)
      	at com.github.shyiko.mysql.binlog.BinaryLogClient.notifyEventListeners(BinaryLogClient.java:1125)
      	at com.github.shyiko.mysql.binlog.BinaryLogClient.listenForEventPackets(BinaryLogClient.java:973)
      	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:829)
      Caused by: java.lang.NullPointerException
      	at io.debezium.pipeline.source.snapshot.incremental.AbstractIncrementalSnapshotChangeEventSource.processSchemaChange(AbstractIncrementalSnapshotChangeEventSource.java:105)
      	at io.debezium.pipeline.EventDispatcher.dispatchSchemaChangeEvent(EventDispatcher.java:312)
      	at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.handleQueryEvent(MySqlStreamingChangeEventSource.java:575)
      	at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.lambda$execute$14(MySqlStreamingChangeEventSource.java:841)
      	at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.handleEvent(MySqlStreamingChangeEventSource.java:349)
      	... 6 more 

      Implementation ideas (optional)

      I see two possibilities of fixing the issue.
      Add a null check on the `dataCollectionId` parameter on the `processSchemaChange` method inside `AbstractIncrementalSnapshotChangeEventSource`

      or 

      Add GRANT query to the DDL Filter set `internal.database.history.ddl.filter`

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              larswerkman Lars Werkman (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: