{"record":{"id":"e676aa7e47ba2870","repo":"SonarSource/sonarqube","slug":"missing-url","errorCode":null,"errorMessage":"Missing URL","messagePattern":"Missing URL","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"server/sonar-alm-client/src/main/java/org/sonar/alm/client/github/GithubApplicationClientImpl.java","lineNumber":153,"sourceCode":"      LOG.warn(FAILED_TO_REQUEST_BEGIN_MSG + endPoint, e);\n      return Optional.empty();\n    }\n  }\n\n  private <T> Optional<T> post(String baseUrl, AccessToken token, String endPoint, Map<String, String> extraHeaders, Class<T> gsonClass) {\n    try {\n      ApplicationHttpClient.Response response = githubApplicationHttpClient.post(baseUrl, token, endPoint, extraHeaders);\n      return handleResponse(response, endPoint, gsonClass);\n    } catch (Exception e) {\n      LOG.warn(FAILED_TO_REQUEST_BEGIN_MSG + endPoint, e);\n      return Optional.empty();\n    }\n  }\n\n  @Override\n  public void checkApiEndpoint(GithubAppConfiguration githubAppConfiguration) {\n    if (StringUtils.isBlank(githubAppConfiguration.getApiEndpoint())) {\n      throw new IllegalArgumentException(\"Missing URL\");\n    }\n\n    URI apiEndpoint;\n    try {\n      apiEndpoint = URI.create(githubAppConfiguration.getApiEndpoint());\n    } catch (IllegalArgumentException e) {\n      throw new IllegalArgumentException(\"Invalid URL, \" + e.getMessage());\n    }\n\n    if (!\"http\".equalsIgnoreCase(apiEndpoint.getScheme()) && !\"https\".equalsIgnoreCase(apiEndpoint.getScheme())) {\n      throw new IllegalArgumentException(\"Only http and https schemes are supported\");\n    } else if (!isValidGitHubUrl(apiEndpoint)) {\n      throw new IllegalArgumentException(\"Invalid GitHub URL\");\n    }\n  }\n\n  private static boolean isValidGitHubUrl(URI apiEndpoint) {\n    String host = apiEndpoint.getHost();","sourceCodeStart":135,"sourceCodeEnd":171,"githubUrl":"https://github.com/SonarSource/sonarqube/blob/184c821202192afc1c599fc912d0889b69fffa53/server/sonar-alm-client/src/main/java/org/sonar/alm/client/github/GithubApplicationClientImpl.java#L135-L171","documentation":"GithubApplicationClientImpl.checkApiEndpoint validates the GitHub App configuration before any network call. If the API endpoint is blank (null or whitespace), it throws IllegalArgumentException(\"Missing URL\"). The endpoint is mandatory to know which GitHub instance to talk to.","triggerScenarios":"Calling checkApiEndpoint (directly or via ALM/GitHub App setting validation) with a GithubAppConfiguration whose apiEndpoint is null or empty — e.g. GitHub App settings saved without the API URL field.","commonSituations":"GitHub App ALM integration configured without the 'API URL' field; configuration loaded from properties/env where the endpoint key was not set; field cleared during an update; automated config tooling writing empty string.","solutions":["Set the API URL in Administration > ALM Integrations > GitHub (e.g. https://api.github.com for GitHub.com or https://<host>/api/v3 for GitHub Enterprise Server)","If using properties, provide the github app configuration with a non-blank apiEndpoint before validation","Re-save the ALM setting through the web API including the url field"],"exampleFix":"// before\nGithubAppConfiguration cfg = new GithubAppConfiguration(null, appId, clientId, ...);\n// after\nGithubAppConfiguration cfg = new GithubAppConfiguration(\"https://github.example.com/api/v3\", appId, clientId, ...);","handlingStrategy":"validation","validationCode":"// Java: check the endpoint before building the configuration\nif (apiEndpoint == null || apiEndpoint.isBlank()) {\n  throw new IllegalArgumentException(\"GitHub API endpoint must be set (e.g. https://api.github.com or https://<host>/api/v3)\");\n}","typeGuard":"// Java: narrow a possibly-blank endpoint\nstatic boolean hasApiEndpoint(GithubAppConfiguration cfg) {\n  return cfg != null && !StringUtils.isBlank(cfg.getApiEndpoint());\n}","tryCatchPattern":"try {\n  githubApplicationClient.checkApiEndpoint(githubAppConfiguration);\n} catch (IllegalArgumentException e) {\n  if (\"Missing URL\".equals(e.getMessage())) {\n    throw new ConfigurationException(\"GitHub App API URL is not configured — set it in Administration > ALM Integrations > GitHub\");\n  }\n  throw e;\n}","preventionTips":["Populate the API URL field whenever configuring the GitHub App integration (https://api.github.com or https://<ghe-host>/api/v3)","If loading from env/properties, assert the endpoint key is present and non-blank at startup","Never save the ALM setting with the URL field left empty; re-check after edits"],"tags":["github","configuration","validation","url"],"backgroundTag":"missing-required-config-field","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"}