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

Informix-Connector breaks on table with numerical default value

XMLWordPrintable

    • False
    • None
    • False
    • Critical
    • Customer Reported

      In order to make your issue reports as actionable as possible, please provide the following information, depending on the issue type.

      Bug report

      What Debezium connector do you use and what version?

      Informix-Connector

      What is the connector configuration?

      1. Setup podman-pod
        podman pod create --name=dbz --publish "9092:9092,9088:9088,8083:8083"
      2. Start zookeeper:
        podman run -it --rm --name zookeeper --pod dbz quay.io/debezium/zookeeper:2.5
      3. Start kafka:
        podman run -it --rm --name kafka --pod dbz quay.io/debezium/kafka:2.5
      4. Setup connect:
        • podman run -it --rm --name connect --pod dbz -e GROUP_ID=1 -e CONFIG_STORAGE_TOPIC=my_connect_configs -e OFFSET_STORAGE_TOPIC=my_connect_offsets -e STATUS_STORAGE_TOPIC=my_connect_statuses -v ./debezium-connector-informix:/kafka/connect/debezium-connector-informix quay.io/debezium/connect:2.5
        • assume that debezium-connector-informix-folder contains the debezium-informix-connector-jars, as well as the informix jdbc-driver and the ifx-changestream-client
      5. Setup informix-container:
        • Dockerfile
          FROM icr.io/informix/informix-developer-database:14.10.FC9W1DE
          
          ADD --chown=informix:informix informix_post_init.sh /opt/ibm/config
          ADD --chown=informix:informix testdb.sql /opt/ibm/informix/etc
          
          ENV SIZE small
          ENV LICENSE accept
          ENV RUN_FILE_POST_INIT informix_post_init.sh
          
        • informix_post_init.sh
          #!/bin/bash
          
          dbaccess < $INFORMIXDIR/etc/syscdcv1.sql
          dbaccess < $INFORMIXDIR/etc/testdb.sql
          
        • testdb.sql
          set lock mode to wait;
          create database testdb with log;
          
          create table demo(
              id SERIAL NOT NULL,
              name VARCHAR(255) NULL,
              version INTEGER DEFAULT 1 NOT NULL,
              PRIMARY KEY (id) CONSTRAINT pk_demo
          );
          
        • Build the testcontainer:
          podman build --rm -t ifx-dbz-demo .
      6. Run the informix-container:
        podman run -it --rm --name ifx-dbz-demo --pod dbz ifx-dbz-demo
      7. Register the connector:
        POST http://localhost:8083/connectors HTTP/1.1
        Content-Type: application/json
        Accept: application/json
        
        {
          "name": "demo-connector",
          "config": {
            "connector.class": "io.debezium.connector.informix.InformixConnector",
            "database.hostname": "ifx-dbz-demo",
            "database.port": "9088",
            "database.user": "informix",
            "database.password": "in4mix",
            "database.dbname": "testdb",
            "topic.prefix": "ifx.demo",
            "schema.history.internal.kafka.topic": "ifx.demo.history",
            "schema.history.internal.kafka.bootstrap.servers": "0.0.0.0:9092"
          }
        }
        

      What is the captured database version and mode of depoyment?

      Setup in docker/podman with the informix-developer-database-image.

      What behaviour do you expect?

      After registering the connector the schema for the table demo is built and changes to the table are reflected in the corresponding kafka-topic.

      What behaviour do you see?

      Initialization cancels with an exception:

      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:67)
              at io.debezium.pipeline.ChangeEventSourceCoordinator.lambda$start$0(ChangeEventSourceCoordinator.java:144)
              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: io.debezium.DebeziumException: io.debezium.DebeziumException: Failed to set field default value for 'testdb.informix.second.version' of type integer, the default value is 1 of type class java.lang.String
              at io.debezium.pipeline.source.AbstractSnapshotChangeEventSource.execute(AbstractSnapshotChangeEventSource.java:101)
              at io.debezium.pipeline.ChangeEventSourceCoordinator.doSnapshot(ChangeEventSourceCoordinator.java:253)
              at io.debezium.pipeline.ChangeEventSourceCoordinator.doSnapshot(ChangeEventSourceCoordinator.java:237)
              at io.debezium.pipeline.ChangeEventSourceCoordinator.executeChangeEventSources(ChangeEventSourceCoordinator.java:189)
              at io.debezium.pipeline.ChangeEventSourceCoordinator.lambda$start$0(ChangeEventSourceCoordinator.java:137)
              ... 5 more
      Caused by: io.debezium.DebeziumException: io.debezium.DebeziumException: Failed to set field default value for 'testdb.informix.second.version' of type integer, the default value is 1 of type class java.lang.String
              at io.debezium.relational.RelationalSnapshotChangeEventSource.lambda$createSchemaChangeEventsForTables$3(RelationalSnapshotChangeEventSource.java:387)
              at io.debezium.pipeline.EventDispatcher.dispatchSchemaChangeEvent(EventDispatcher.java:379)
              at io.debezium.relational.RelationalSnapshotChangeEventSource.createSchemaChangeEventsForTables(RelationalSnapshotChangeEventSource.java:382)
              at io.debezium.relational.RelationalSnapshotChangeEventSource.doExecute(RelationalSnapshotChangeEventSource.java:154)
              at io.debezium.pipeline.source.AbstractSnapshotChangeEventSource.execute(AbstractSnapshotChangeEventSource.java:92)
              ... 9 more
      Caused by: io.debezium.DebeziumException: Failed to set field default value for 'testdb.informix.second.version' of type integer, the default value is 1 of type class java.lang.String
              at io.debezium.relational.TableSchemaBuilder.addField(TableSchemaBuilder.java:411)
              at io.debezium.relational.TableSchemaBuilder.lambda$create$2(TableSchemaBuilder.java:149)
              at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
              at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
              at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1655)
              at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
              at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
              at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
              at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
              at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
              at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
              at io.debezium.relational.TableSchemaBuilder.create(TableSchemaBuilder.java:147)
              at io.debezium.relational.RelationalDatabaseSchema.buildAndRegisterSchema(RelationalDatabaseSchema.java:122)
              at io.debezium.connector.informix.InformixDatabaseSchema.applySchemaChange(InformixDatabaseSchema.java:56)
              at io.debezium.pipeline.EventDispatcher$SchemaChangeEventReceiver.schemaChangeEvent(EventDispatcher.java:642)
              at io.debezium.relational.RelationalSnapshotChangeEventSource.lambda$createSchemaChangeEventsForTables$3(RelationalSnapshotChangeEventSource.java:384)
              ... 13 more
      Caused by: org.apache.kafka.connect.errors.SchemaBuilderException: Invalid default value
              at org.apache.kafka.connect.data.SchemaBuilder.defaultValue(SchemaBuilder.java:131)
              at io.debezium.relational.TableSchemaBuilder.addField(TableSchemaBuilder.java:405)
              ... 28 more
      Caused by: org.apache.kafka.connect.errors.DataException: Invalid Java object for schema with type INT32: class java.lang.String
              at org.apache.kafka.connect.data.ConnectSchema.validateValue(ConnectSchema.java:242)
              at org.apache.kafka.connect.data.ConnectSchema.validateValue(ConnectSchema.java:213)
              at org.apache.kafka.connect.data.SchemaBuilder.defaultValue(SchemaBuilder.java:129)
              ... 29 more
      

      Do you see the same behaviour using the latest relesead Debezium version?

      Yes

      Do you have the connector logs, ideally from start till finish?

      Can easily be recreated

      How to reproduce the issue using our

      See above

              Unassigned Unassigned
              jan.gruenewald Jan Grünewald (Inactive)
              Lars Johansson (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: