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

JDBC primary.key.fields cannot be empty when i set insert.mode to upsert and primary.key.mode record_value

XMLWordPrintable

    • Critical

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

      Bug report

      JDBC connector  primary.key.fields cannot be empty when i set insert.mode to "upsert" and primary.key.mode="record_value"

      What Debezium connector do you use and what version?

      I am using JDBC connector 2.6  version

      What is the connector configuration?

       "config": {
                  "connector.class": "io.debezium.connector.jdbc.JdbcSinkConnector",
                  "connection.url": "",
                  "connection.username": "",
                  "connection.password": "",
                  "dialect.name": "OracleDatabaseDialect",
                  "table.name.format": "${source.schema}.${source.table}",
                  "hibernate.c3p0.idle_test_period": 1800,
                  "topics": ", ".join(topics) ,
                  "schema.evolution": "none",
                  "primary.key.mode": "record_value",
                  "insert.mode": "upsert",
                  "delete.enabled": "true"
              }

      What is the captured database version and mode of depoyment?

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

      On Premise Oracle 19c EE instance 

      What behaviour do you expect?

      I expect to register the connector and to see  status is running 

      What behaviour do you see?

      I see this error org.apache.kafka.connect.errors.ConnectException: Error configuring an instance of JdbcSinkConnectorConfig; check the logs for details\n\tat io.debezium.connector.jdbc.JdbcSinkConnectorConfig.validate(JdbcSinkConnectorConfig.java:551)\n\tat io.debezium.connector.jdbc.JdbcSinkConnectorTask.start(JdbcSinkConnectorTask.java:73)\n\tat org.apache.kafka.connect.runtime.WorkerSinkTask.initializeAndStart(WorkerSinkTask.java:329)\n\tat org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:202)\n\tat org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:259)\n\tat org.apache.kafka.connect.runtime.isolation.Plugins.lambda$withClassLoader$1(Plugins.java:237)\n\tat java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)\n\tat java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)\n\tat java.base/java.lang.Thread.run(Thread.java:1583)\n"

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

      Yes I tried 2.7 as well

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

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

      Yes

      How to reproduce the issue using our tutorial deployment?

       "config": {
                  "connector.class": "io.debezium.connector.jdbc.JdbcSinkConnector",
                  "connection.url": "",
                  "connection.username": "",
                  "connection.password": "",
                  "dialect.name": "OracleDatabaseDialect",
                  "table.name.format": "${source.schema}.${source.table}",
                  "hibernate.c3p0.idle_test_period": 1800,
                  "topics": ", ".join(topics) ,
                  "schema.evolution": "none",
                  "primary.key.mode": "record_value",
                  "insert.mode": "upsert",
                  "delete.enabled": "true"
              }

      Feature request or enhancement

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

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

      I have tables about 700 tables which do not have primary keys so i am trying to use one connector to register 700 topics and the configuration is shown above

      Implementation ideas (optional)

      The documentation does say this When the primary.key.mode is set to record_key with a non-primitive key, or record_value, it is expected that this property specifies a comma-separated list of field names from either the key or value. If the primary.key.mode is set to record_key with a non-primitive key, or record_value, and this property is not specifies, the connector derives the primary key from all fields of either the record key or record value, depending on the specified mode.

            rh-ee-mvitale Mario Fiore Vitale
            clintonchikwata Clinton Chikwata (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: