SonarSource/sonarqube · error · IllegalStateException

Configuration is not complete

Error message

Configuration is not complete : %s

What it means

Thrown by GithubAppConfiguration.checkConfigurationComplete, invoked from getId/getApiEndpoint/getPrivateKey, when any of the three required GitHub App fields (id, privateKey, apiEndpoint) is null. The message includes toString() of the configuration showing which fields are missing.

Solutions

  1. Set all three required properties: sonar.auth.github.app-id, sonar.auth.github.private-key, and the API endpoint.
  2. Paste the full contents of the GitHub App .pem private key file into the private-key setting.
  3. Check the toString() in the message to see exactly which field is null.
  4. Restart/re-test after completing configuration under Administration > Authentication > GitHub.

Example fix

// before
sonar.auth.github.app-id=123456
// private-key not set -> not complete
// after
sonar.auth.github.app-id=123456
sonar.auth.github.private-key=-----BEGIN RSA PRIVATE KEY-----\nMIIE...\n-----END RSA PRIVATE KEY-----
Defensive patterns

Strategy: validation

Validate before calling

// Pre-validate all required GitHub App fields before use
boolean complete = settings.appId() != null && settings.privateKey() != null && settings.apiURL() != null;
if (!complete) {
    throw new IllegalStateException("Set app-id, private-key and api-url before enabling GitHub App auth");
}

Try / catch

try {
    config.getPrivateKey();
} catch (IllegalStateException e) {
    LOG.error("Incomplete GitHub App configuration: {}", e.getMessage());
}

Prevention

When it happens

Trigger: GitHub App-based auth is initialized and settings.appId(), settings.privateKey(), or the API endpoint is null/absent, so isComplete() returns false and any getter call throws.

Common situations: Admin enabled GitHub authentication but left the App ID or private key blank; private key file content missing or property not set; partial configuration after migration from OAuth-app to GitHub-app mode.

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


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

Appendix: source

Thrown at server/sonar-auth-github/src/main/java/org/sonar/auth/github/GithubAppConfiguration.java:70

  public String getApiEndpoint() {
    checkConfigurationComplete();
    return apiEndpoint;
  }

  /**
   * Check configuration is complete with {@link #isComplete()} before calling this method.
   *
   * @throws IllegalStateException if configuration is not complete
   */
  public String getPrivateKey() {
    checkConfigurationComplete();
    return privateKey;
  }

  private void checkConfigurationComplete() {
    if (!isComplete()) {
      throw new IllegalStateException(format("Configuration is not complete : %s", toString()));
    }
  }

  public boolean isComplete() {
    return id != null &&
      privateKey != null &&
      apiEndpoint != null;
  }

  @Override
  public String toString() {
    return MoreObjects.toStringHelper(GithubAppConfiguration.class)
      .add("id", id)
      .add("privateKey", secureToString(privateKey))
      .add("apiEndpoint", toString(apiEndpoint))
      .toString();
  }

View on GitHub (pinned to 184c821202)