ERROR Unable to ping ClickHouse server & instance

Hello team, i setup kafka syn from mysql to clickhouse, data streams into topics, clickhouse is active & reachable but i get the below error with com.clickhouse.kafka.connect.ClickHouseSinkConnector
Error
2025-05-13 03:57:47,557 INFO || [Producer clientId=connector-dlq-producer-bss-cdr1-clickhouse-sync-0] Cluster ID: 9JUN5NqlRGWKXKQs4NHrQw [org.apache.kafka.clients.Metadata]
2025-05-13 03:57:47,560 WARN || Ping retry 1 out of 3 [com.clickhouse.kafka.connect.sink.db.helper.ClickHouseHelperClient]
2025-05-13 03:57:47,562 WARN || Ping retry 2 out of 3 [com.clickhouse.kafka.connect.sink.db.helper.ClickHouseHelperClient]
2025-05-13 03:57:47,564 WARN || Ping retry 3 out of 3 [com.clickhouse.kafka.connect.sink.db.helper.ClickHouseHelperClient]
2025-05-13 03:57:47,564 ERROR || Unable to ping ClickHouse instance. [com.clickhouse.kafka.connect.sink.db.helper.ClickHouseHelperClient]
2025-05-13 03:57:47,564 ERROR || Unable to ping Clickhouse server. [com.clickhouse.kafka.connect.sink.db.ClickHouseWriter]
2025-05-13 03:57:47,565 ERROR || WorkerSinkTask{id=bss-cdr1-clickhouse-sync-0} Task threw an uncaught and unrecoverable exception. Task is being killed and will not recover until manually restarted [org.apache.kafka.connect.runtime.WorkerTask]
java.lang.RuntimeException: Connection to ClickHouse is not active.

Here is the full json
{
“name”: “clickhouse-sync”,
“config”: {
“connector.class”: “com.clickhouse.kafka.connect.ClickHouseSinkConnector”,
“tasks.max”: “1”,
“topics”: “r_21_0_202407,r_21_0_202408”,
“connection.url”: “jdbc:clickhouse://ip:8123/db”,
“hostname”: “IP”,
“port”: “8123”,
“database”: “db”,
“table”: “db.r_21_0”,
“user”: “db_user”,
“password”: “db_pass”,
“value.converter”: “org.apache.kafka.connect.json.JsonConverter”,
“value.converter.schemas.enable”: “false”,
“auto.create.table”: “false”,
“insert.mode”: “insert”,
“batch.size”: “1000”,
“retry.backoff.ms”: “5000”,
“errors.tolerance”: “all”,
“errors.log.enable”: “true”,
“enable_server_compression”: true,
“enable_http_compression”: true,
“http_compression_method”: “gzip”,
“errors.deadletterqueue.topic.name”: “dlq.clickhouse.gprs”,
“key.converter”: “org.apache.kafka.connect.storage.StringConverter”
}
}

Desperately in need of a solution

hey,

moving to kafka connect as well

did you try to the ping/curl the server from the kafka connect worker?
does this work?

best,
michael

Seeing now that the job is failing, not sure if this gives any pointers

{
“name”: “bss-cdr1-clickhouse-sync”,
“connector”: {
“state”: “RUNNING”,
“worker_id”: “172.28.0.4:8083”
},
“tasks”: [
{
“id”: 0,
“state”: “FAILED”,
“worker_id”: “172.28.0.4:8083”,
“trace”: “java.lang.RuntimeException: Connection to ClickHouse is not active.\n\tat com.clickhouse.kafka.connect.sink.ProxySinkTask.(ProxySinkTask.java:64)\n\tat com.clickhouse.kafka.connect.sink.ClickHouseSinkTask.start(ClickHouseSinkTask.java:40)\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”
** }**
],
“type”: “sink”
}

need the full stack basically
did you try to ping the clickhouse host?

Yes, from the container i can reach clickhouse server & port is open

sudo docker exec -u root -it kafka-debezium-connect-1 sh
sh-5.2# curl -v telnet://172.18.15.150:8123

  • Trying 172.18.15.150:8123…
  • Connected to 172.18.15.150 (172.18.15.150) port 8123 (#0)

pretty strange
just stumbled over
https://stackoverflow.com/questions/79354807/clickhouse-kafka-connect-is-not-working-in-self-hosted-setup