apache/hadoop · error · HttpException

AADToken: HTTP connection to

Error message

AADToken: HTTP connection to {} failed for getting token from AzureAD.

What it means

UnexpectedResponseException from the AAD token call: HTTP 200 was received but the body is not a token response (sign-on pages and misbehaving proxies return 200), signalling a wrong URL, tenant, or proxy configuration rather than a transient fault.

Solutions

  1. Check network connectivity to the Azure AD token endpoint.
  2. Verify proxy settings and firewall rules allow outbound HTTPS to login.microsoftonline.com.
  3. Retry after resolving transient network issues.
Defensive patterns

Strategy: validation

When it happens

Trigger: The HTTP connection to Azure AD fails outright (DNS, TLS, connectivity) while fetching an access token.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/oauth2/AzureADAuthenticator.java:504

                        + (responseBody.isEmpty()
                          ? ""
                          : ("\nFirst 1K of Body: " + responseBody));
        LOG.debug(logMessage);
        if (httpResponseCode == HttpURLConnection.HTTP_OK) {
          // 200 is returned by some of the sign-on pages, but can also
          // come from proxies, utterly wrong URLs, etc.
          throw new UnexpectedResponseException(httpResponseCode,
              requestId,
              operation
                  + " Unexpected response."
                  + " Check configuration, URLs and proxy settings."
                  + " proxies=" + proxies,
              authEndpoint,
              responseContentType,
              responseBody);
        } else {
          // general HTTP error
          throw new HttpException(httpResponseCode,
              requestId,
              operation,
              authEndpoint,
              responseContentType,
              responseBody);
        }
      }
    } finally {
      if (conn != null) {
        conn.disconnect();
      }
    }
    return token;
  }

  private static AzureADToken parseTokenFromStream(
      InputStream httpResponseStream, boolean isMsi) throws IOException {
    AzureADToken token = new AzureADToken();

View on GitHub (pinned to 2add963021)