{"record":{"id":"8d489aa9c6e5469c","repo":"SonarSource/sonarqube","slug":"no-client-id-for-setting-with-key-s","errorCode":null,"errorMessage":"No client ID for setting with key '%s'","messagePattern":"No client ID for setting with key '(.+?)'","errorType":"exception","errorClass":"NotFoundException","httpStatus":404,"severity":"error","filePath":"server/sonar-webserver-webapi/src/main/java/org/sonar/server/almintegration/ws/github/GetGithubClientIdAction.java","lineNumber":78,"sourceCode":"      .setDescription(\"DevOps Platform setting key\");\n  }\n\n  @Override\n  public void handle(Request request, Response response) {\n    AlmIntegrations.GithubClientIdWsResponse getResponse = doHandle(request);\n    writeProtobuf(getResponse, request, response);\n  }\n\n  private AlmIntegrations.GithubClientIdWsResponse doHandle(Request request) {\n    try (DbSession dbSession = dbClient.openSession(false)) {\n      userSession.checkLoggedIn().checkPermission(PROVISION_PROJECTS);\n\n      String almSettingKey = request.mandatoryParam(PARAM_ALM_SETTING);\n      AlmSettingDto almSetting = dbClient.almSettingDao().selectByKey(dbSession, almSettingKey)\n        .orElseThrow(() -> new NotFoundException(String.format(\"Github Setting '%s' not found\", almSettingKey)));\n\n      if (almSetting.getClientId() == null) {\n        throw new NotFoundException(String.format(\"No client ID for setting with key '%s'\", almSettingKey));\n      }\n      return AlmIntegrations.GithubClientIdWsResponse.newBuilder()\n        .setClientId(almSetting.getClientId())\n        .build();\n    }\n  }\n}\n","sourceCodeStart":60,"sourceCodeEnd":86,"githubUrl":"https://github.com/SonarSource/sonarqube/blob/184c821202192afc1c599fc912d0889b69fffa53/server/sonar-webserver-webapi/src/main/java/org/sonar/server/almintegration/ws/github/GetGithubClientIdAction.java#L60-L86","documentation":"NotFoundException from GetGithubClientIdAction.doHandle when the referenced GitHub DevOps Platform setting exists but has no client ID stored (null). The client ID is only populated for GitHub App (manifest-based) configurations, so plain GitHub PAT settings will hit this.","triggerScenarios":"GET api/alm_integrations/github/client_id?almSetting=<key> where the setting was created manually (no clientId column value) instead of via the GitHub App manifest flow.","commonSituations":"Admin configured GitHub with a PAT/app URL manually and a frontend page then asks for the client id for the OAuth redirect; pointing the call at the wrong setting key.","solutions":["Complete the GitHub App creation via the manifest flow so the client ID gets stored","Create a new GitHub App and record its client ID in the setting","Use a setting key that actually corresponds to a GitHub App configuration"],"exampleFix":"// before\nalmSetting = almSettings.selectByKey('github-pat-setting') // has no clientId\n// after\nalmSetting = almSettings.selectByKey('github-app-setting') // created via manifest, clientId set","handlingStrategy":"try-catch","validationCode":"const settings = await ws.get('api/alm_settings/list');\nconst s = settings.almSettings.find(x => x.key === key);\nif (!s || !s.clientId) throw new Error(`Setting '${key}' has no GitHub App client ID; complete the manifest flow`);","typeGuard":"const hasClientId = (s) => typeof s?.clientId === 'string' && s.clientId.length > 0;","tryCatchPattern":"try {\n  return await ws.get('api/alm_integrations/github/client_id', {almSetting: key});\n} catch (e) {\n  if (e.status === 404 && /No client ID/.test(e.message)) {\n    return null; // fall back to manual GitHub App setup\n  }\n  throw e;\n}","preventionTips":["Create GitHub integrations via the manifest flow so clientId is populated","Verify clientId presence before rendering OAuth-dependent UI","Do not reuse PAT-type settings for GitHub App endpoints"],"tags":["sonarqube","github-app","oauth","missing-field"],"backgroundTag":"missing-config-field","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"}