{"record":{"id":"f2c56f5ad90dfd83","repo":"flowable/flowable-engine","slug":"could-not-find-an-app-deployment-with-id-deploym","errorCode":null,"errorMessage":"Could not find an app deployment with id '<deploymentId>","messagePattern":"Could not find an app 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/AppDeploymentResource.java","lineNumber":61,"sourceCode":"    protected AppRestResponseFactory appRestResponseFactory;\n\n    @Autowired\n    protected AppRepositoryService appRepositoryService;\n    \n    @Autowired(required=false)\n    protected AppRestApiInterceptor restApiInterceptor;\n\n    @ApiOperation(value = \"Get an app deployment\", tags = { \"App Deployments\" })\n    @ApiResponses(value = {\n            @ApiResponse(code = 200, message = \"Indicates the app deployment was found and returned.\"),\n            @ApiResponse(code = 404, message = \"Indicates the requested app deployment was not found.\")\n    })\n    @GetMapping(value = \"/app-repository/deployments/{deploymentId}\", produces = \"application/json\")\n    public AppDeploymentResponse getAppDeployment(@ApiParam(name = \"deploymentId\") @PathVariable String deploymentId) {\n        AppDeployment deployment = appRepositoryService.createDeploymentQuery().deploymentId(deploymentId).singleResult();\n\n        if (deployment == null) {\n            throw new FlowableObjectNotFoundException(\"Could not find an app deployment with id '\" + deploymentId);\n        }\n        \n        if (restApiInterceptor != null) {\n            restApiInterceptor.accessDeploymentById(deployment);\n        }\n\n        return appRestResponseFactory.createAppDeploymentResponse(deployment);\n    }\n\n    @ApiOperation(value = \"Delete an app deployment\", tags = { \"App Deployments\" }, code = 204)\n    @ApiResponses(value = {\n            @ApiResponse(code = 204, message = \"Indicates the App deployment was found and has been deleted. Response-body is intentionally empty.\"),\n            @ApiResponse(code = 404, message = \"Indicates the requested app deployment was not found.\")\n    })\n    @DeleteMapping(value = \"/app-repository/deployments/{deploymentId}\", produces = \"application/json\")\n    @ResponseStatus(HttpStatus.NO_CONTENT)\n    public void deleteAppDeployment(@ApiParam(name = \"deploymentId\") @PathVariable String deploymentId) {\n        AppDeployment deployment = appRepositoryService.createDeploymentQuery().deploymentId(deploymentId).singleResult();","sourceCodeStart":43,"sourceCodeEnd":79,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-app-engine-rest/src/main/java/org/flowable/app/rest/service/api/repository/AppDeploymentResource.java#L43-L79","documentation":"Thrown by AppDeploymentResource.getAppDeployment when no app deployment with the given deploymentId exists in the app engine repository: the deployment query returns null. Flowable signals this with FlowableObjectNotFoundException so REST clients get a not-found outcome rather than a null dereference.","triggerScenarios":"GET /app-repository/deployments/{deploymentId} with an id that was never deployed, was deleted, or belongs to a different engine/database than the one this REST app is configured against.","commonSituations":"Stale ids cached in clients after cleanup; pointing at the wrong database schema or tenant; case-mismatched ids; environment drift between dev and prod deployments.","solutions":["List valid deployments via GET /app-repository/deployments and use an id from the response.","Verify the REST app's datasource points at the database where the deployment was made.","Catch FlowableObjectNotFoundException and map it to HTTP 404 in your client.","Check whether the deployment was deleted (deleteAppDeployment) or purged by housekeeping."],"exampleFix":"// before\nAppDeploymentResponse d = restTemplate.getForObject(\"/app-repository/deployments/\" + id, AppDeploymentResponse.class);\n// after\ntry {\n    AppDeploymentResponse d = restTemplate.getForObject(\"/app-repository/deployments/\" + id, AppDeploymentResponse.class);\n} catch (HttpClientErrorException.NotFound e) {\n    // handle unknown deployment id\n}","handlingStrategy":"try-catch","validationCode":"// Confirm the deployment exists before fetching details\nResponseEntity<List<AppDeploymentResponse>> list = restTemplate.exchange(\n  \"/app-repository/deployments\", HttpMethod.GET, null,\n  new ParameterizedTypeReference<List<AppDeploymentResponse>>() {});\nboolean known = list.getBody().stream().anyMatch(d -> d.getId().equals(deploymentId));","typeGuard":null,"tryCatchPattern":"try {\n    return restTemplate.getForObject(\"/app-repository/deployments/\" + id, AppDeploymentResponse.class);\n} catch (HttpClientErrorException.NotFound e) {\n    return Optional.empty(); // deployment does not exist\n}","preventionTips":["Resolve ids from the deployments list API, not from memory.","Catch FlowableObjectNotFoundException / 404 explicitly.","Verify you are querying the correct engine and database.","Account for deployments deleted by other jobs or clients."],"tags":["rest","not-found","deployment","flowable"],"backgroundTag":"entity-not-found","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"}