{"record":{"id":"dcd53645807335ea","repo":"SonarSource/sonarqube","slug":"s-for-request-s-s","errorCode":null,"errorMessage":"%s for request [%s]: [%s]","messagePattern":"(.+?) for request \\[(.+?)\\]: \\[(.+?)\\]","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"server/sonar-alm-client/src/main/java/org/sonar/alm/client/azure/AzureDevOpsHttpClient.java","lineNumber":185,"sourceCode":"  protected boolean isGlobalPat(String vsspsGlobalUrl, String token) {\n    HttpUrl url = Objects.requireNonNull(HttpUrl.parse(vsspsGlobalUrl), INVALID_SERVER_URL)\n      .newBuilder()\n      .addPathSegment(PATH_APIS)\n      .addPathSegment(PATH_CONNECTION_DATA)\n      .addQueryParameter(PARAM_API_VERSION, API_VERSION_3_PREVIEW_VALUE)\n      .build();\n    Request request = prepareRequestWithToken(token, GET, url, null);\n    try (Response response = globalPatProbeClient.newCall(request).execute()) {\n      if (response.code() == HttpURLConnection.HTTP_OK) {\n        return true;\n      }\n      if (response.code() == HttpURLConnection.HTTP_UNAUTHORIZED || response.code() == HttpURLConnection.HTTP_FORBIDDEN) {\n        return false;\n      }\n      String body = Objects.requireNonNull(response.body(), MISSING_RESPONSE_BODY).string();\n      throw new AzureDevopsServerException(response.code(), generateErrorMessage(body));\n    } catch (IOException e) {\n      throw new IllegalArgumentException(\n        String.format(UNABLE_TO_CONTACT_AZURE_SERVER_MESSAGE_FORMAT, UNABLE_TO_CONTACT_AZURE_SERVER, request.url(), e.getMessage()), e);\n    }\n  }\n\n  private void doGet(String token, HttpUrl url) {\n    Request request = prepareRequestWithToken(token, GET, url, null);\n    doCall(request);\n  }\n\n  protected void doCall(Request request) {\n    try (Response response = client.newCall(request).execute()) {\n      checkResponseIsSuccessful(response);\n    } catch (IOException e) {\n      throw new IllegalArgumentException(\n        String.format(UNABLE_TO_CONTACT_AZURE_SERVER_MESSAGE_FORMAT, UNABLE_TO_CONTACT_AZURE_SERVER, request.url(), e.getMessage()),\n        e);\n    }\n  }","sourceCodeStart":167,"sourceCodeEnd":203,"githubUrl":"https://github.com/SonarSource/sonarqube/blob/184c821202192afc1c599fc912d0889b69fffa53/server/sonar-alm-client/src/main/java/org/sonar/alm/client/azure/AzureDevOpsHttpClient.java#L167-L203","documentation":"isGlobalPat catches any IOException from executing the HTTP request and converts it to IllegalArgumentException with UNABLE_TO_CONTACT_AZURE_SERVER_MESSAGE_FORMAT ('%s for request [%s]: [%s]'). It means the request never got a usable HTTP response: connection or I/O failure while contacting Azure DevOps.","triggerScenarios":"client.newCall(request).execute() throws IOException during the global-PAT check: unknown host, connection refused/reset, TLS handshake failure, socket timeout, or the response body .string() call failing mid-read.","commonSituations":"SonarQube cannot reach the Azure DevOps Server (DNS, firewall, VPN), self-signed certificate not in the JVM truststore, wrong port, or proxy misconfiguration.","solutions":["Fix the Azure DevOps Server URL/hostname in the devops integration settings.","Test connectivity from the SonarQube server: curl -v <request URL from the message>.","Import the server's TLS certificate into SonarQube's JVM truststore if the failure is a PKIX path error.","Check firewall/proxy rules to allow outbound HTTPS from SonarQube to the Azure server."],"exampleFix":"// before\nURL=http://devops.server:8080 (port blocked)\n\n// after\nURL=https://devops.server.com (HTTPS, port 443 open)","handlingStrategy":"try-catch","validationCode":"static boolean reachable(String url) {\n  try {\n    new java.net.URI(url).toURL().openConnection().connect();\n    return true;\n  } catch (IOException | IllegalArgumentException e) {\n    return false;\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  client.isGlobalPat(pat);\n} catch (IllegalArgumentException e) {\n  if (e.getCause() instanceof IOException io) {\n    LOG.error(\"Cannot contact Azure DevOps ({}): {}\", io.getClass().getSimpleName(), io.getMessage());\n  }\n  throw new ConnectivityException(\"Check URL/network/TLS to Azure DevOps server\", e);\n}","preventionTips":["Test connectivity with curl -v from the SonarQube host before configuring.","Import server TLS certificates into the JVM truststore for self-signed environments.","Open outbound firewall rules for the Azure DevOps port.","Use IP/DNS that resolves from the SonarQube container/host, not just your workstation."],"tags":["java","network","azure-devops","io"],"backgroundTag":"network-request-failed","analyzedSha":"184c821202192afc1c599fc912d0889b69fffa53","analyzedAt":"2026-09-09T12:23:51.573Z","contentChangedAt":"2026-09-09T12:23:51.573Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}