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

invalid client sasl.jaas.config triggers NullPointerException

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 0.10.2.0
    • Fix Version/s: 2.0.0
    • Component/s: None
    • Labels:
      None

      Description

      Using an invalid sasl.jaas.config property causes a NullPointerException to be thrown, which makes it difficult to understand the root of the problem.

      Example of an invalid config

      sasl.jaas.config=KafkaClient {\n\
        org.apache.kafka.common.security.plain.PlainLoginModule required\n\
        username="xxxxx"\n\
        password="XXXX";\n\
      }
      

      Resulting stack trace:

      org.apache.kafka.common.KafkaException: Failed to construct kafka producer
      	at org.apache.kafka.clients.producer.KafkaProducer.<init>(KafkaProducer.java:342)
      	at org.apache.kafka.clients.producer.KafkaProducer.<init>(KafkaProducer.java:166)
      [...]
      Caused by: org.apache.kafka.common.KafkaException: java.lang.NullPointerException
      	at org.apache.kafka.common.network.SaslChannelBuilder.configure(SaslChannelBuilder.java:94)
      	at org.apache.kafka.common.network.ChannelBuilders.create(ChannelBuilders.java:93)
      	at org.apache.kafka.common.network.ChannelBuilders.clientChannelBuilder(ChannelBuilders.java:51)
      	at org.apache.kafka.clients.ClientUtils.createChannelBuilder(ClientUtils.java:84)
      	at org.apache.kafka.clients.producer.KafkaProducer.<init>(KafkaProducer.java:305)
      	... 41 more
      Caused by: java.lang.NullPointerException
      	at org.apache.kafka.common.security.JaasConfig.loginModuleControlFlag(JaasConfig.java:87)
      	at org.apache.kafka.common.security.JaasConfig.parseAppConfigurationEntry(JaasConfig.java:110)
      	at org.apache.kafka.common.security.JaasConfig.<init>(JaasConfig.java:65)
      	at org.apache.kafka.common.security.JaasUtils.jaasConfig(JaasUtils.java:59)
      	at org.apache.kafka.common.network.SaslChannelBuilder.configure(SaslChannelBuilder.java:85)
      	... 45 more
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                omkreddy Manikumar
                Reporter:
                xvrl Xavier Léauté
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: