flowable/flowable-engine · error · ActivitiIllegalArgumentException
execution tenant id is null
Error message
execution tenant id is null
What it means
ExecutionQueryImpl.executionTenantId throws ActivitiIllegalArgumentException when the tenantId argument is null. Multi-tenant filtering requires an explicit tenant identifier; null is rejected so that an unfiltered multi-tenant query cannot be created accidentally. An empty string is accepted (querying tenants without an id) but null is not.
Solutions
- Resolve and pass a valid tenant id, or pass an empty string "" to intentionally match executions without a tenant
- Only call executionTenantId when tenant filtering is required and the id is known
- Fix tenant resolution (security context, header parsing) so it never yields null unintentionally
Example fix
// before
query.executionTenantId(TenantContext.get());
// after
String tenant = TenantContext.get();
if (tenant != null) {
query.executionTenantId(tenant);
} Defensive patterns
Strategy: validation
Validate before calling
String t = tenantId; if (t == null) { t = ""; } query.executionTenantId(t); Type guard
boolean hasTenant = tenantId != null;
Try / catch
try { q.executionTenantId(tenantId); } catch (ActivitiIllegalArgumentException e) { log.error("tenant resolution returned null"); } Prevention
- Make tenant resolution return "" (no tenant) rather than null
- Verify tenant context exists in request filters/interceptors
- In multi-tenant setups, fail auth if tenant cannot be determined
When it happens
Trigger: Calling query.executionTenantId(tenantId) where tenantId is null — typically a TenantContext/provider returning null for missing tenant information.
Common situations: Multi-tenant deployments where the tenant is resolved from headers/auth and the resolution step returns null for anonymous or system calls; single-tenant deployments upgraded to multi-tenancy without backfilling tenant context.
Related errors
- Business key is null
- decision tenantId is null
- deploymentTenantId is null
- deploymentTenantId is null
- deploymentTenantIdLike is null
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/1b3e7bc6dd71c6ee.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable5-engine/src/main/java/org/activiti/engine/impl/ExecutionQueryImpl.java:212
if (activityId != null) {
isActive = true;
}
return this;
}
@Override
public ExecutionQueryImpl parentId(String parentId) {
if (parentId == null) {
throw new ActivitiIllegalArgumentException("Parent id is null");
}
this.parentId = parentId;
return this;
}
@Override
public ExecutionQueryImpl executionTenantId(String tenantId) {
if (tenantId == null) {
throw new ActivitiIllegalArgumentException("execution tenant id is null");
}
this.tenantId = tenantId;
return this;
}
@Override
public ExecutionQueryImpl executionTenantIdLike(String tenantIdLike) {
if (tenantIdLike == null) {
throw new ActivitiIllegalArgumentException("execution tenant id is null");
}
this.tenantIdLike = tenantIdLike;
return this;
}
@Override
public ExecutionQueryImpl executionWithoutTenantId() {
this.withoutTenantId = true;
return this;View on GitHub (pinned to d6d39ce1c6)