{"record":{"id":"10d1101b97164d01","repo":"flowable/flowable-engine","slug":"no-deployment-found-for-id-deploymentid-10d110","errorCode":null,"errorMessage":"No deployment found for id = '${deploymentId}'","messagePattern":"No deployment found for id = '(.+?)'","errorType":"validation","errorClass":"FlowableObjectNotFoundException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/SetDeploymentKeyCmd.java","lineNumber":53,"sourceCode":"    protected String key;\r\n\r\n    public SetDeploymentKeyCmd(String deploymentId, String key) {\r\n        this.deploymentId = deploymentId;\r\n        this.key = key;\r\n    }\r\n\r\n    @Override\r\n    public Void execute(CommandContext commandContext) {\r\n\r\n        if (deploymentId == null) {\r\n            throw new FlowableIllegalArgumentException(\"Deployment id is null\");\r\n        }\r\n\r\n        ProcessEngineConfigurationImpl processEngineConfiguration = CommandContextUtil.getProcessEngineConfiguration(commandContext);\r\n        DeploymentEntity deployment = processEngineConfiguration.getDeploymentEntityManager().findById(deploymentId);\r\n\r\n        if (deployment == null) {\r\n            throw new FlowableObjectNotFoundException(\"No deployment found for id = '\" + deploymentId + \"'\", Deployment.class);\r\n        }\r\n\r\n        if (Flowable5Util.isFlowable5Deployment(deployment, commandContext)) {\r\n            throw new FlowableException(\"Not supported for version 5 deployments\");\r\n        }\r\n\r\n        // Update category\r\n        deployment.setKey(key);\r\n\r\n        FlowableEventDispatcher eventDispatcher = processEngineConfiguration.getEventDispatcher();\r\n        if (eventDispatcher != null && eventDispatcher.isEnabled()) {\r\n            eventDispatcher.dispatchEvent(FlowableEventBuilder.createEntityEvent(FlowableEngineEventType.ENTITY_UPDATED, deployment),\r\n                    processEngineConfiguration.getEngineCfgKey());\r\n        }\r\n\r\n        return null;\r\n    }\r\n\r","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/SetDeploymentKeyCmd.java#L35-L71","documentation":"SetDeploymentKeyCmd.execute throws FlowableObjectNotFoundException when findById(deploymentId) returns no deployment. The message embeds the requested id and the type Deployment.class. Analogous to the category variant (error 2425) but for setting the deployment key.","triggerScenarios":"Calling repositoryService.setDeploymentKey(deploymentId, key) with an id for a deployment that does not exist in the engine's database.","commonSituations":"Id from a deleted/cleaned-up deployment; pointing the engine at a different database; typo or stale reference in configuration or code.","solutions":["Check existence with repositoryService.createDeploymentQuery().deploymentId(id).count() > 0 before calling.","Re-fetch the current deployment id after any redeploy or cleanup.","Verify the flowable database configuration matches the environment the deployment was made in."],"exampleFix":"// before\nrepositoryService.setDeploymentKey(deletedId, \"key\");\n// after\nDeployment d = repositoryService.createDeploymentQuery().deploymentId(deletedId).singleResult();\nif (d != null) {\n    repositoryService.setDeploymentKey(deletedId, \"key\");\n}","handlingStrategy":"try-catch","validationCode":"Deployment d = repositoryService.createDeploymentQuery().deploymentId(deploymentId).singleResult();\nif (d == null) {\n    throw new IllegalStateException(\"No deployment with id \" + deploymentId);\n}\nrepositoryService.setDeploymentKey(deploymentId, key);","typeGuard":null,"tryCatchPattern":"try {\n    repositoryService.setDeploymentKey(deploymentId, key);\n} catch (FlowableObjectNotFoundException e) {\n    // deployment removed or wrong database; re-derive id from a fresh query\n    log.warn(\"Deployment missing: {}\", e.getMessage());\n}","preventionTips":["Existence-check deployments before administrative operations.","After database swaps or migrations, refresh all stored deployment ids.","Log the id from the exception message when diagnosing missing deployments."],"tags":["flowable","deployment","not-found","resource"],"backgroundTag":"resource-not-found","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}