{"record":{"id":"d1bf480b265d60ab","repo":"SonarSource/sonarqube","slug":"sonarqube-was-not-able-to-retrieve-resources-from","errorCode":null,"errorMessage":"SonarQube was not able to retrieve resources from external system. Error while executing a paginated call to %s, endpoint:%s. ","messagePattern":"SonarQube was not able to retrieve resources from external system\\. Error while executing a paginated call to (.+?), endpoint:(.+?)\\. ","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"server/sonar-alm-client/src/main/java/org/sonar/alm/client/GenericPaginatedHttpClient.java","lineNumber":89,"sourceCode":"    } catch (InterruptedException e) {\n      Thread.currentThread().interrupt();\n      LOG.warn(format(\"Thread interrupted: %s\", e.getMessage()), e);\n    }\n  }\n\n  private GetResponse executeCall(String appUrl, AccessToken token, String endpoint) {\n    try {\n      GetResponse response = appHttpClient.get(appUrl, token, endpoint);\n      if (response.getCode() < 200 || response.getCode() >= 300) {\n        throw new IllegalStateException(\n          format(\"Error while executing a call to %s. Return code %s. Error message: %s.\", appUrl, response.getCode(), response.getContent().orElse(\"\")));\n      }\n      return response;\n    } catch (Exception e) {\n      String errorMessage = format(\"SonarQube was not able to retrieve resources from external system. Error while executing a paginated call to %s, endpoint:%s.\",\n        appUrl, endpoint);\n      logException(errorMessage, e);\n      throw new IllegalStateException(errorMessage + \" \" + e.getMessage());\n    }\n  }\n\n  private static void logException(String message, Exception e) {\n    if (LOG.isDebugEnabled()) {\n      LOG.warn(message, e);\n    } else {\n      LOG.warn(message, e.getMessage());\n    }\n  }\n}\n","sourceCodeStart":71,"sourceCodeEnd":101,"githubUrl":"https://github.com/SonarSource/sonarqube/blob/184c821202192afc1c599fc912d0889b69fffa53/server/sonar-alm-client/src/main/java/org/sonar/alm/client/GenericPaginatedHttpClient.java#L71-L101","documentation":"This is the wrapper thrown by executeCall's catch(Exception) block: any failure while executing a paginated call (non-2xx response, network error, invalid URL) is logged with full detail and rethrown as an IllegalStateException prefixed with 'SonarQube was not able to retrieve resources from external system'. The original cause message is appended.","triggerScenarios":"Any exception inside the paginated GET: IllegalStateException from a non-2xx code (see executeCall), IOException/connection failure to the ALM host, IllegalArgumentException from an invalid URL, or response-body reading failure.","commonSituations":"ALM server unreachable (DNS/firewall), TLS certificate not trusted by SonarQube's JVM, expired PAT causing 401, misconfigured URL after migrating the ALM server.","solutions":["Read the appended cause and the WARN log line (logException) to find the root error, then fix it specifically.","Test connectivity from the SonarQube host: curl the configured appUrl endpoint.","If TLS-related, import the ALM server certificate into the JVM truststore.","Re-check the DevOps platform integration settings (URL, token) and retry the import."],"exampleFix":"// before\nURL=http://internal-azure (unreachable from SonarQube host)\n\n// after\nURL=https://devops.internal.example.com (resolvable and reachable)","handlingStrategy":"try-catch","validationCode":"static boolean canReach(String appUrl) {\n  try {\n    HttpURLConnection c = (HttpURLConnection) new java.net.URI(appUrl).toURL().openConnection();\n    c.setConnectTimeout(5000);\n    return c.getResponseCode() > 0;\n  } catch (Exception e) { return false; }\n}","typeGuard":null,"tryCatchPattern":"try {\n  items = paginatedClient.listAll(appUrl, token, endpoint);\n} catch (IllegalStateException e) {\n  // message is \"SonarQube was not able to retrieve resources ...\" + cause\n  LOG.warn(\"Devops import failed: {}\", e.getMessage());\n  // fall back to last synced data\n  items = lastKnownSnapshot();\n}","preventionTips":["Check network reachability (DNS, firewall, TLS trust) from the SonarQube host to the ALM server before configuring.","Always read the WARN log line produced by logException for the root cause.","Use fully qualified https URLs in integration settings.","Keep cause messages intact when wrapping so users see the underlying error."],"tags":["java","http","network","integration"],"backgroundTag":"api-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"}