Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-10110

ConnectDistributed fails with NPE when Kafka cluster has no ID

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Fixed
    • 2.6.0
    • 2.6.0
    • connect
    • None

    Description

      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:

      [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)
      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)
      

      Attachments

        Issue Links

          Activity

            People

              rhauch Randall Hauch
              rhauch Randall Hauch
              Konstantine Karantasis Konstantine Karantasis
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: