apache/hadoop · error · IllegalArgumentException

Handler is already specified for ${scheme} authentication sc

Error message

Handler is already specified for ${scheme} authentication scheme.

What it means

Error "Handler is already specified for ${scheme} authentication scheme." thrown in apache/hadoop.

Source

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

    return types;
  }

  @Override
  public void init(Properties config) throws ServletException {
    // Useful for debugging purpose.
    for (Map.Entry prop : config.entrySet()) {
      logger.info("{} : {}", prop.getKey(), prop.getValue());
    }

    this.types.clear();
    if (config.getProperty(SCHEMES_PROPERTY) == null) {
      throw new NullPointerException(SCHEMES_PROPERTY + " system property is not specified.");
    }
    String schemesProperty = config.getProperty(SCHEMES_PROPERTY);
    for (String scheme : STR_SPLITTER.split(schemesProperty)) {
      scheme = AuthenticationHandlerUtil.checkAuthScheme(scheme);
      if (schemeToAuthHandlerMapping.containsKey(scheme)) {
        throw new IllegalArgumentException("Handler is already specified for "
            + scheme + " authentication scheme.");
      }

      String authHandlerPropName =
          String.format(AUTH_HANDLER_PROPERTY, scheme).toLowerCase();
      String authHandlerName = config.getProperty(authHandlerPropName);
      if (authHandlerName == null) {
        throw new NullPointerException(
            "No auth handler configured for scheme " + scheme);
      }

      String authHandlerClassName =
          AuthenticationHandlerUtil
              .getAuthenticationHandlerClassName(authHandlerName);
      AuthenticationHandler handler =
          initializeAuthHandler(authHandlerClassName, config);
      schemeToAuthHandlerMapping.put(scheme, handler);
      types.add(handler.getType());

View on GitHub (pinned to 2add963021)

Solutions

  1. Remove the duplicate handler registration; each authentication scheme can have only one handler.

Example fix

Keep a single handler entry per scheme in the configuration.

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.

Understand the failure class


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