flowable/flowable-engine · error · FlowableIllegalArgumentException

tenant ids is null

Error message

tenant ids is null

What it means

EventSubscriptionQuery.tenantIds() requires a non-null Collection of tenant ids. Flowable throws FlowableIllegalArgumentException when the collection is null; an empty collection is accepted but null is not, since null cannot form an IN predicate. The framework distinguishes 'no filter' (don't call) from 'null filter' (error).

Solutions

  1. Pass an empty collection instead of null when no tenants are applicable, or skip the call
  2. Default the collection with Collections.emptyList() at the source
  3. Fix the deserialization/config loading so tenantIds defaults to an empty list, never null

Example fix

// before
query.tenantIds(config.getTenantIds());

// after
query.tenantIds(config.getTenantIds() != null ? config.getTenantIds() : Collections.emptyList());
Defensive patterns

Strategy: validation

Validate before calling

if (tenantIds == null) {
    tenantIds = Collections.emptyList();
}

Type guard

boolean validTenantIds(Collection<String> c) { return c != null && c.stream().allMatch(Objects::nonNull); }

Try / catch

try {
    query.tenantIds(tenantIds);
} catch (FlowableIllegalArgumentException e) {
    log.warn("tenantIds null", e);
}

Prevention

When it happens

Trigger: Calling eventSubscriptionQuery.tenantIds(null), e.g. when the tenant list comes from a nullable configuration property, an empty optional, or a split on a null string.

Common situations: Multi-tenant dashboards where the allowed-tenant list is loaded from config/DB and may be absent; deserializing a request body where tenantIds was omitted and mapped to null.

Related errors


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

Appendix: source

Thrown at modules/flowable-eventsubscription-service/src/main/java/org/flowable/eventsubscription/service/impl/EventSubscriptionQueryImpl.java:409

    @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) {
            this.currentOrQueryObject.tenantIds = tenantIds;
        } else {
            this.tenantIds = tenantIds;
        }

        return this;
    }

    @Override
    public EventSubscriptionQuery withoutTenantId() {
        if (inOrStatement) {
            this.currentOrQueryObject.withoutTenantId = true;
        } else {
            this.withoutTenantId = true;
        }

View on GitHub (pinned to d6d39ce1c6)