flowable/flowable-engine · error · FlowableIllegalArgumentException
Provided userIdLike is null
Error message
Provided userIdLike is null
What it means
TokenQueryImpl.userIdLike(String) adds a LIKE filter on the token's user id. Passing null triggers FlowableIllegalArgumentException because a null pattern is invalid as a SQL LIKE criterion. Validation happens at query-build time, before any database access.
Solutions
- Provide a non-null pattern such as "%admin%".
- Apply the criterion conditionally when the filter value is present.
- Omit the call to search across all user ids.
Example fix
// before
TokenQuery q = identityService.createTokenQuery().userIdLike(filter.userIdLike);
// after
TokenQuery q = identityService.createTokenQuery();
if (filter.userIdLike != null && !filter.userIdLike.isEmpty()) {
q = q.userIdLike("%" + filter.userIdLike + "%");
} Defensive patterns
Strategy: validation
Validate before calling
if (userIdLike == null) { userIdLike = "%"; } // or skip the call
identityService.createTokenQuery().userIdLike(userIdLike); Type guard
boolean hasPattern(String v) { return v != null && !v.isEmpty(); } Try / catch
try {
query.userIdLike(pattern);
} catch (FlowableIllegalArgumentException e) {
if (e.getMessage().contains("userIdLike is null")) { /* skip criterion */ } else { throw e; }
} Prevention
- Use a query-builder wrapper that applies criteria only for non-null values.
- Sanitize LIKE patterns (escape % and _) while checking for null.
- Prefer building queries conditionally from a filter DTO with Optional fields.
When it happens
Trigger: Calling TokenQuery.userIdLike(null) in a createTokenQuery() chain with an uninitialized or optional filter variable.
Common situations: Optional search filters from REST query parameters; DTO fields left null; code that applies every available criterion without null-guards.
Related errors
- Provided first name is null
- Provided id is null
- Provided ids is null
- Provided token data is null
- Provided tokenDataLike is null
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/74db6f5241457acb.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable-idm-engine/src/main/java/org/flowable/idm/engine/impl/TokenQueryImpl.java:164
throw new FlowableIllegalArgumentException("Provided userAgentLike is null");
}
this.userAgentLike = userAgentLike;
return this;
}
@Override
public TokenQuery userId(String userId) {
if (userId == null) {
throw new FlowableIllegalArgumentException("Provided user id is null");
}
this.userId = userId;
return this;
}
@Override
public TokenQuery userIdLike(String userIdLike) {
if (userIdLike == null) {
throw new FlowableIllegalArgumentException("Provided userIdLike is null");
}
this.userIdLike = userIdLike;
return this;
}
@Override
public TokenQuery tokenData(String tokenData) {
if (tokenData == null) {
throw new FlowableIllegalArgumentException("Provided token data is null");
}
this.tokenData = tokenData;
return this;
}
@Override
public TokenQuery tokenDataLike(String tokenDataLike) {
if (tokenDataLike == null) {
throw new FlowableIllegalArgumentException("Provided tokenDataLike is null");View on GitHub (pinned to d6d39ce1c6)