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

NPE if sasl.mechanism is unrecognized

    XMLWordPrintableJSON

    Details

    • Type: Task
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.7.0
    • Component/s: None
    • Labels:
      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

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

                Dates

                • Created:
                  Updated:
                  Resolved: