SonarSource/sonarqube · error · IllegalStateException

Github configuration is not complete. Please check your conf

Error message

Github configuration is not complete. Please check your configuration under the Authentication > GitHub tab

What it means

Thrown by githubAppConfiguration when parseLong(settings.appId()) fails because the configured GitHub App ID is not a numeric string. It wraps the NumberFormatException into a friendlier IllegalStateException pointing admins to the GitHub auth configuration page.

Source

Thrown at server/sonar-auth-github/src/main/java/org/sonar/auth/github/GitHubIdentityProvider.java:191

  private boolean isOrganizationMembershipRequired() {
    return !settings.getOrganizations().isEmpty();
  }

  private boolean isMemberOfInstallationOrganization(Set<String> userOrganizationNames) {
    GithubAppConfiguration githubAppConfiguration = githubAppConfiguration();
    List<GithubAppInstallation> githubAppInstallations = githubAppClient.getWhitelistedGithubAppInstallations(githubAppConfiguration);
    return githubAppInstallations.stream()
      .map(GithubAppInstallation::organizationName)
      .anyMatch(userOrganizationNames::contains);
  }

  private GithubAppConfiguration githubAppConfiguration() {
    String apiEndpoint = Optional.ofNullable(settings.apiURL()).orElse(DEFAULT_API_URL);
    try {
      return new GithubAppConfiguration(parseLong(settings.appId()), settings.privateKey(), apiEndpoint);
    } catch (NumberFormatException numberFormatException) {
      throw new IllegalStateException("Github configuration is not complete. Please check your configuration under the Authentication > GitHub tab");
    }
  }

  private ServiceBuilder newScribeBuilder(OAuth2IdentityProvider.OAuth2Context context) {
    checkState(isEnabled(), "GitHub authentication is disabled");
    return new ServiceBuilder(settings.clientId())
      .apiSecret(settings.clientSecret())
      .callback(context.getCallbackUrl());
  }

}

View on GitHub (pinned to 184c821202)

Solutions

  1. Set sonar.auth.github.app-id to the numeric App ID from the GitHub App settings page (General > About > App ID).
  2. Do not confuse the App ID with the Client ID (Iv1...) — use the numeric value only.
  3. Trim whitespace/invisible characters from the configured value.
  4. Also verify sonar.auth.github.private-key is set, since it is required together with the App ID.

Example fix

// before
sonar.auth.github.app-id=Iv1.abc123def456
// after
sonar.auth.github.app-id=123456
Defensive patterns

Strategy: validation

Validate before calling

// Validate the app-id is numeric before initializing the provider
if (settings.appId() == null || !settings.appId().matches("\\d+")) {
    throw new IllegalArgumentException("sonar.auth.github.app-id must be the numeric GitHub App ID");
}

Try / catch

try {
    GithubAppConfiguration cfg = githubAppConfiguration();
} catch (IllegalStateException e) {
    LOG.error("GitHub App settings invalid: {}", e.getMessage());
}

Prevention

When it happens

Trigger: GitHub auth provider initializes and settings.appId() contains a non-numeric value (e.g. the app's slug/name instead of the numeric App ID, or a leftover client ID pasted into the App ID field).

Common situations: Admin pasted the GitHub App's client ID (starts with 'Iv1...') or the app slug into the App ID field; whitespace or invisible characters in the setting; field left as placeholder text.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


AI-assisted analysis of SonarSource/sonarqube@184c821202 (2026-09-09). Data as JSON: /api/errors/e426f3984537d86a. Report an issue: GitHub.