Details
-
Bug
-
Resolution: Not a Bug
-
Critical
-
None
-
1.9.3.Final, 1.9.4.Final
-
None
-
False
-
None
-
False
-
1.9.3.Final
-
Description
Bug report
Debezium Engine (aka embedded mode) with postgres connector is used in Quarkus application. When switching to latest version it crashes at startup because of `NoClassDefFoundError: io/debezium/heartbeat/HeartbeatFactory`
What Debezium connector do you use and what version?
1.9.3.Final and 1.9.4.Final is broken, 1.9.2.Final was the last version that works fine.
What is the connector configuration?
Heartbeat functionality is used:
... .with("heartbeat.interval.ms", Duration.ofMinutes(10).toMillis()) .with("heartbeat.action.query", "insert into " + HEARTBEAT_TABLE + "(id, updated_at) values (1, now()) on conflict(id) do update set updated_at = now();") ...
What is the captured database version and mode of depoyment?
PostgreSQL 11.15 running in Docker, with logical replication, and proper users and publication setup.
What behaviour do you expect?
Debezium should start successfully and trigger CDC event handler.
What behaviour do you see?
Debezium does not start correctly, exception is visible in the logs:
Unable to initialize and start connector's task class 'io.debezium.connector.postgresql.PostgresConnectorTask' with config: {connector.class=io.debezium.connector.postgresql.PostgresConnector, slot.name=debezium_cdc, slot.max.retries=0, include.schema.changes=false, heartbeat.action.query=insert into debezium_heartbeat(id, updated_at) values (1, now()) on conflict(id) do update set updated_at = now();, offset.storage.file.filename=, value.converter=org.apache.kafka.connect.json.JsonConverter, key.converter=org.apache.kafka.connect.json.JsonConverter, publication.autocreate.mode=disabled, database.user=doesnt_matter, database.dbname=doesnt_matter, offset.storage=doesnt_matter.OffsetDatabaseStore, database.server.name=doesnt_matter, offset.flush.timeout.ms=5000, heartbeat.interval.ms=600000, database.port=5432, plugin.name=pgoutput, offset.flush.interval.ms=60000, internal.key.converter=org.apache.kafka.connect.json.JsonConverter, database.hostname=localhost, database.password=********, name=doesnt_matter, internal.value.converter=org.apache.kafka.connect.json.JsonConverter, table.include.list=debezium_heartbeat, max.batch.size=256, snapshot.mode=never}, uuid= : java.lang.NoClassDefFoundError: io/debezium/heartbeat/HeartbeatFactory at io.debezium.connector.postgresql.PostgresConnectorTask.start(PostgresConnectorTask.java:176) at io.debezium.connector.common.BaseSourceTask.start(BaseSourceTask.java:130) at io.debezium.embedded.EmbeddedEngine.run(EmbeddedEngine.java:759) at io.debezium.embedded.ConvertingEngineBuilder$2.run(ConvertingEngineBuilder.java:192) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang.Thread.run(Thread.java:833) Caused by: java.lang.ClassNotFoundException: io.debezium.heartbeat.HeartbeatFactory ... 7 more
Do you see the same behaviour using the latest relesead Debezium version?
1.9.4.Final is broken
2.0.0.Alpha1 as far as I remember was running OK
Do you have the connector logs, ideally from start till finish?
TODO
Implementation ideas (optional)
IMO this commit was not backported into 1.9 branch.
Looks like your build process is optimised so that it triggers certain Github Action workflows/jobs only if certain files has been changed. The problem is when other modules introduces breaking changes (deleting a class) that our module depends on, or only part of changes are backported to release branch - CI will no catch this, and I believe we experience exactly this situation here.
https://github.com/debezium/debezium/actions/workflows/postgres-workflow.yml
There was no single run for branch 1.9 for postgres workflow.