flowable/flowable-engine · error · FlowableIllegalArgumentException

ids are null

Error message

ids are null

What it means

deploymentIds(Set<String>) throws 'ids are null' when the set itself is null. The query needs a non-null collection to build an IN clause over deployment ids. Null is checked before emptiness, so this fires first.

Source

Thrown at modules/flowable-app-engine/src/main/java/org/flowable/app/engine/impl/repository/AppDefinitionQueryImpl.java:140

            throw new FlowableIllegalArgumentException("nameLike is null");
        }
        this.nameLike = nameLike;
        return this;
    }

    @Override
    public AppDefinitionQueryImpl deploymentId(String deploymentId) {
        if (deploymentId == null) {
            throw new FlowableIllegalArgumentException("id is null");
        }
        this.deploymentId = deploymentId;
        return this;
    }

    @Override
    public AppDefinitionQueryImpl deploymentIds(Set<String> deploymentIds) {
        if (deploymentIds == null) {
            throw new FlowableIllegalArgumentException("ids are null");
        } else if (deploymentIds.isEmpty()) {
            throw new FlowableIllegalArgumentException("ids is an empty collection");
        }
        this.deploymentIds = deploymentIds;
        return this;
    }

    @Override
    public AppDefinitionQueryImpl appDefinitionKey(String key) {
        if (key == null) {
            throw new FlowableIllegalArgumentException("key is null");
        }
        this.key = key;
        return this;
    }

    @Override
    public AppDefinitionQueryImpl appDefinitionKeyLike(String keyLike) {

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Initialize the set to an empty collection upstream, and only call deploymentIds when it is non-null and non-empty
  2. Use Set.of()/new HashSet<>() as a default instead of null in DTOs
  3. Catch FlowableIllegalArgumentException at the boundary and return a client error

Example fix

// before
query.deploymentIds(deploymentIds);
// after
if (deploymentIds != null && !deploymentIds.isEmpty()) {
    query.deploymentIds(deploymentIds);
}
Defensive patterns

Strategy: validation

Validate before calling

if (deploymentIds != null && !deploymentIds.isEmpty()) {
    query.deploymentIds(deploymentIds);
}

Type guard

boolean isNonEmpty(Set<String> s) { return s != null && !s.isEmpty(); }

Try / catch

try {
    query.deploymentIds(deploymentIds);
} catch (FlowableIllegalArgumentException e) {
    throw new ResponseStatusException(HttpStatus.BAD_REQUEST, e.getMessage(), e);
}

Prevention

When it happens

Trigger: Calling appDefinitionQuery.deploymentIds(null), commonly when the set is built by filtering/collecting code that returned null, or a nullable field of a request object is passed straight through.

Common situations: Batch lookups where the id list failed to populate; deserialization left the collection field null; utility method returns null on 'no results' and the result is forwarded directly.

Related errors


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