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

Mysql: Getting ERROR `Failed due to error: connect.errors.ConnectException: For input string: "false"`

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Done
    • 1.4.2.Final, 1.5.GA, 1.6.4.Final, 1.7.GA, 1.8.1.Final
    • 1.9.0.CR1
    • mysql-connector
    • None
    • Hide

      Run next statement:

      CREATE TABLE TestTable (
        TestColumn1 INT(1) NOT NULL 
      );
      
      ALTER TABLE Test ADD COLUMN TestColumn BIGINT DEFAULT false;
      
      Show
      Run next statement: CREATE TABLE TestTable ( TestColumn1 INT (1) NOT NULL ); ALTER TABLE Test ADD COLUMN TestColumn BIGINT DEFAULT false ;

    Description

      I was running a MySQL connector, the connector stops working after throwing the below error:

      org.apache.kafka.connect.errors.ConnectException: For input string: "false"
      	at io.debezium.connector.mysql.AbstractReader.wrap(AbstractReader.java:241)
      	at io.debezium.connector.mysql.AbstractReader.failed(AbstractReader.java:218)
      	at io.debezium.connector.mysql.BinlogReader.handleEvent(BinlogReader.java:607)
      	at com.github.shyiko.mysql.binlog.BinaryLogClient.notifyEventListeners(BinaryLogClient.java:1104)
      	at com.github.shyiko.mysql.binlog.BinaryLogClient.listenForEventPackets(BinaryLogClient.java:955)
      	at com.github.shyiko.mysql.binlog.BinaryLogClient.connect(BinaryLogClient.java:595)
      	at com.github.shyiko.mysql.binlog.BinaryLogClient$7.run(BinaryLogClient.java:839)
      	at java.base/java.lang.Thread.run(Thread.java:834)
      Caused by: java.lang.NumberFormatException: For input string: "false"
      	at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
      	at java.base/java.lang.Long.parseLong(Long.java:692)
      	at java.base/java.lang.Long.valueOf(Long.java:1144)
      	at io.debezium.jdbc.JdbcValueConverters.lambda$convertBigInt$42(JdbcValueConverters.java:919)
      	at io.debezium.jdbc.JdbcValueConverters.convertValue(JdbcValueConverters.java:1287)
      	at io.debezium.jdbc.JdbcValueConverters.convertBigInt(JdbcValueConverters.java:907)
      	at io.debezium.jdbc.JdbcValueConverters.lambda$converter$6(JdbcValueConverters.java:297)
      	at io.debezium.connector.mysql.MySqlDefaultValueConverter.setColumnDefaultValue(MySqlDefaultValueConverter.java:405)
      	at io.debezium.connector.mysql.antlr.listener.DefaultValueParserListener.convertDefaultValueToSchemaType(DefaultValueParserListener.java:104)
      	at io.debezium.connector.mysql.antlr.listener.DefaultValueParserListener.convertDefaultValue(DefaultValueParserListener.java:93)
      	at io.debezium.connector.mysql.antlr.listener.ColumnDefinitionParserListener.exitColumnDefinition(ColumnDefinitionParserListener.java:100)
      	at io.debezium.ddl.parser.mysql.generated.MySqlParser$ColumnDefinitionContext.exitRule(MySqlParser.java:8122)
      	at io.debezium.antlr.ProxyParseTreeListenerUtil.delegateExitRule(ProxyParseTreeListenerUtil.java:64)
      	at io.debezium.connector.mysql.antlr.listener.MySqlAntlrDdlParserListener.exitEveryRule(MySqlAntlrDdlParserListener.java:106)
      	at org.antlr.v4.runtime.tree.ParseTreeWalker.exitRule(ParseTreeWalker.java:48)
      	at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:30)
      	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 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.connector.mysql.MySqlSchema.applyDdl(MySqlSchema.java:326)
      	at io.debezium.connector.mysql.BinlogReader.handleQueryEvent(BinlogReader.java:810)
      	at io.debezium.connector.mysql.BinlogReader.handleEvent(BinlogReader.java:590)

      This is the configuration of my task:

      curl -i -X POST -H "Accept:application/json" -H  "Content-Type:application/json" http://localhost:8084/connectors/ \
          -d '{
            "name": "mysql-connector",
            "config": {
                  "connector.class": "io.debezium.connector.mysql.MySqlConnector",
                  "database.hostname": "",
                  "database.port": "",
                  "database.user": "",
                  "database.password": "",
                  "database.server.id": "",
                  "database.server.name": "tran",
                  "database.whitelist": "db", "table.whitelist":"db.dummy",
                  "database.history.kafka.bootstrap.servers": "localhost:9092",
                  "database.history.kafka.topic": "dbhistory.dummy"
             }
          }'
      

      The query which was causing the issue:

      ALTER TABLE `USER` ADD USER_ID BIGINT DEFAULT false NULL, ADD PRODUCT_ID INT DEFAULT false NULL;

      The incorrect DDL parsed from the binlog breaks the connector

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              okocha_10 Zhongming Huang (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: