{"record":{"id":"c3c628e57c7b0778","repo":"SonarSource/sonarqube","slug":"project-s-not-found-c3c628","errorCode":null,"errorMessage":"Project '%s' not found","messagePattern":"Project '(.+?)' not found","errorType":"http","errorClass":"NotFoundException","httpStatus":404,"severity":"error","filePath":"server/sonar-webserver-webapi/src/main/java/org/sonar/server/hotspot/ws/SearchAction.java","lineNumber":366,"sourceCode":"      .setPossibleValues(SANS_TOP_25_INSECURE_INTERACTION, SANS_TOP_25_RISKY_RESOURCE, SANS_TOP_25_POROUS_DEFENSES);\n    action.createParam(PARAM_SONARSOURCE_SECURITY)\n      .setDescription(\"Comma-separated list of SonarSource security categories. Use '\" + SecurityStandards.SQCategory.OTHERS.getKey() +\n        \"' to select issues not associated with any category\")\n      .setSince(\"8.6\")\n      .setPossibleValues(Arrays.stream(SecurityStandards.SQCategory.values()).map(SecurityStandards.SQCategory::getKey).toList());\n    action.createParam(PARAM_CWE)\n      .setDescription(\"Comma-separated list of CWE numbers\")\n      .setExampleValue(\"89,434,352\")\n      .setSince(\"8.8\");\n  }\n\n  private Optional<ProjectAndBranch> getAndValidateProjectOrApplication(DbSession dbSession, WsRequest wsRequest) {\n    return wsRequest.getProjectKey().map(projectKey -> {\n      ProjectAndBranch appOrProjectAndBranch = componentFinder.getAppOrProjectAndBranch(dbSession, projectKey, wsRequest.getBranch().orElse(null),\n        wsRequest.getPullRequest().orElse(null));\n\n      if (!SUPPORTED_QUALIFIERS.contains(appOrProjectAndBranch.getProject().getQualifier())) {\n        throw new NotFoundException(format(\"Project '%s' not found\", projectKey));\n      }\n      userSession.checkEntityPermission(USER, appOrProjectAndBranch.getProject());\n      userSession.checkChildProjectsPermission(USER, appOrProjectAndBranch.getProject());\n      return appOrProjectAndBranch;\n    });\n  }\n\n  private SearchResponseData searchHotspots(WsRequest wsRequest, DbSession dbSession, @Nullable ProjectAndBranch projectorApp) {\n    SearchResponse<Object> result = doIndexSearch(wsRequest, dbSession, projectorApp);\n    List<String> issueKeys = result.hits().hits().stream()\n      .map(Hit::id)\n      .toList();\n\n    List<IssueDto> hotspots = toIssueDtos(dbSession, issueKeys);\n\n    Paging paging = forPageIndex(wsRequest.getPage()).withPageSize(wsRequest.getIndex()).andTotal((int) getTotalHits(result));\n    return new SearchResponseData(paging, hotspots);\n  }","sourceCodeStart":348,"sourceCodeEnd":384,"githubUrl":"https://github.com/SonarSource/sonarqube/blob/184c821202192afc1c599fc912d0889b69fffa53/server/sonar-webserver-webapi/src/main/java/org/sonar/server/hotspot/ws/SearchAction.java#L348-L384","documentation":"Raised by the hotspot search web service when the 'project' parameter resolves to a component whose qualifier is not a supported project/application type (e.g. it is a module, directory, file, or portfolio). SonarQube reports it as NotFound to avoid leaking the existence of non-project components.","triggerScenarios":"Calling GET api/hotspots/search with project=<key> where the key belongs to a non-PROJECT/APP component (module, folder, file), or to a deleted/renamed component; also when branch/pullRequest parameters are invalid for that key.","commonSituations":"Using a component key instead of the project key in a CI script; project key renamed or project deleted after pipeline config was written; old keys pointing to modules removed in newer SonarQube versions (module support dropped); typos in the project key.","solutions":["Verify the key with GET api/components/show?component=<key> and use the top-level project key","Run GET api/projects/search to list valid project keys and correct the script","Remove or fix stale branch/pullRequest parameters","Update CI configuration if the project was renamed or deleted"],"exampleFix":"// before\ncurl '.../api/hotspots/search?project=com.example:my-app:module-core'\n// after\ncurl '.../api/hotspots/search?project=com.example:my-app'","handlingStrategy":"validation","validationCode":"const comp = await get('/api/components/show', {component: projectKey});\nif (!['TRK','APP'].includes(comp.component.qualifier)) throw new Error('not a project/application');","typeGuard":null,"tryCatchPattern":"try { const r = await get('/api/hotspots/search', {project}); } catch (e) { if (e.status === 404) { /* verify key via /api/components/show */ } else throw e; }","preventionTips":["Store project keys (not component keys) in CI config","Re-validate keys after project renames/deletions","Use api/projects/search to discover valid keys"],"tags":["sonarqube","hotspots","webapi","not-found"],"backgroundTag":"resource-not-found","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"}