Randall Hauch created KAFKA-10110:
-------------------------------------
Summary: ConnectDistributed fails with NPE when Kafka cluster has
no ID
Key: KAFKA-10110
URL: https://issues.apache.org/jira/browse/KAFKA-10110
Project: Kafka
Issue Type: Bug
Components: KafkaConnect
Affects Versions: 2.6.0
Reporter: Randall Hauch
Assignee: Randall Hauch
Fix For: 2.6.0
When a Connect worker starts, recent changes from KIP-606 / KAFKA-9960 attempt
to put the Kafka cluster ID into the new KafkaMetricsContext. But the Kafka
cluster ID can be null, resulting in an NPE shown in the following log snippet:
{noformat}
[2020-06-04 15:01:02,900] INFO Kafka cluster ID: null
(org.apache.kafka.connect.util.ConnectUtils)
...
[2020-06-04 15:01:03,271] ERROR Stopping due to error
(org.apache.kafka.connect.cli.ConnectDistributed)[2020-06-04 15:01:03,271]
ERROR Stopping due to error
(org.apache.kafka.connect.cli.ConnectDistributed)java.lang.NullPointerException
at
org.apache.kafka.common.metrics.KafkaMetricsContext.lambda$new$0(KafkaMetricsContext.java:48)
at java.util.HashMap.forEach(HashMap.java:1289) at
org.apache.kafka.common.metrics.KafkaMetricsContext.<init>(KafkaMetricsContext.java:48)
at
org.apache.kafka.connect.runtime.ConnectMetrics.<init>(ConnectMetrics.java:100)
at org.apache.kafka.connect.runtime.Worker.<init>(Worker.java:135) at
org.apache.kafka.connect.runtime.Worker.<init>(Worker.java:121) at
org.apache.kafka.connect.cli.ConnectDistributed.startConnect(ConnectDistributed.java:111)
at
org.apache.kafka.connect.cli.ConnectDistributed.main(ConnectDistributed.java:78)
{noformat}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)