apache/hadoop · error · UnexpectedResponseException
AADToken: HTTP connection to {} failed for getting token fro
Error message
AADToken: HTTP connection to {} failed for getting token from AzureAD. Unexpected response. Check configuration, URLs and proxy settings. proxies={} What it means
Error "AADToken: HTTP connection to {} failed for getting token from AzureAD. Unexpected response. Check configuration, URLs and proxy settings. proxies={}" thrown in apache/hadoop.
Source
Thrown at hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/oauth2/AzureADAuthenticator.java:493
String httpProxy = System.getProperty("http.proxy");
String httpsProxy = System.getProperty("https.proxy");
if (httpProxy != null || httpsProxy != null) {
proxies = "http:" + httpProxy + "; https:" + httpsProxy;
}
String operation = "AADToken: HTTP connection to " + authEndpoint
+ " failed for getting token from AzureAD.";
String logMessage = operation
+ " HTTP response: " + httpResponseCode
+ " " + conn.getResponseMessage()
+ " Proxies: " + proxies
+ (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);
}
}View on GitHub (pinned to 2add963021)
Solutions
- Verify the AAD token endpoint URL, client id/secret, and proxy settings in the configuration.
- Check network connectivity and proxy configuration (proxies listed in the message).
- Inspect the HTTP response body with DEBUG logging for the AAD error detail.
When it happens
Trigger: The HTTP call to Azure AD for a token returns an unexpected status, commonly due to wrong credentials, wrong endpoint, or proxy interference.
Common situations: See trigger scenarios.
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/97fcefcd85b5f625.
Report an issue: GitHub.