flowable/flowable-engine · warning

Exception while autodeploying event definitions for resource

Error message

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. 

What it means

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.

Solutions

  1. 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
  2. If the cause is a validation/parse error, fix the invalid event definition resource and redeploy
  3. Set flowable.event-registry.deployment.throw-exception-on-deployment-failure=true (via EventRegistryAutoDeploymentStrategy/property) to fail fast during development
  4. Ensure only one node performs auto-deployment at boot (deployment lock or pre-migration step) if the race keeps occurring

Example fix

# before (default: silent)
# nothing set, failures hidden at startup
# after
flowable.event-registry.deployment.throw-exception-on-deployment-failure=true
Defensive patterns

Strategy: try-catch

Validate before calling

// validate resources before enabling auto-deploy
for (Resource r : resources) {
    try (var in = r.getInputStream()) {
        new DefaultEventJsonConverter().convertToEventRegistryModel(in); // throws if invalid
    }
}

Try / catch

try {
    deploymentBuilder.deploy();
} catch (RuntimeException e) {
    if (isUniqueConstraintViolation(e)) {
        log.info("Definitions already deployed by another node; ignoring", e);
    } else {
        throw e; // fail fast on real errors
    }
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11). Data as JSON: /api/errors/c8b6846a44d9c000. Report an issue: GitHub.

Appendix: source

Thrown at modules/flowable-event-registry-spring/src/main/java/org/flowable/eventregistry/spring/autodeployment/SingleResourceAutoDeploymentStrategy.java:68

    protected void deployResourcesInternal(String deploymentNameHint, Resource[] resources, EventRegistryEngine engine) {
        EventRepositoryService repositoryService = engine.getEventRepositoryService();

        // Create a separate deployment for each resource using the resource name

        for (final Resource resource : resources) {

            final String resourceName = determineResourceName(resource);
            final EventDeploymentBuilder deploymentBuilder = repositoryService.createDeployment().enableDuplicateFiltering().name(resourceName);
            addResource(resource, resourceName, deploymentBuilder);
            try {

                deploymentBuilder.deploy();

            } catch (RuntimeException e) {
                if (isThrowExceptionOnDeploymentFailure()) {
                    throw e;
                } else {
                    LOGGER.warn("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. ", resource, e);
                }

            }
        }
    }

}

View on GitHub (pinned to d6d39ce1c6)