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

MySQL connector stops working with a NullPointerException error

    Details

      Description

      After moving from debezium 0.8.3 Final to 0.9.4 Final I received the following error and the connector stopped processing the events:

      [2019-04-19 15:25:16,828] ERROR Unexpected exception while processing record 'ConsumerRecord(topic = dbhistory.prd01, partition = 0, leaderEpoch = 0, offset = 13772, CreateTime = 1554756709527, serialized key size = -1, serialized value size = 342, headers = RecordHeaders(headers = [], isReadOnly = false), key = null, value = {
        "source" : {
          "server" : "prd01"
        },
        "position" : {
          "ts_sec" : 1554752340,
          "file" : "mysql-bin-changelog.004487",
          "pos" : 35055502,
          "server_id" : 241308800,
          "event" : 1
        },
        "databaseName" : "REMOVED",
        "ddl" : "CREATE UNIQUE INDEX `unique_data_migrations` USING btree ON `data_migrations` (`version`)"
      })' (io.debezium.relational.history.KafkaDatabaseHistory)
      java.lang.NullPointerException
      	at io.debezium.relational.ddl.DdlChanges.getDatabase(DdlChanges.java:128)
      	at io.debezium.relational.ddl.DdlChanges.handle(DdlChanges.java:57)
      	at io.debezium.relational.ddl.AbstractDdlParser.signalChangeEvent(AbstractDdlParser.java:124)
      	at io.debezium.relational.ddl.AbstractDdlParser.signalCreateIndex(AbstractDdlParser.java:243)
      	at io.debezium.antlr.AntlrDdlParser.signalCreateIndex(AntlrDdlParser.java:316)
      	at io.debezium.connector.mysql.antlr.listener.CreateUniqueIndexParserListener.enterCreateIndex(CreateUniqueIndexParserListener.java:40)
      	at io.debezium.ddl.parser.mysql.generated.MySqlParser$CreateIndexContext.enterRule(MySqlParser.java:2903)
      	at io.debezium.antlr.ProxyParseTreeListenerUtil.delegateEnterRule(ProxyParseTreeListenerUtil.java:46)
      	at io.debezium.connector.mysql.antlr.listener.MySqlAntlrDdlParserListener.enterEveryRule(MySqlAntlrDdlParserListener.java:89)
      	at org.antlr.v4.runtime.tree.ParseTreeWalker.enterRule(ParseTreeWalker.java:41)
      	at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:25)
      	at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:28)
      	at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:28)
      	at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:28)
      	at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:28)
      	at io.debezium.antlr.AntlrDdlParser.parse(AntlrDdlParser.java:85)
      	at io.debezium.relational.history.AbstractDatabaseHistory.lambda$recover$1(AbstractDatabaseHistory.java:104)
      	at io.debezium.relational.history.KafkaDatabaseHistory.recoverRecords(KafkaDatabaseHistory.java:240)
      	at io.debezium.relational.history.AbstractDatabaseHistory.recover(AbstractDatabaseHistory.java:73)
      	at io.debezium.connector.mysql.MySqlSchema.loadHistory(MySqlSchema.java:252)
      	at io.debezium.connector.mysql.MySqlTaskContext.loadHistory(MySqlTaskContext.java:165)
      	at io.debezium.connector.mysql.MySqlConnectorTask.start(MySqlConnectorTask.java:105)
      	at io.debezium.connector.common.BaseSourceTask.start(BaseSourceTask.java:49)
      	at org.apache.kafka.connect.runtime.WorkerSourceTask.execute(WorkerSourceTask.java:199)
      	at org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:175)
      	at org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:219)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at java.lang.Thread.run(Thread.java:748)
      [2019-04-19 15:25:16,829] INFO [Consumer clientId=mysql-source-connector-dbhistory, groupId=mysql-source-connector-dbhistory] Member mysql-source-connector-dbhistory-6c630f47-9242-4cf1-b5a0-311df6521d14 sending LeaveGroup request to coordinator 10.149.103.80:9092 (id: 2147483646 rack: null) (org.apache.kafka.clients.consumer.internals.AbstractCoordinator)
      
      

      After getting this error, I switched back to 0.8.3 again and that version processed the event without any problem.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  jpechanec Jiri Pechanec
                  Reporter:
                  tamas.szasz Tamas Szasz
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: