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

NullPointerException connecting to Postgres with custom domain type mapped to enum

XMLWordPrintable

    • False
    • None
    • False

      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?

      Using debezium-postgres-connector version 2.6.1.Final

      What is the connector configuration?

      Note: some non-relevant information redacted

       

      connector.class=io.debezium.connector.postgresql.PostgresConnector
      value.converter.schemaAutoRegistrationEnabled=true
      key.converter.region=us-east-1
      schema.history.internal.consumer.sasl.jaas.config=software.amazon.msk.auth.iam.IAMLoginModule required;
      transforms=unwrap
      schema.history.internal.producer.security.protocol=SASL_SSL
      transforms.unwrap.drop.tombstones=true
      signal.data.collection=public.debezium_signals
      converters=test
      transforms.unwrap.type=io.debezium.transforms.ExtractNewRecordState
      key.converter=com.amazonaws.services.schemaregistry.kafkaconnect.AWSKafkaAvroConverter
      schema.history.internal.producer.sasl.mechanism=AWS_MSK_IAM
      schema.history.internal.consumer.sasl.client.callback.handler.class=software.amazon.msk.auth.iam.IAMClientCallbackHandler
      database.dbname=${secretManager:<secret-path>:dbname}
      database.user=${secretManager:<secret-path>:username}
      schema.history.internal.producer.sasl.client.callback.handler.class=software.amazon.msk.auth.iam.IAMClientCallbackHandler
      heartbeat.interval.ms=10000
      key.converter.registry.name=<registry-name>
      plugin.name=pgoutput
      table.exclude.list=<exclusion-list>
      database.password=${secretManager:<secret-path>:password}
      schema.history.internal.consumer.sasl.mechanism=AWS_MSK_IAM
      schema.history.internal.producer.sasl.jaas.config=software.amazon.msk.auth.iam.IAMLoginModule required;
      snapshot.mode=never
      schema.history.internal.consumer.security.protocol=SASL_SSL
      transforms.unwrap.delete.handling.mode=rewrite
      incremental.snapshot.chunk.size=10240
      tasks.max=1
      value.converter.avroRecordType=GENERIC_RECORD
      topic.prefix=trade_execution
      value.converter.compatibility=NONE
      key.converter.schemaNameGenerationClass=com.amazonaws.services.schemaregistry.kafkaconnect.CustomSchemaRegistryNamingStrategy
      key.converter.compatibility=NONE
      key.converter.avroRecordType=GENERIC_RECORD
      value.converter=com.amazonaws.services.schemaregistry.kafkaconnect.AWSKafkaAvroConverter
      test.schema.name=com.test.TestCustomConverter
      publication.autocreate.mode=disabled
      value.converter.schemaNameGenerationClass=com.amazonaws.services.schemaregistry.kafkaconnect.CustomSchemaRegistryNamingStrategy
      database.server.id=184054
      value.converter.registry.name=<registry-name>
      snapshot.max.threads=4
      database.port=${secretManager:<secret-path>:port}
      value.converter.region=us-east-1
      include.unknown.datatypes=true
      key.converter.schemaAutoRegistrationEnabled=true
      database.hostname=${secretManager:<secret-path>:host}
      schema.name.adjustment.mode=avro
      transforms.unwrap.add.fields=name,op,db,table,schema,lsn,source.ts_ms,ts_ms
      test.type=com.test.Type

       

      What is the captured database version and mode of deployment?

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

      Postgres 15.2 (RDS)

      Deployed to MSK Connect

      What behaviour do you expect?

      Given the presence of the following domain type in Postgres:

       

      CREATE TYPE test_type
          AS ENUM ('TEST_1', 'TEST_2');
      CREATE DOMAIN test_type_not_null
          AS test_type
          NOT NULL; 

       

      Expecting successful connector startup.

      What behaviour do you see?

      Connector throws a NullPointerException on startup trying to prime the TypeRegistry because the domain type has no enum values (NPE comes from this block), despite being labeled as an enum in the information obtained from pg_catalog.

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

      Verified behavior exists with 2.3.0.Final -> 2.6.1.Final

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

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

      <Your answer>

      How to reproduce the issue using our tutorial deployment?

      1. Start Postgres Docker compose
      2. Connect to the DB via psql and execute the above statements to create the domain type
      3. Attempt to start the connector and observe the NPE

       

            Unassigned Unassigned
            zeldanerd24 Kevin Rothenberger
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: