SonarSource/sonarqube · error · IllegalArgumentException
Missing URL
Error message
Missing URL
What it means
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.
Source
Thrown at server/sonar-alm-client/src/main/java/org/sonar/alm/client/github/GithubApplicationClientImpl.java:153
LOG.warn(FAILED_TO_REQUEST_BEGIN_MSG + endPoint, e);
return Optional.empty();
}
}
private <T> Optional<T> post(String baseUrl, AccessToken token, String endPoint, Map<String, String> extraHeaders, Class<T> gsonClass) {
try {
ApplicationHttpClient.Response response = githubApplicationHttpClient.post(baseUrl, token, endPoint, extraHeaders);
return handleResponse(response, endPoint, gsonClass);
} catch (Exception e) {
LOG.warn(FAILED_TO_REQUEST_BEGIN_MSG + endPoint, e);
return Optional.empty();
}
}
@Override
public void checkApiEndpoint(GithubAppConfiguration githubAppConfiguration) {
if (StringUtils.isBlank(githubAppConfiguration.getApiEndpoint())) {
throw new IllegalArgumentException("Missing URL");
}
URI apiEndpoint;
try {
apiEndpoint = URI.create(githubAppConfiguration.getApiEndpoint());
} catch (IllegalArgumentException e) {
throw new IllegalArgumentException("Invalid URL, " + e.getMessage());
}
if (!"http".equalsIgnoreCase(apiEndpoint.getScheme()) && !"https".equalsIgnoreCase(apiEndpoint.getScheme())) {
throw new IllegalArgumentException("Only http and https schemes are supported");
} else if (!isValidGitHubUrl(apiEndpoint)) {
throw new IllegalArgumentException("Invalid GitHub URL");
}
}
private static boolean isValidGitHubUrl(URI apiEndpoint) {
String host = apiEndpoint.getHost();View on GitHub (pinned to 184c821202)
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
Example fix
// before
GithubAppConfiguration cfg = new GithubAppConfiguration(null, appId, clientId, ...);
// after
GithubAppConfiguration cfg = new GithubAppConfiguration("https://github.example.com/api/v3", appId, clientId, ...); Defensive patterns
Strategy: validation
Validate before calling
// Java: check the endpoint before building the configuration
if (apiEndpoint == null || apiEndpoint.isBlank()) {
throw new IllegalArgumentException("GitHub API endpoint must be set (e.g. https://api.github.com or https://<host>/api/v3)");
} Type guard
// Java: narrow a possibly-blank endpoint
static boolean hasApiEndpoint(GithubAppConfiguration cfg) {
return cfg != null && !StringUtils.isBlank(cfg.getApiEndpoint());
} Try / catch
try {
githubApplicationClient.checkApiEndpoint(githubAppConfiguration);
} catch (IllegalArgumentException e) {
if ("Missing URL".equals(e.getMessage())) {
throw new ConfigurationException("GitHub App API URL is not configured — set it in Administration > ALM Integrations > GitHub");
}
throw e;
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.
Related errors
- Invalid URL, %s
- Invalid appId;
- Missing Client Secret
- %s is not a valid url
- Invalid Azure URL or Personal Access Token
AI-assisted analysis of SonarSource/sonarqube@184c821202 (2026-09-09).
Data as JSON: /api/errors/e676aa7e47ba2870.
Report an issue: GitHub.