{"record":{"id":"c8b6846a44d9c000","repo":"flowable/flowable-engine","slug":"exception-while-autodeploying-event-definitions-fo","errorCode":null,"errorMessage":"Exception while autodeploying event definitions for resource {}. This exception can be ignored if the root cause indicates a unique constraint violation, which is typically caused by two (or more) servers booting up at the exact same time and deploying the same definitions. ","messagePattern":"Exception while autodeploying event definitions for resource (.+?)\\. This exception can be ignored if the root cause indicates a unique constraint violation, which is typically caused by two \\(or more\\) servers booting up at the exact same time and deploying the same definitions\\. ","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"modules/flowable-event-registry-spring/src/main/java/org/flowable/eventregistry/spring/autodeployment/SingleResourceAutoDeploymentStrategy.java","lineNumber":68,"sourceCode":"    protected void deployResourcesInternal(String deploymentNameHint, Resource[] resources, EventRegistryEngine engine) {\n        EventRepositoryService repositoryService = engine.getEventRepositoryService();\n\n        // Create a separate deployment for each resource using the resource name\n\n        for (final Resource resource : resources) {\n\n            final String resourceName = determineResourceName(resource);\n            final EventDeploymentBuilder deploymentBuilder = repositoryService.createDeployment().enableDuplicateFiltering().name(resourceName);\n            addResource(resource, resourceName, deploymentBuilder);\n            try {\n\n                deploymentBuilder.deploy();\n\n            } catch (RuntimeException e) {\n                if (isThrowExceptionOnDeploymentFailure()) {\n                    throw e;\n                } else {\n                    LOGGER.warn(\"Exception while autodeploying event definitions for resource {}. \"\n                        + \"This exception can be ignored if the root cause indicates a unique constraint violation, \"\n                        + \"which is typically caused by two (or more) servers booting up at the exact same time and deploying the same definitions. \", resource, e);\n                }\n\n            }\n        }\n    }\n\n}\n","sourceCodeStart":50,"sourceCodeEnd":78,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-event-registry-spring/src/main/java/org/flowable/eventregistry/spring/autodeployment/SingleResourceAutoDeploymentStrategy.java#L50-L78","documentation":"SingleResourceAutoDeploymentStrategy deploys each event-registry resource at application startup. If deploymentBuilder.deploy() throws a RuntimeException and isThrowExceptionOnDeploymentFailure() is false (the default), the exception is logged as a warning and startup continues. This is intentional so that a unique-constraint race between simultaneously booting servers does not block startup.","triggerScenarios":"Spring auto-deployment of event definitions via EventRegistryEngineConfigurer/auto-deploy config where deploy() throws (duplicate deployment, invalid definition JSON/XSD, DB constraint violation) with throwExceptionOnDeploymentFailure=false.","commonSituations":"Two app instances starting at the exact same moment deploying identical definitions (unique constraint violation); invalid event-registry resource files in the configured deployment resources location; database schema problems at boot.","solutions":["Read the cause logged with the WARN: if it is a unique-constraint violation, it is safe to ignore — another node already deployed the same definitions","If the cause is a validation/parse error, fix the invalid event definition resource and redeploy","Set flowable.event-registry.deployment.throw-exception-on-deployment-failure=true (via EventRegistryAutoDeploymentStrategy/property) to fail fast during development","Ensure only one node performs auto-deployment at boot (deployment lock or pre-migration step) if the race keeps occurring"],"exampleFix":"# before (default: silent)\n# nothing set, failures hidden at startup\n# after\nflowable.event-registry.deployment.throw-exception-on-deployment-failure=true","handlingStrategy":"try-catch","validationCode":"// validate resources before enabling auto-deploy\nfor (Resource r : resources) {\n    try (var in = r.getInputStream()) {\n        new DefaultEventJsonConverter().convertToEventRegistryModel(in); // throws if invalid\n    }\n}","typeGuard":null,"tryCatchPattern":"try {\n    deploymentBuilder.deploy();\n} catch (RuntimeException e) {\n    if (isUniqueConstraintViolation(e)) {\n        log.info(\"Definitions already deployed by another node; ignoring\", e);\n    } else {\n        throw e; // fail fast on real errors\n    }\n}","preventionTips":["Set throw-exception-on-deployment-failure=true in dev so real errors surface","Perform auto-deployment from a single node or behind a deployment lock","Validate event definition JSON before packaging it into the deployment resources","Check the logged cause: unique-constraint violations are benign in this path"],"tags":["flowable","auto-deployment","spring","startup","event-registry"],"backgroundTag":"database-write-failed","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}