apache/hadoop · error · IllegalArgumentException

Either LDAP base DN or LDAP domain value needs to be…

Error message

Either LDAP base DN or LDAP domain value needs to be specified

What it means

Thrown from LdapAuthenticationHandler.init when exactly one of base DN and LDAP bind domain is set: the XOR check requires precisely one of the two to locate users (either search by DN or construct user@domain names). Fires when both or neither are configured.

Solutions

  1. Specify either the LDAP base DN or the LDAP domain in the handler configuration.

Example fix

Set init-param ldap.basedn=dc=example,dc=com.
Defensive patterns

Strategy: validation

When it happens

Trigger: Raised at runtime when the documented precondition or configuration requirement for this operation is violated.

Common situations: Misconfigured or missing property, invalid user input, or calling the API before its prerequisites are met.


AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22). Data as JSON: /api/errors/e0f8c09cc1083e8b. Report an issue: GitHub.

Appendix: source

Thrown at hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/security/authentication/server/LdapAuthenticationHandler.java:151

  @Override
  public String getType() {
    return TYPE;
  }

  @Override
  public void init(Properties config) throws ServletException {
    this.baseDN = config.getProperty(BASE_DN);
    this.providerUrl = config.getProperty(PROVIDER_URL);
    this.ldapDomain = config.getProperty(LDAP_BIND_DOMAIN);
    this.enableStartTls =
        Boolean.valueOf(config.getProperty(ENABLE_START_TLS, "false"));

    if (this.providerUrl == null) {
      throw new NullPointerException("The LDAP URI can not be null");
    }
    if (!((this.baseDN == null)
        ^ (this.ldapDomain == null))) {
      throw new IllegalArgumentException(
          "Either LDAP base DN or LDAP domain value needs to be specified");
    }
    if (this.enableStartTls) {
      String tmp = this.providerUrl.toLowerCase();
      if (tmp.startsWith("ldaps")) {
        throw new IllegalArgumentException(
            "Can not use ldaps and StartTLS option at the same time");
      }
    }
  }

  @Override
  public void destroy() {
  }

  @Override
  public boolean managementOperation(AuthenticationToken token,
      HttpServletRequest request, HttpServletResponse response)

View on GitHub (pinned to 2add963021)