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

Invalid length when read MySQL DATE value

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Major
    • None
    • 1.6.0.Final
    • None
    • False
    • False
    • Undefined
    • Hide

      DB version: AWS RDS MariaDB 10.2.32

      Here is the connector config:

      database.hostname: 
      "production.eu-west-1.rds.amazonaws.com" database.port: "3306" 
      database.user: 
      "${file:/opt/kafka/external-configuration/connector-config/debezium-mysql-credentials.properties:mysql_username}"
       database.password: 
      "${file:/opt/kafka/external-configuration/connector-config/debezium-mysql-credentials.properties:mysql_password}"
       database.server.id: "184054" database.server.name: 
      "production-internal-dev" database.whitelist: "digifit" 
      table.include.list: 
      "digifit.fit_vg_yl_club_membership,digifit.fit_vg_yl_membership" 
      database.history.kafka.bootstrap.servers: 
      "server-msk.eu-west-1.amazonaws.com:9092" database.history.kafka.topic: 
      "schema-changes.digifit_tables_membership" include.schema.changes: 
      "true" key.converter: "io.confluent.connect.avro.AvroConverter" 
      key.converter.schema.registry.url: 
      "http://cp-schema-registry.kafka:8081" value.converter: 
      "io.confluent.connect.avro.AvroConverter" 
      value.converter.schema.registry.url: 
      "http://cp-schema-registry.kafka:8081" snapshot.lock.timeout.ms: 
      "10000000" heartbeat.interval.ms: "100" min.}}{{}}
      

      DDL of the table:

      {{"databaseName" : "digifit",
        "ddl" : "CREATE TABLE}}fit_vg_yl_club_membership{{(\n}}id{{int(11) NOT NULL AUTO_INCREMENT,\n}}club_id{{int(11) NOT NULL,\n}}membership_name{{varchar(150) COLLATE utf8_unicode_ci NOT NULL,\n}}membership_group{{varchar(50) COLLATE utf8_unicode_ci NOT NULL,\n}}membership_notes{{text COLLATE utf8_unicode_ci NOT NULL,\n}}membership_is_pro{{tinyint(1) NOT NULL DEFAULT 0,\n}}membership_availability_start{{date DEFAULT NULL COMMENT 'if NULL no availability restrictions',\n}}membership_availability_end{{date DEFAULT NULL COMMENT 'if NULL no availability restrictions',\n}}membership_available_online{{tinyint(1) NOT NULL,\n}}membership_duration{{int(11) NOT NULL,\n}}membership_duration_type{{varchar(50) COLLATE utf8_unicode_ci NOT NULL,\n}}membership_auto_renew{{tinyint(1) NOT NULL DEFAULT 0,\n}}membership_pro_rata_start{{tinyint(1) NOT NULL DEFAULT 1,\n}}membership_renew_duration{{int(11) DEFAULT NULL COMMENT 'if NULL, no autorenew',\n}}membership_renew_term{{varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'if NULL, no autorenew',\n}}membership_renew_before{{int(11) DEFAULT NULL COMMENT 'if NULL, no autorenew',\n}}membership_renew_before_term{{varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'if NULL, no autorenew',\n}}membership_renew_price{{decimal(13,2) NOT NULL DEFAULT 0.00,\n}}membership_price{{decimal(13,2) NOT NULL,\n}}membership_price_term{{varchar(50) COLLATE utf8_unicode_ci NOT NULL,\n}}membership_income_category{{varchar(50) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'memberships',\n}}membership_free_period{{int(11) DEFAULT NULL,\n}}membership_free_period_term{{varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,\n}}membership_club_tax_id{{int(11) NOT NULL,\n}}membership_billing_cycle{{varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'NULL if membership_duration_type = uses,visits or treatments',\n}}membership_registration_fee{{decimal(8,2) DEFAULT NULL COMMENT 'if NULL, no registration fee',\n}}membership_registration_club_tax_id{{int(11) NOT NULL COMMENT 'tax id for the registration fee',\n}}default_payment_method{{varchar(100) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',\n}}tmp_default_payment_method{{varchar(100) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',\n}}membership_allow_employee_discount{{tinyint(1) NOT NULL DEFAULT 0,\n}}membership_creation_date{{date NOT NULL,\n}}membership_invoice_creation_term{{varchar(16) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'Next invoice will be created before billing cycle:',\n}}membership_last_edit_date{{date DEFAULT NULL,\n}}timestamp_edit{{bigint(20) NOT NULL DEFAULT 0 COMMENT 'milliseconds',\n}}product_avatar{{varchar(63) COLLATE utf8_unicode_ci DEFAULT NULL,\n  PRIMARY KEY (}}id{{),\n  KEY}}club_id{{(}}club_id{{),\n  KEY}}club_tmp_default_payment_method_idx{{(}}club_id{{,}}tmp_default_payment_method{{)\n) ENGINE=InnoDB AUTO_INCREMENT=186766 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci",
        "tableChanges" : [ \{
          "type" : "CREATE",
          "id" : "\"digifit\".\"fit_vg_yl_club_membership\"",
          "table" : {
            "defaultCharsetName" : "utf8",
            "primaryKeyColumnNames" : [ "id" ],
            "columns" : [ {
              "name" : "id",
              "jdbcType" : 4,
              "typeName" : "INT",
              "typeExpression" : "INT",
              "charsetName" : null,
              "length" : 11,
              "position" : 1,
              "optional" : false,
              "autoIncremented" : true,
              "generated" : true
            }, \{
              "name" : "club_id",
              "jdbcType" : 4,
              "typeName" : "INT",
              "typeExpression" : "INT",
              "charsetName" : null,
              "length" : 11,
              "position" : 2,
              "optional" : false,
              "autoIncremented" : false,
              "generated" : false
            }, \{
              "name" : "membership_name",
              "jdbcType" : 12,
              "typeName" : "VARCHAR",
              "typeExpression" : "VARCHAR",
              "charsetName" : "utf8",
              "length" : 150,
              "position" : 3,
              "optional" : false,
              "autoIncremented" : false,
              "generated" : false
            }, {}}
      
      Show
      DB version: AWS RDS MariaDB 10.2.32 Here is the connector config: database.hostname: "production.eu-west-1.rds.amazonaws.com" database.port: "3306" database.user: "${file:/opt/kafka/external-configuration/connector-config/debezium-mysql-credentials.properties:mysql_username}" database.password: "${file:/opt/kafka/external-configuration/connector-config/debezium-mysql-credentials.properties:mysql_password}" database.server.id: "184054" database.server.name: "production-internal-dev" database.whitelist: "digifit" table.include.list: "digifit.fit_vg_yl_club_membership,digifit.fit_vg_yl_membership" database.history.kafka.bootstrap.servers: "server-msk.eu-west-1.amazonaws.com:9092" database.history.kafka.topic: "schema-changes.digifit_tables_membership" include.schema.changes: "true" key.converter: "io.confluent.connect.avro.AvroConverter" key.converter.schema.registry.url: "http://cp-schema-registry.kafka:8081" value.converter: "io.confluent.connect.avro.AvroConverter" value.converter.schema.registry.url: "http://cp-schema-registry.kafka:8081" snapshot.lock.timeout.ms: "10000000" heartbeat.interval.ms: "100" min.}}{{}} DDL of the table: {{"databaseName" : "digifit", "ddl" : "CREATE TABLE}}fit_vg_yl_club_membership{{(\n}}id{{int(11) NOT NULL AUTO_INCREMENT,\n}}club_id{{int(11) NOT NULL,\n}}membership_name{{varchar(150) COLLATE utf8_unicode_ci NOT NULL,\n}}membership_group{{varchar(50) COLLATE utf8_unicode_ci NOT NULL,\n}}membership_notes{{text COLLATE utf8_unicode_ci NOT NULL,\n}}membership_is_pro{{tinyint(1) NOT NULL DEFAULT 0,\n}}membership_availability_start{{date DEFAULT NULL COMMENT 'if NULL no availability restrictions',\n}}membership_availability_end{{date DEFAULT NULL COMMENT 'if NULL no availability restrictions',\n}}membership_available_online{{tinyint(1) NOT NULL,\n}}membership_duration{{int(11) NOT NULL,\n}}membership_duration_type{{varchar(50) COLLATE utf8_unicode_ci NOT NULL,\n}}membership_auto_renew{{tinyint(1) NOT NULL DEFAULT 0,\n}}membership_pro_rata_start{{tinyint(1) NOT NULL DEFAULT 1,\n}}membership_renew_duration{{int(11) DEFAULT NULL COMMENT 'if NULL, no autorenew',\n}}membership_renew_term{{varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'if NULL, no autorenew',\n}}membership_renew_before{{int(11) DEFAULT NULL COMMENT 'if NULL, no autorenew',\n}}membership_renew_before_term{{varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'if NULL, no autorenew',\n}}membership_renew_price{{decimal(13,2) NOT NULL DEFAULT 0.00,\n}}membership_price{{decimal(13,2) NOT NULL,\n}}membership_price_term{{varchar(50) COLLATE utf8_unicode_ci NOT NULL,\n}}membership_income_category{{varchar(50) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'memberships',\n}}membership_free_period{{int(11) DEFAULT NULL,\n}}membership_free_period_term{{varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,\n}}membership_club_tax_id{{int(11) NOT NULL,\n}}membership_billing_cycle{{varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'NULL if membership_duration_type = uses,visits or treatments',\n}}membership_registration_fee{{decimal(8,2) DEFAULT NULL COMMENT 'if NULL, no registration fee',\n}}membership_registration_club_tax_id{{int(11) NOT NULL COMMENT 'tax id for the registration fee',\n}}default_payment_method{{varchar(100) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',\n}}tmp_default_payment_method{{varchar(100) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',\n}}membership_allow_employee_discount{{tinyint(1) NOT NULL DEFAULT 0,\n}}membership_creation_date{{date NOT NULL,\n}}membership_invoice_creation_term{{varchar(16) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'Next invoice will be created before billing cycle:',\n}}membership_last_edit_date{{date DEFAULT NULL,\n}}timestamp_edit{{bigint(20) NOT NULL DEFAULT 0 COMMENT 'milliseconds',\n}}product_avatar{{varchar(63) COLLATE utf8_unicode_ci DEFAULT NULL,\n PRIMARY KEY (}}id{{),\n KEY}}club_id{{(}}club_id{{),\n KEY}}club_tmp_default_payment_method_idx{{(}}club_id{{,}}tmp_default_payment_method{{)\n) ENGINE=InnoDB AUTO_INCREMENT=186766 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci", "tableChanges" : [ \{ "type" : "CREATE", "id" : "\"digifit\".\"fit_vg_yl_club_membership\"", "table" : { "defaultCharsetName" : "utf8", "primaryKeyColumnNames" : [ "id" ], "columns" : [ { "name" : "id", "jdbcType" : 4, "typeName" : "INT", "typeExpression" : "INT", "charsetName" : null, "length" : 11, "position" : 1, "optional" : false, "autoIncremented" : true, "generated" : true }, \{ "name" : "club_id", "jdbcType" : 4, "typeName" : "INT", "typeExpression" : "INT", "charsetName" : null, "length" : 11, "position" : 2, "optional" : false, "autoIncremented" : false, "generated" : false }, \{ "name" : "membership_name", "jdbcType" : 12, "typeName" : "VARCHAR", "typeExpression" : "VARCHAR", "charsetName" : "utf8", "length" : 150, "position" : 3, "optional" : false, "autoIncremented" : false, "generated" : false }, {}}

    Description

      I have a task where I try to synchronize 2 tables but unfortunately I am getting the below exception. If I try with other tables from the same database I don't have any issues.

       

       

      {{Trace: 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:42)
      at
      io.debezium.pipeline.ChangeEventSourceCoordinator.lambda$start$0(ChangeEventSourceCoordinator.java:130)
      at
      java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
      at
      java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
      at
      java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
      at
      java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
      at java.base/java.lang.Thread.run(Thread.java:829)
      Caused by: io.debezium.DebeziumException: java.lang.RuntimeException:
      Invalid length when read MySQL DATE value. BIN_LEN_DATE is 0
      at
      io.debezium.pipeline.source.AbstractSnapshotChangeEventSource.execute(AbstractSnapshotChangeEventSource.java:78)
      at
      io.debezium.pipeline.ChangeEventSourceCoordinator.lambda$start$0(ChangeEventSourceCoordinator.java:113)
      ... 5 more
      Caused by: java.lang.RuntimeException: Invalid length when read MySQL
      DATE value. BIN_LEN_DATE is 0
      at
      io.debezium.connector.mysql.MysqlBinaryProtocolFieldReader.readDateField(MysqlBinaryProtocolFieldReader.java:63)
      at
      io.debezium.connector.mysql.AbstractMysqlFieldReader.readField(AbstractMysqlFieldReader.java:33)
      at
      io.debezium.connector.mysql.MySqlConnection.getColumnValue(MySqlConnection.java:571)
      at
      io.debezium.jdbc.JdbcConnection.rowToArray(JdbcConnection.java:1470)
      at
      io.debezium.relational.RelationalSnapshotChangeEventSource.createDataEventsForTable(RelationalSnapshotChangeEventSource.java:355)
      at
      io.debezium.relational.RelationalSnapshotChangeEventSource.createDataEvents(RelationalSnapshotChangeEventSource.java:306)
      at
      io.debezium.relational.RelationalSnapshotChangeEventSource.doExecute(RelationalSnapshotChangeEventSource.java:136)
      at
      io.debezium.pipeline.source.AbstractSnapshotChangeEventSource.execute(AbstractSnapshotChangeEventSource.java:69)}}

      {{}}

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              bgergovski Borislav Gergovski (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: