{"record":{"id":"8f12fb90af700c82","repo":"flowable/flowable-engine","slug":"could-not-find-a-deployment-with-id-deploymentid","errorCode":null,"errorMessage":"Could not find a deployment with id '<deploymentId>","messagePattern":"Could not find a deployment with id '<deploymentId>","errorType":"http","errorClass":"FlowableObjectNotFoundException","httpStatus":404,"severity":"error","filePath":"modules/flowable-app-engine-rest/src/main/java/org/flowable/app/rest/service/api/repository/AppDefinitionResourceDataResource.java","lineNumber":80,"sourceCode":"\n        if (appDefinition == null) {\n            throw new FlowableObjectNotFoundException(\"Could not find an app definition with id '\" + appDefinitionId);\n        }\n        if (appDefinition.getDeploymentId() == null) {\n            throw new FlowableException(\"No deployment id available\");\n        }\n        if (appDefinition.getResourceName() == null) {\n            throw new FlowableException(\"No resource name available\");\n        }\n        \n        if (restApiInterceptor != null) {\n            restApiInterceptor.accessAppDefinitionInfoById(appDefinition);\n        }\n\n        // Check if deployment exists\n        AppDeployment deployment = appRepositoryService.createDeploymentQuery().deploymentId(appDefinition.getDeploymentId()).singleResult();\n        if (deployment == null) {\n            throw new FlowableObjectNotFoundException(\"Could not find a deployment with id '\" + appDefinition.getDeploymentId());\n        }\n\n        List<String> resourceList = appRepositoryService.getDeploymentResourceNames(appDefinition.getDeploymentId());\n\n        if (resourceList.contains(appDefinition.getResourceName())) {\n            final InputStream resourceStream = appRepositoryService.getResourceAsStream(\n                    appDefinition.getDeploymentId(), appDefinition.getResourceName());\n\n            response.setContentType(\"application/json\");\n            try {\n                return IOUtils.toByteArray(resourceStream);\n            } catch (Exception e) {\n                throw new FlowableException(\"Error converting resource stream\", e);\n            }\n            \n        } else {\n            // Resource not found in deployment\n            throw new FlowableObjectNotFoundException(\"Could not find a resource with id '\" +","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-app-engine-rest/src/main/java/org/flowable/app/rest/service/api/repository/AppDefinitionResourceDataResource.java#L62-L98","documentation":"Thrown by HistoricTaskInstanceQuery.taskAssigneeIds(Collection) when the assignee collection is non-null but contains no elements. An empty IN clause is invalid SQL, so the builder rejects empty lists explicitly. At least one assignee id must be supplied.","triggerScenarios":"Calling taskAssigneeIds(new ArrayList<>()) / List.of(), or passing a collection that became empty after filtering (e.g., removing deactivated users left nothing).","commonSituations":"A multi-select with no users chosen; a team with zero members; a stream().filter(...) that removed all entries before the query is built.","solutions":["Guard with !assignees.isEmpty() before calling taskAssigneeIds; omit the filter when empty.","Return an empty query result early (don't execute the query) when there are no assignees to filter by.","Ensure upstream logic only invokes the query builder when at least one assignee id exists."],"exampleFix":"// before\nquery.taskAssigneeIds(assignees); // can be empty\n\n// after\nif (assignees != null && !assignees.isEmpty()) {\n    query.taskAssigneeIds(assignees);\n}","handlingStrategy":"validation","validationCode":"if (assignees == null || assignees.isEmpty()) {\n    return Collections.emptyList(); // nothing to filter by\n}\nquery.taskAssigneeIds(assignees);","typeGuard":"static boolean isApplicable(Collection<String> c) { return c != null && !c.isEmpty(); }","tryCatchPattern":"try {\n    query.taskAssigneeIds(assignees);\n} catch (FlowableIllegalArgumentException e) {\n    if (e.getMessage().contains(\"empty\")) { return Collections.emptyList(); }\n    throw e;\n}","preventionTips":["Skip the filter entirely when the assignee list is empty","Return an empty result early for empty selection inputs","Add tests covering empty and null collection filter paths"],"tags":["flowable","query-builder","empty-collection","validation"],"backgroundTag":"empty-required-field","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}