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
- 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
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
- 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
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
- A channel key detection value is required for inbound…
- A channel key detection value is required for the channel…
- A resource name is mandatory
- An event definition key is mandatory
- Can only use a collection of String elements for…
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)