SonarSource/sonarqube · error · IllegalArgumentException

unsupported DevOps Platform

Error message

unsupported DevOps Platform %s

What it means

IllegalArgumentException thrown by CheckPatAction.doHandle when the ALM setting's platform type (almSettingDto.getAlm()) is not one of the explicitly handled DevOps platforms (e.g. Azure DevOps, Bitbucket Server/Cloud); GITHUB and any unknown value fall into the default case. The endpoint validates a personal access token only for supported platforms.

Solutions

  1. Use the GitHub-specific validation path (validate the token via the GitHub app settings flow) instead of this endpoint
  2. Verify the alm setting's type in Administration > DevOps Platform integrations
  3. Correct any corrupted alm value in the ALM_SETTINGS table
  4. Upgrade SonarQube if a newer version supports this platform for PAT validation
Defensive patterns

Strategy: validation

Validate before calling

// client-side guard: only call check_pat for supported ALM types
Set<String> supported = Set.of("azure", "bitbucket", "bitbucketcloud", "bitbucketserver");
if (!supported.contains(almType.toLowerCase())) {
    throw new IllegalArgumentException("PAT validation unsupported for " + almType);
}

Try / catch

try {
    api.checkPat(almSettingId, pat);
} catch (ServerErrorException e) { // 400/500 mapped from IllegalArgumentException
    // fall back to platform-specific validation (e.g. GitHub app token check)
}

Prevention

When it happens

Trigger: Calling the check PAT Web API (api/alm_integration/check_pat or equivalent) with an almSettings configured for GitHub, or with a corrupted/unknown alm value in the ALM_SETTINGS table.

Common situations: Admins mistakenly testing a GitHub PAT through the PAT validation endpoint, legacy/unknown enum values in alm settings after upgrades or manual DB edits.

Related errors


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

Appendix: source

Thrown at server/sonar-webserver-webapi/src/main/java/org/sonar/server/almintegration/ws/CheckPatAction.java:128

        case BITBUCKET:
          // Do an authenticate call to Bitbucket Server to validate that the user's personal access token is valid
          bitbucketServerRestClient.getRecentRepo(
            requireNonNull(almSettingDto.getUrl(), URL_CANNOT_BE_NULL),
            requireNonNull(almPatDto.getPersonalAccessToken(), PAT_CANNOT_BE_NULL));
          break;
        case GITLAB:
          gitlabApplicationClient.checkReadPermission(
            requireNonNull(almSettingDto.getUrl(), URL_CANNOT_BE_NULL),
            requireNonNull(almPatDto.getPersonalAccessToken(), PAT_CANNOT_BE_NULL));
          break;
        case BITBUCKET_CLOUD:
          bitbucketCloudRestClient.validateApiToken(
            requireNonNull(almPatDto.getPersonalAccessToken(), API_TOKEN_CANNOT_BE_NULL),
            requireNonNull(almSettingDto.getAppId(), WORKSPACE_CANNOT_BE_NULL));
          break;
        case GITHUB:
        default:
          throw new IllegalArgumentException(String.format("unsupported DevOps Platform %s", almSettingDto.getAlm()));
      }

    }
  }

}

View on GitHub (pinned to 184c821202)