flowable/flowable-engine · error · ParseException

Increment > 12 :

Error message

Increment > 12 : 

What it means

Parse-time guard in CronExpression.checkIncrementRange: the step value in the month field exceeds 12, which is impossible for a 1-12 field, so the cron expression is rejected with the offending position.

Solutions

  1. Cap the month step at 12
  2. Use the year field or a separate scheduling mechanism for multi-year periods
  3. Validate the step value against 1-12 before constructing the CronExpression

Example fix

// before
new CronExpression("0 0 0 1 1/24 ?");
// after
new CronExpression("0 0 0 1 1 ? 2026/2"); // or use a non-cron trigger
Defensive patterns

Strategy: validation

Validate before calling

if (monthStep > 12) throw new IllegalArgumentException("Month step must be <= 12");

Try / catch

try {
    CronExpression cron = new CronExpression(expr);
} catch (ParseException e) {
    if (e.getMessage().startsWith("Increment > 12")) {
        throw new ConfigurationException("Month step must be <= 12: " + expr, e);
    }
    throw e;
}

Prevention

When it happens

Trigger: Expressions like "0 0 0 1 1/13 ?" where the month step exceeds 12.

Common situations: Attempts to express 'every 2 years' with a month step; generated expressions from configuration values not clamped to field ranges.

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/6c8b6fb2b66e9ecc. Report an issue: GitHub.

Appendix: source

Thrown at modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/calendar/CronExpression.java:719

            }
        } 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);

        if (c == 'L') {
            if (type == DAY_OF_WEEK) {
                if (val < 1 || val > 7) {

View on GitHub (pinned to d6d39ce1c6)