{"record":{"id":"3889d572994b0440","repo":"SonarSource/sonarqube","slug":"entity-of-type-s-is-not-supported","errorCode":null,"errorMessage":"Entity of type '%s' is not supported","messagePattern":"Entity of type '(.+?)' is not supported","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":400,"severity":"error","filePath":"server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/ws/TagsAction.java","lineNumber":142,"sourceCode":"      .filter(e -> !e.getQualifier().equals(ComponentQualifiers.SUBVIEW));\n  }\n\n  private void checkIfAnyComponentsNeedIssueSync(DbSession session, @Nullable String projectKey) {\n    if (projectKey != null) {\n      issueIndexSyncProgressChecker.checkIfComponentNeedIssueSync(session, projectKey);\n    } else {\n      issueIndexSyncProgressChecker.checkIfIssueSyncInProgress(session);\n    }\n  }\n\n  private List<String> searchTags(@Nullable EntityDto entity, @Nullable BranchDto branch, Request request, boolean all, DbSession dbSession) {\n    IssueQuery.Builder issueQueryBuilder = IssueQuery.builder()\n      .types(ISSUE_TYPE_NAMES);\n    if (entity != null) {\n      switch (entity.getQualifier()) {\n        case ComponentQualifiers.PROJECT -> issueQueryBuilder.projectUuids(Set.of(entity.getUuid()));\n        case ComponentQualifiers.VIEW, ComponentQualifiers.APP -> issueQueryBuilder.viewUuids(Set.of(entity.getUuid()));\n        default -> throw new IllegalArgumentException(String.format(\"Entity of type '%s' is not supported\", entity.getQualifier()));\n      }\n\n      if (branch != null && !branch.isMain()) {\n        issueQueryBuilder.branchUuid(branch.getUuid());\n        issueQueryBuilder.mainBranch(false);\n      } else if (ComponentQualifiers.APP.equals(entity.getQualifier())) {\n        dbClient.branchDao().selectMainBranchByProjectUuid(dbSession, entity.getUuid())\n          .ifPresent(b -> issueQueryBuilder.branchUuid(b.getUuid()));\n      }\n    }\n    if (all) {\n      issueQueryBuilder.mainBranch(null);\n    }\n\n    return issueIndex.searchTags(\n      issueQueryBuilder.build(),\n      request.param(TEXT_QUERY),\n      request.mandatoryParamAsInt(PAGE_SIZE));","sourceCodeStart":124,"sourceCodeEnd":160,"githubUrl":"https://github.com/SonarSource/sonarqube/blob/184c821202192afc1c599fc912d0889b69fffa53/server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/ws/TagsAction.java#L124-L160","documentation":"Thrown by api/issues/tags when the 'component' parameter resolves to an entity whose qualifier is neither PROJECT nor VIEW/APP. Tag searches support only these entity types; files, directories, and other qualifiers are rejected with IllegalArgumentException (HTTP 400).","triggerScenarios":"Calling GET api/issues/tags with component=<file or directory key>; passing component keys of types not handled by the switch statement.","commonSituations":"Trying to list tags for a single file's issues; reusing scripts that assumed component granularity; keys that resolved to projects in older versions but to sub-components after scanner/structure changes.","solutions":["Use the top-level project key in the component parameter","For file-level tag data, call api/issues/search with component=<file> and facets=tags instead","Check the qualifier with GET api/components/show before calling"],"exampleFix":"// before\ncurl '.../api/issues/tags?component=com.example:app:src/utils'\n// after\ncurl '.../api/issues/search?component=com.example:app:src/utils&facets=tags'","handlingStrategy":"validation","validationCode":"const comp = await get('/api/components/show', {component: key});\nif (!['TRK','VW','APP'].includes(comp.component.qualifier)) throw new Error('use project/view/app key');","typeGuard":null,"tryCatchPattern":"try { await get('/api/issues/tags', {component: key}); } catch (e) { if (e.status === 400 && e.message.includes('not supported')) { /* fall back to project-level tags or facets */ } else throw e; }","preventionTips":["Resolve to top-level entity keys before entity-scoped endpoints","Use facets=tags on api/issues/search for component-level data","Validate qualifiers in shared API client helpers"],"tags":["sonarqube","issues","webapi","unsupported-entity"],"backgroundTag":"unsupported-operation","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"}