{"record":{"id":"97fcefcd85b5f625","repo":"apache/hadoop","slug":"aadtoken-http-connection-to-failed-for-getting","errorCode":null,"errorMessage":"AADToken: HTTP connection to {} failed for getting token from AzureAD. Unexpected response. Check configuration, URLs and proxy settings. proxies={}","messagePattern":"AADToken: HTTP connection to (.+?) failed for getting token from AzureAD\\. Unexpected response\\. Check configuration, URLs and proxy settings\\. proxies=(.+?)","errorType":"http","errorClass":"UnexpectedResponseException","httpStatus":200,"severity":"error","filePath":"hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/oauth2/AzureADAuthenticator.java","lineNumber":493,"sourceCode":"        String httpProxy = System.getProperty(\"http.proxy\");\n        String httpsProxy = System.getProperty(\"https.proxy\");\n        if (httpProxy != null || httpsProxy != null) {\n          proxies = \"http:\" + httpProxy + \"; https:\" + httpsProxy;\n        }\n        String operation = \"AADToken: HTTP connection to \" + authEndpoint\n            + \" failed for getting token from AzureAD.\";\n        String logMessage = operation\n                        + \" HTTP response: \" + httpResponseCode\n                        + \" \" + conn.getResponseMessage()\n                        + \" Proxies: \" + proxies\n                        + (responseBody.isEmpty()\n                          ? \"\"\n                          : (\"\\nFirst 1K of Body: \" + responseBody));\n        LOG.debug(logMessage);\n        if (httpResponseCode == HttpURLConnection.HTTP_OK) {\n          // 200 is returned by some of the sign-on pages, but can also\n          // come from proxies, utterly wrong URLs, etc.\n          throw new UnexpectedResponseException(httpResponseCode,\n              requestId,\n              operation\n                  + \" Unexpected response.\"\n                  + \" Check configuration, URLs and proxy settings.\"\n                  + \" proxies=\" + proxies,\n              authEndpoint,\n              responseContentType,\n              responseBody);\n        } else {\n          // general HTTP error\n          throw new HttpException(httpResponseCode,\n              requestId,\n              operation,\n              authEndpoint,\n              responseContentType,\n              responseBody);\n        }\n      }","sourceCodeStart":475,"sourceCodeEnd":511,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/oauth2/AzureADAuthenticator.java#L475-L511","documentation":"Error \"AADToken: HTTP connection to {} failed for getting token from AzureAD. Unexpected response. Check configuration, URLs and proxy settings. proxies={}\" thrown in apache/hadoop.","triggerScenarios":"The HTTP call to Azure AD for a token returns an unexpected status, commonly due to wrong credentials, wrong endpoint, or proxy interference.","commonSituations":"See trigger scenarios.","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."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}