{"record":{"id":"cf2b556f7193f4d1","repo":"SonarSource/sonarqube","slug":"unsupported-devops-platform-s","errorCode":null,"errorMessage":"unsupported DevOps Platform %s","messagePattern":"unsupported DevOps Platform (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":400,"severity":"error","filePath":"server/sonar-webserver-webapi/src/main/java/org/sonar/server/almintegration/ws/CheckPatAction.java","lineNumber":128,"sourceCode":"        case BITBUCKET:\n          // Do an authenticate call to Bitbucket Server to validate that the user's personal access token is valid\n          bitbucketServerRestClient.getRecentRepo(\n            requireNonNull(almSettingDto.getUrl(), URL_CANNOT_BE_NULL),\n            requireNonNull(almPatDto.getPersonalAccessToken(), PAT_CANNOT_BE_NULL));\n          break;\n        case GITLAB:\n          gitlabApplicationClient.checkReadPermission(\n            requireNonNull(almSettingDto.getUrl(), URL_CANNOT_BE_NULL),\n            requireNonNull(almPatDto.getPersonalAccessToken(), PAT_CANNOT_BE_NULL));\n          break;\n        case BITBUCKET_CLOUD:\n          bitbucketCloudRestClient.validateApiToken(\n            requireNonNull(almPatDto.getPersonalAccessToken(), API_TOKEN_CANNOT_BE_NULL),\n            requireNonNull(almSettingDto.getAppId(), WORKSPACE_CANNOT_BE_NULL));\n          break;\n        case GITHUB:\n        default:\n          throw new IllegalArgumentException(String.format(\"unsupported DevOps Platform %s\", almSettingDto.getAlm()));\n      }\n\n    }\n  }\n\n}\n","sourceCodeStart":110,"sourceCodeEnd":135,"githubUrl":"https://github.com/SonarSource/sonarqube/blob/184c821202192afc1c599fc912d0889b69fffa53/server/sonar-webserver-webapi/src/main/java/org/sonar/server/almintegration/ws/CheckPatAction.java#L110-L135","documentation":"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.","triggerScenarios":"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.","commonSituations":"Admins mistakenly testing a GitHub PAT through the PAT validation endpoint, legacy/unknown enum values in alm settings after upgrades or manual DB edits.","solutions":["Use the GitHub-specific validation path (validate the token via the GitHub app settings flow) instead of this endpoint","Verify the alm setting's type in Administration > DevOps Platform integrations","Correct any corrupted alm value in the ALM_SETTINGS table","Upgrade SonarQube if a newer version supports this platform for PAT validation"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// client-side guard: only call check_pat for supported ALM types\nSet<String> supported = Set.of(\"azure\", \"bitbucket\", \"bitbucketcloud\", \"bitbucketserver\");\nif (!supported.contains(almType.toLowerCase())) {\n    throw new IllegalArgumentException(\"PAT validation unsupported for \" + almType);\n}","typeGuard":null,"tryCatchPattern":"try {\n    api.checkPat(almSettingId, pat);\n} catch (ServerErrorException e) { // 400/500 mapped from IllegalArgumentException\n    // fall back to platform-specific validation (e.g. GitHub app token check)\n}","preventionTips":["Check the integration type before invoking PAT validation","Use the GitHub-specific validation flow for GitHub integrations","Avoid manually editing alm values in the database"],"tags":["java","devops-platform","enum"],"backgroundTag":"unsupported-enum-value","analyzedSha":"184c821202192afc1c599fc912d0889b69fffa53","analyzedAt":"2026-09-09T12:23:51.573Z","contentChangedAt":"2026-09-09T12:23:51.573Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}