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

NPE if sasl.mechanism is unrecognized

    XMLWordPrintableJSON

Details

    • Task
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 2.7.0
    • None
    • None

    Description

      If a client sets an unknown sasl.mechanism value (e.g. mistakenly setting "PLAN" instead of "PLAIN") the client sees a NullPointerException that only indirectly indicates the nature of the problem. For example:

      java.lang.NullPointerException
      at org.apache.kafka.common.security.authenticator.SaslClientAuthenticator.sendSaslClientToken(SaslClientAuthenticator.java:430)

      It is better to see an exception that directly states what the issue is. For example, the initial version of this PR would provide the following information:

      Caused by: org.apache.kafka.common.errors.SaslAuthenticationException: Failed to create SaslClient with mechanism PLAN

      Attachments

        Issue Links

          Activity

            People

              rndgstn Ron Dagostino
              rndgstn Ron Dagostino
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: