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

MySQL connector throw an exception when captured create an index event with table no primary key

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Critical Critical
    • None
    • 0.9.5.Final
    • mysql-connector
    • None
    • Hide

      Following by the tutorials at debezium-examples, there are step:

      export DEBEZIUM_VERSION=0.9
      docker-compose -f docker-compose-mysql.yaml up -d
      
      # Start MySQL connector
      curl -i -X POST -H "Accept:application/json" -H  "Content-Type:application/json" http://localhost:8083/connectors/ -d @register-mysql.json
       
      # Modify records in the database via MySQL client
      docker-compose -f docker-compose-mysql.yaml exec mysql bash -c 'mysql -u $MYSQL_USER -p$MYSQL_PASSWORD inventory'
      
      
      create table dummy (id int not null, title varchar(15) not null);
      create unique index dummy_unq_idx on dummy (id);
      
      # Show log connect to view exception:
      docker-compose -f docker-compose-mysql.yaml logs connect
      

      At 0.9 the connector will throw an exception at description.

      Show
      Following by the tutorials at debezium-examples , there are step: export DEBEZIUM_VERSION=0.9 docker-compose -f docker-compose-mysql.yaml up -d # Start MySQL connector curl -i -X POST -H "Accept:application/json" -H "Content-Type:application/json" http: //localhost:8083/connectors/ -d @register-mysql.json # Modify records in the database via MySQL client docker-compose -f docker-compose-mysql.yaml exec mysql bash -c 'mysql -u $MYSQL_USER -p$MYSQL_PASSWORD inventory' create table dummy (id int not null , title varchar(15) not null ); create unique index dummy_unq_idx on dummy (id); # Show log connect to view exception: docker-compose -f docker-compose-mysql.yaml logs connect At 0.9 the connector will throw an exception at description.

      An java.lang.NullPointerException will throw when capture an event create index with table no primary key:

      onnect_1    | 2019-05-10 08:30:20,156 ERROR  MySQL|dbserver1|binlog  Error during binlog processing. Last offset stored = {ts_sec=1557477012, file=mysql-bin.000003, pos=367, server_id=223344}, binlog reader near position = mysql-bin.000003/432   [io.debezium.connector.mysql.BinlogReader]
      connect_1    | 2019-05-10 08:30:20,156 ERROR  MySQL|dbserver1|binlog  Failed due to error: Error processingbinlog event   [io.debezium.connector.mysql.BinlogReader]
      connect_1    | org.apache.kafka.connect.errors.ConnectException
      connect_1    |  at io.debezium.connector.mysql.AbstractReader.wrap(AbstractReader.java:230)
      connect_1    |  at io.debezium.connector.mysql.AbstractReader.failed(AbstractReader.java:208)
      connect_1    |  at io.debezium.connector.mysql.BinlogReader.handleEvent(BinlogReader.java:508)
      connect_1    |  at com.github.shyiko.mysql.binlog.BinaryLogClient.notifyEventListeners(BinaryLogClient.java:1095)
      connect_1    |  at com.github.shyiko.mysql.binlog.BinaryLogClient.listenForEventPackets(BinaryLogClient.java:943)
      connect_1    |  at com.github.shyiko.mysql.binlog.BinaryLogClient.connect(BinaryLogClient.java:580)
      connect_1    |  at com.github.shyiko.mysql.binlog.BinaryLogClient$7.run(BinaryLogClient.java:825)
      connect_1    |  at java.lang.Thread.run(Thread.java:748)
      connect_1    | Caused by: java.lang.NullPointerException
      connect_1    |  at io.debezium.relational.ddl.DdlChanges.getDatabase(DdlChanges.java:128)
      connect_1    |  at io.debezium.relational.ddl.DdlChanges.handle(DdlChanges.java:57)
      connect_1    |  at io.debezium.relational.ddl.AbstractDdlParser.signalChangeEvent(AbstractDdlParser.java:124)
      connect_1    |  at io.debezium.relational.ddl.AbstractDdlParser.signalCreateIndex(AbstractDdlParser.java:243)
      connect_1    |  at io.debezium.antlr.AntlrDdlParser.signalCreateIndex(AntlrDdlParser.java:316)
      connect_1    |  at io.debezium.connector.mysql.antlr.listener.CreateUniqueIndexParserListener.enterCreateIndex(CreateUniqueIndexParserListener.java:40)
      connect_1    |  at io.debezium.ddl.parser.mysql.generated.MySqlParser$CreateIndexContext.enterRule(MySqlParser.java:2905)
      connect_1    |  at io.debezium.antlr.ProxyParseTreeListenerUtil.delegateEnterRule(ProxyParseTreeListenerUtil.java:46)
      connect_1    |  at io.debezium.connector.mysql.antlr.listener.MySqlAntlrDdlParserListener.enterEveryRule(MySqlAntlrDdlParserListener.java:89)
      connect_1    |  at org.antlr.v4.runtime.tree.ParseTreeWalker.enterRule(ParseTreeWalker.java:41)
      connect_1    |  at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:25)
      connect_1    |  at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:28)
      connect_1    |  at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:28)
      connect_1    |  at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:28)
      connect_1    |  at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:28)
      connect_1    |  at io.debezium.antlr.AntlrDdlParser.parse(AntlrDdlParser.java:85)
      connect_1    |  at io.debezium.connector.mysql.MySqlSchema.applyDdl(MySqlSchema.java:307)
      connect_1    |  at io.debezium.connector.mysql.BinlogReader.handleQueryEvent(BinlogReader.java:694)
      connect_1    |  at io.debezium.connector.mysql.BinlogReader.handleEvent(BinlogReader.java:492)
      connect_1    |  ... 5 more
      connect_1    | 2019-05-10 08:30:20,157 INFO   MySQL|dbserver1|binlog  Error processing binlog event, and propagating to Kafka Connect so it stops this connector. Future binlog events read before connector is shutdown will be ignored.   [io.debezium.connector.mysql.BinlogReader]
      

              Unassigned Unassigned
              hongphu8790 NGUYEN HONG PHU (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: