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

Only Struct objects supported for [Header field insertion], found: null

XMLWordPrintable

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

      Bug report

      For bug reports, provide this information, please:

      What Debezium connector do you use and what version?

      io.debezium:debezium-connector-postgres:2.2.1.Final

      What is the connector configuration?

      io.debezium.config.Configuration.create()
                      .with("name", "audit-postgres-connector")
                      .with("connector.class", "io.debezium.connector.postgresql.PostgresConnector")
                      .with("offset.storage", "org.apache.kafka.connect.storage.FileOffsetBackingStore")
                      .with("offset.storage.file.filename", "/tmp/offsets.dat")
                      .with("offset.flush.interval.ms", "60000")
                      .with("database.hostname", referenceDbHost)
                      .with("database.port", referenceDbPort)
                      .with("database.user", referenceDbUsername)
                      .with("database.password", referenceDbPassword)
                      .with("database.dbname", referenceDbName)
      //                .with("database.include.list", referenceDbName)
                      .with("table.exclude.list", "public.databasechangeloglock")
                      .with("plugin.name", "pgoutput")
                      .with("topic.prefix", "reference_topic")
                      .with("include.schema.changes", "false")
                      .with("database.server.id", "10181")
                      .with("database.server.name", "reference-postgres-db-server")
                      .with("database.history", "io.debezium.relational.history.FileDatabaseHistory")
                      .with("database.history.file.filename", "/tmp/dbhistory.dat")
                      .with("snapshot.max.threads", "4")
                      .with("transforms", "changes,moveHeadersToValue")
                      .with("transforms.changes.type", "io.debezium.transforms.ExtractChangedRecordState")
                      .with("transforms.changes.header.changed.name", CHANGEDFIELDS)
                      .with("transforms.moveHeadersToValue.type", "io.debezium.transforms.HeaderToValue")
                      .with("transforms.moveHeadersToValue.headers", CHANGEDFIELDS)
                      .with("transforms.moveHeadersToValue.fields", "source." + CHANGEDFIELDS)
                      .with("transforms.moveHeadersToValue.operation", "move")
                      .build(); 

      What is the captured database version and mode of depoyment?

      (E.g. on-premises, with a specific cloud provider, etc.)

      postgres 12, local server

      What behaviour do you expect?

      move changed values list from header to record

      What behaviour do you see?

      Error occured while deleting

      org.apache.kafka.connect.errors.DataException: Only Struct objects supported for [Header field insertion], found: null
          at org.apache.kafka.connect.transforms.util.Requirements.requireStruct(Requirements.java:52) ~[connect-transforms-3.3.2.jar:na]
          at io.debezium.transforms.HeaderToValue.apply(HeaderToValue.java:147) ~[debezium-core-2.3.0.CR1.jar:2.3.0.CR1]
          at io.debezium.embedded.Transformations.transform(Transformations.java:92) ~[debezium-embedded-2.3.0.CR1.jar:2.3.0.CR1]
          at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) ~[na:na]
          at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625) ~[na:na]
          at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[na:na]
          at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[na:na]
          at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921) ~[na:na]
          at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[na:na]
          at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682) ~[na:na]
          at io.debezium.embedded.EmbeddedEngine.run(EmbeddedEngine.java:905) ~[debezium-embedded-2.3.0.CR1.jar:2.3.0.CR1]
          at io.debezium.embedded.ConvertingEngineBuilder$2.run(ConvertingEngineBuilder.java:229) ~[debezium-embedded-2.3.0.CR1.jar:2.3.0.CR1]
          at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[na:na]
          at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[na:na]
          at java.base/java.lang.Thread.run(Thread.java:833) ~[na:na] 

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

      (Ideally, also verify with latest Alpha/Beta/CR version)

      Yes

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

      (You might be asked later to provide DEBUG/TRACE level log)

      I have error log from console

      How to reproduce the issue using our tutorial deployment?

      Debezium embedded

      Feature request or enhancement

      For feature requests or enhancements, provide this information, please:

      Which use case/requirement will be addressed by the proposed feature?

      null checking

      Implementation ideas (optional)

      need behavior like this

      "transforms.behavior.on.null.values", "ignore"

              rh-ee-mvitale Mario Fiore Vitale
              izzat_dev Izzat Madaminov (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: