flowable/flowable-engine · error · FlowableIllegalArgumentException
tenant id is null
Error message
tenant id is null
What it means
EventSubscriptionQueryImpl.tenantId() rejects null tenant identifiers. Flowable throws FlowableIllegalArgumentException because a null tenantId is ambiguous (multi-tenancy filters must be an explicit string, possibly the empty-ish default). Null filtering is intentionally disallowed on this setter.
Solutions
- Resolve a valid tenant id string before calling tenantId(), or fall back to the tenant provider's default
- Skip the tenantId() call entirely if no tenant filter should be applied
- Fix the tenant resolution (auth context/header extraction) so it never returns null here
Example fix
// before
query.tenantId(tenantContext.getCurrentTenantId());
// after
String tenantId = tenantContext.getCurrentTenantId();
if (tenantId != null) {
query.tenantId(tenantId);
} Defensive patterns
Strategy: validation
Validate before calling
if (tenantId == null || tenantId.isBlank()) {
throw new IllegalStateException("no tenant context available");
} Type guard
boolean hasTenant(String t) { return t != null && !t.isBlank(); } Try / catch
try {
query.tenantId(tenantId);
} catch (FlowableIllegalArgumentException e) {
log.warn("tenantId null", e);
} Prevention
- Resolve tenant context before building tenant-scoped queries
- Skip tenantId() when the query should be unscoped
- Guard tenant resolvers so they return defaults instead of null
When it happens
Trigger: Calling eventSubscriptionQuery.tenantId(null), commonly when the tenant id comes from an unauthenticated context, a missing header (e.g. X-Tenant-Id), or a tenant resolver that returned null.
Common situations: Multi-tenant applications where tenant context is not yet established; copying code that used tenantIdLike or ignored tenant filtering and passing an unset variable.
Related errors
- activity tenant id is null
- tenant id is null
- tenant ids is null
- tenantId is null
- activity tenant id is null
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/a934f052f6ff766c.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable-eventsubscription-service/src/main/java/org/flowable/eventsubscription/service/impl/EventSubscriptionQueryImpl.java:394
@Override
public EventSubscriptionQueryImpl createdAfter(Date afterTime) {
if (afterTime == null) {
throw new FlowableIllegalArgumentException("created after time is null");
}
if (inOrStatement) {
this.currentOrQueryObject.createdAfter = afterTime;
} else {
this.createdAfter = afterTime;
}
return this;
}
@Override
public EventSubscriptionQueryImpl tenantId(String tenantId) {
if (tenantId == null) {
throw new FlowableIllegalArgumentException("tenant id is null");
}
if (inOrStatement) {
this.currentOrQueryObject.tenantId = tenantId;
} else {
this.tenantId = tenantId;
}
return this;
}
@Override
public EventSubscriptionQuery tenantIds(Collection<String> tenantIds) {
if (tenantIds == null) {
throw new FlowableIllegalArgumentException("tenant ids is null");
}
if (inOrStatement) {View on GitHub (pinned to d6d39ce1c6)