flowable/flowable-engine · error · ActivitiIllegalArgumentException

Provided tentant id is null

Error message

Provided tentant id is null

What it means

TimerJobQuery.jobTenantId(String) throws ActivitiIllegalArgumentException when the tenant id is null. Tenant ids scope jobs in multi-tenant deployments; a null tenant filter is considered a programming mistake and rejected. Note the message contains a typo ('tentant').

Source

Thrown at modules/flowable5-engine/src/main/java/org/activiti/engine/impl/TimerJobQueryImpl.java:187

    @Override
    public TimerJobQuery withException() {
        this.withException = true;
        return this;
    }

    @Override
    public TimerJobQuery exceptionMessage(String exceptionMessage) {
        if (exceptionMessage == null) {
            throw new ActivitiIllegalArgumentException("Provided exception message is null");
        }
        this.exceptionMessage = exceptionMessage;
        return this;
    }

    @Override
    public TimerJobQuery jobTenantId(String tenantId) {
        if (tenantId == null) {
            throw new ActivitiIllegalArgumentException("Provided tentant id is null");
        }
        this.tenantId = tenantId;
        return this;
    }

    @Override
    public TimerJobQuery jobTenantIdLike(String tenantIdLike) {
        if (tenantIdLike == null) {
            throw new ActivitiIllegalArgumentException("Provided tentant id is null");
        }
        this.tenantIdLike = tenantIdLike;
        return this;
    }

    @Override
    public TimerJobQuery jobWithoutTenantId() {
        this.withoutTenantId = true;
        return this;

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Pass a valid non-null tenant id (use jobTenantIdLike("...") if you need pattern matching)
  2. Skip the tenant filter when no tenant is specified rather than passing null
  3. Configure a default tenant id and set it on deployments/process instances so tenant context is always resolvable

Example fix

// before
query.jobTenantId(tenantContext.getTenantId()); // may be null
// after
String tenantId = tenantContext.getTenantId();
if (tenantId != null) {
    query.jobTenantId(tenantId);
}
Defensive patterns

Strategy: validation

Validate before calling

String tenantId = tenantContext.getTenantId();
if (tenantId == null) {
    throw new IllegalStateException("No tenant in context; configure a default tenant or skip the tenant filter");
}
query.jobTenantId(tenantId);

Type guard

boolean hasTenantId(String t) { return t != null && !t.isEmpty(); }

Try / catch

try {
    query.jobTenantId(tenantId);
} catch (ActivitiIllegalArgumentException e) {
    log.warn("Null tenant id; querying without tenant scope");
}

Prevention

When it happens

Trigger: Calling timerJobQuery().jobTenantId(null) — typically when the authenticated user or request context has no tenant assigned, or tenant handling was added to an application that never sets tenant ids on its deployments.

Common situations: Multi-tenant setups where a user session lacks a tenant claim; code upgraded from a single-tenant version where all data had null tenants; tenant resolvers returning null instead of a default tenant id.

Related errors


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