{"record":{"id":"8de738b59deb6d56","repo":"SonarSource/sonarqube","slug":"there-is-no-alm-configuration-for-devops-platfo","errorCode":null,"errorMessage":"There is no ${alm} configuration for DevOps Platform. Please add one.","messagePattern":"There is no (.+?) configuration for DevOps Platform\\. Please add one\\.","errorType":"exception","errorClass":"NotFoundException","httpStatus":404,"severity":"error","filePath":"server/sonar-webserver-webapi/src/main/java/org/sonar/server/almintegration/ws/ImportHelper.java","lineNumber":85,"sourceCode":"      String almSettingKey = request.param(PARAM_ALM_SETTING);\n      if (almSettingKey != null) {\n        return getAlmSettingDtoFromKey(dbSession, almSettingKey);\n      }\n      return getUniqueAlmSettingDtoForAlm(dbSession, alm);\n    }\n  }\n\n  private AlmSettingDto getAlmSettingDtoFromKey(DbSession dbSession, String almSettingKey) {\n    return dbClient.almSettingDao().selectByKey(dbSession, almSettingKey)\n      .orElseThrow(() -> new NotFoundException(String.format(\"DevOps Platform configuration '%s' not found.\", almSettingKey)));\n  }\n\n  private AlmSettingDto getUniqueAlmSettingDtoForAlm(DbSession dbSession, @Nullable ALM alm) {\n    List<AlmSettingDto> almSettingDtos = getAlmSettingDtos(dbSession, alm);\n\n    if (almSettingDtos.isEmpty()) {\n      String almString = alm == null ? \"\" : (alm.name() + \" \");\n      throw new NotFoundException(\"There is no \" + almString + \"configuration for DevOps Platform. Please add one.\");\n    }\n    if (almSettingDtos.size() == 1) {\n      return almSettingDtos.get(0);\n    }\n    throw new IllegalArgumentException(String.format(\"Parameter %s is required as there are multiple DevOps Platform configurations.\", PARAM_ALM_SETTING));\n  }\n\n  private List<AlmSettingDto> getAlmSettingDtos(DbSession dbSession, @Nullable ALM alm) {\n    if (alm == null) {\n      return dbClient.almSettingDao().selectAll(dbSession);\n    }\n    return dbClient.almSettingDao().selectByAlm(dbSession, alm);\n  }\n\n  public String getUserUuid() {\n    return requireNonNull(userSession.getUuid(), \"User UUID cannot be null.\");\n  }\n","sourceCodeStart":67,"sourceCodeEnd":103,"githubUrl":"https://github.com/SonarSource/sonarqube/blob/184c821202192afc1c599fc912d0889b69fffa53/server/sonar-webserver-webapi/src/main/java/org/sonar/server/almintegration/ws/ImportHelper.java#L67-L103","documentation":"NotFoundException thrown by ImportHelper.getUniqueAlmSettingDtoForAlm when the SonarQube instance has zero DevOps Platform (ALM) configurations matching the requested ALM type (or none at all when alm is null). The server cannot resolve a unique ALM setting to import projects from, so the WS call is rejected with 404 and a message telling the admin to add a configuration.","triggerScenarios":"Calling a web service that uses getAlmSettingDto (e.g. project import from Azure/GitLab/etc.) without passing the almSetting parameter when no configuration of the requested ALM type exists in ALM_SETTINGS table.","commonSituations":"Fresh SonarQube install where no DevOps Platform integration was ever configured; the integration was deleted before running an import; passing an alm parameter whose type has no settings while other ALMs are configured.","solutions":["Go to Administration > DevOps Platform Integrations and create a configuration for the ALM in question before retrying the import","If multiple configurations exist, pass the almSetting parameter naming the desired setting key","Verify the alm parameter spelling matches an ALM you actually configured","Check sonar.alm.allowMultiple feature state if you expect more than one setting"],"exampleFix":"// before\ncurl -u token: 'POST /api/alm_integrations/import_project?url=...'\n// after\n# first configure the DevOps Platform in Administration, or specify the setting\ncurl -u token: 'POST /api/alm_integrations/import_project?url=...&almSetting=my-azure-setting'","handlingStrategy":"validation","validationCode":"const settings = await ws.get('api/alm_settings/list');\nconst matching = settings.almSettings.filter(s => !alm || s.alm === alm);\nif (matching.length === 0) throw new Error(`Configure a ${alm ?? ''} DevOps Platform before importing`);\nif (matching.length > 1 && !almSetting) throw new Error('almSetting param required');","typeGuard":"const hasAlmSetting = (s) => s && typeof s.key === 'string' && s.key.length > 0;","tryCatchPattern":"try {\n  await ws.post('api/alm_integrations/import_project', params);\n} catch (e) {\n  if (e.status === 404 && /no .*configuration for DevOps Platform/.test(e.message)) {\n    throw new Error('Admin must add a DevOps Platform configuration first');\n  }\n  throw e;\n}","preventionTips":["Provision the DevOps Platform configuration before automation runs imports","Pass almSetting explicitly in all scripts","Check api/alm_settings/list at script startup"],"tags":["sonarqube","webapi","devops-platform","config-missing"],"backgroundTag":"missing-configuration","analyzedSha":"184c821202192afc1c599fc912d0889b69fffa53","analyzedAt":"2026-09-09T12:23:51.573Z","contentChangedAt":"2026-09-09T12:23:51.573Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}