{"record":{"id":"e2413cfe37c538dc","repo":"apache/hadoop","slug":"failed-to-connect-to-url","errorCode":null,"errorMessage":"Failed to connect to: ${url}","messagePattern":"Failed to connect to: (.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/crypto/key/kms/KMSClientProvider.java","lineNumber":519,"sourceCode":"\n  private HttpURLConnection createConnection(final URL url, String method)\n      throws IOException {\n    HttpURLConnection conn;\n    try {\n      final String doAsUser = getDoAsUser();\n      conn = getActualUgi().doAs(new PrivilegedExceptionAction\n          <HttpURLConnection>() {\n        @Override\n        public HttpURLConnection run() throws Exception {\n          DelegationTokenAuthenticatedURL authUrl =\n              createAuthenticatedURL();\n          return authUrl.openConnection(url, authToken, doAsUser);\n        }\n      });\n    } catch (ConnectException ex) {\n      String msg = \"Failed to connect to: \" + url.toString();\n      LOG.warn(msg);\n      throw new IOException(msg, ex);\n    } catch (SocketTimeoutException ex) {\n      LOG.warn(\"Failed to connect to {}:{}\", url.getHost(), url.getPort());\n      throw ex;\n    } catch (IOException ex) {\n      throw ex;\n    } catch (UndeclaredThrowableException ex) {\n      throw new IOException(ex.getUndeclaredThrowable());\n    } catch (Exception ex) {\n      throw new IOException(ex);\n    }\n    conn.setUseCaches(false);\n    conn.setRequestMethod(method);\n    if (method.equals(HTTP_POST) || method.equals(HTTP_PUT)) {\n      conn.setDoOutput(true);\n    }\n    conn = configureConnection(conn);\n    return conn;\n  }","sourceCodeStart":501,"sourceCodeEnd":537,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/crypto/key/kms/KMSClientProvider.java#L501-L537","documentation":"Error \"Failed to connect to: ${url}\" thrown in apache/hadoop.","triggerScenarios":"Raised at runtime when the documented precondition or configuration requirement for this operation is violated.","commonSituations":"Misconfigured or missing property, invalid user input, or calling the API before its prerequisites are met.","solutions":["Verify network connectivity and that the KMS server is running at the configured URL."],"exampleFix":"curl the KMS endpoint and fix firewall/DNS issues.","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"}