flowable/flowable-engine · error · ParseException
Increment > 31 :
Error message
Increment > 31 :
What it means
checkIncrementRange rejects an increment larger than 31 for the DAY_OF_MONTH field. The step in a day-of-month '/n' expression must be within the field's range (1-31); exceeding it throws this ParseException.
Solutions
- Reduce the day-of-month step to 31 or less
- Use month field stepping or multiple expressions for longer intervals
- Validate user-supplied step values against field ranges before constructing CronExpression
Example fix
// before
new CronExpression("0 0 0 1/45 * ?");
// after
new CronExpression("0 0 0 1 * ?"); // or use a longer-interval trigger type Defensive patterns
Strategy: validation
Validate before calling
if (dayStep > 31) throw new IllegalArgumentException("Day-of-month step must be <= 31"); Try / catch
try {
CronExpression cron = new CronExpression(expr);
} catch (ParseException e) {
if (e.getMessage().startsWith("Increment > 31")) {
throw new ConfigurationException("Day-of-month step must be <= 31: " + expr, e);
}
throw e;
} Prevention
- Clamp day-of-month steps to 31
- Use month/year fields for longer intervals
- Test generated expressions against the parser in CI
When it happens
Trigger: Expressions like "0 0 0 1/32 * ?" where the day step exceeds 31.
Common situations: Auto-generated schedules with computed step values; misunderstanding that a step can exceed the field's maximum.
Understand the failure class
Background: "value must be between 0 and 1" / "out of range" / "must not be negative" errors: fixing range-validation failures across open-source libraries — this error's family across 42 libraries.
Related errors
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/8895578ac2787fec.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/calendar/CronExpression.java:715
i = vs.pos;
}
i = checkNext(i, s, val, type);
return i;
}
} else {
throw new ParseException("Unexpected character: " + c, i);
}
return i;
}
private void checkIncrementRange(int incr, int type, int idxPos) throws ParseException {
if (incr > 59 && (type == SECOND || type == MINUTE)) {
throw new ParseException("Increment > 60 : " + incr, idxPos);
} else if (incr > 23 && (type == HOUR)) {
throw new ParseException("Increment > 24 : " + incr, idxPos);
} else if (incr > 31 && (type == DAY_OF_MONTH)) {
throw new ParseException("Increment > 31 : " + incr, idxPos);
} else if (incr > 7 && (type == DAY_OF_WEEK)) {
throw new ParseException("Increment > 7 : " + incr, idxPos);
} else if (incr > 12 && (type == MONTH)) {
throw new ParseException("Increment > 12 : " + incr, idxPos);
}
}
protected int checkNext(int pos, String s, int val, int type) throws ParseException {
int end = -1;
int i = pos;
if (i >= s.length()) {
addToSet(val, end, -1, type);
return i;
}
char c = s.charAt(pos);View on GitHub (pinned to d6d39ce1c6)