flowable/flowable-engine · error · FlowableIllegalArgumentException

Provided userIds is null

Error message

Provided userIds is null

What it means

Flowable's GroupQueryImpl.groupMembers(List<String> userIds) throws FlowableIllegalArgumentException when the userIds list is null. Criteria on the query object must be non-null; a null list cannot be translated into a SQL IN clause. The check fires at query-construction time, before any command executes.

Source

Thrown at modules/flowable-idm-engine/src/main/java/org/flowable/idm/engine/impl/GroupQueryImpl.java:121

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

    @Override
    public GroupQuery groupMember(String userId) {
        if (userId == null) {
            throw new FlowableIllegalArgumentException("Provided userId is null");
        }
        this.userId = userId;
        return this;
    }

    @Override
    public GroupQuery groupMembers(List<String> userIds) {
        if (userIds == null) {
            throw new FlowableIllegalArgumentException("Provided userIds is null");
        }
        this.userIds = userIds;
        return this;
    }

    // sorting ////////////////////////////////////////////////////////

    @Override
    public GroupQuery orderByGroupId() {
        return orderBy(GroupQueryProperty.GROUP_ID);
    }

    @Override
    public GroupQuery orderByGroupName() {
        return orderBy(GroupQueryProperty.NAME);
    }

    @Override

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Initialize the list to an empty List (Collections.emptyList()) or apply the filter only when non-null
  2. Coalesce null upstream collections before passing them: groupMembers(ids != null ? ids : Collections.emptyList())
  3. If you want all groups regardless of members, simply omit the groupMembers call

Example fix

// before
GroupQuery query = identityService.createGroupQuery().groupMembers(userIds);
// after
GroupQuery query = identityService.createGroupQuery();
if (userIds != null) {
    query.groupMembers(userIds);
}
Defensive patterns

Strategy: validation

Validate before calling

if (userIds == null) { throw new IllegalArgumentException("userIds must not be null before groupMembers()"); }

Type guard

boolean isValidUserIds(List<String> userIds) { return userIds != null; }

Try / catch

try { query.groupMembers(userIds); } catch (FlowableIllegalArgumentException e) { log.warn("Invalid group query: {}", e.getMessage()); }

Prevention

When it happens

Trigger: Calling groupMembers(null) on a GroupQuery, usually when the list was built conditionally but the call was made unconditionally, or when a nullable collection from an upstream API (e.g. user.getGroupIds()) is passed straight through.

Common situations: Dynamic query builders assembling filters from request DTOs with optional fields; refactors that changed a default new ArrayList to null; mapping code where an absent JSON array deserialized to null.

Related errors


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