alibaba/spring-cloud-alibaba · error · ParseException

Increment > 60 : {}

Error message

Increment > 60 : {}

What it means

Thrown when a step value after '/' exceeds 59 in the SECOND or MINUTE field (guard at CronExpression.java:435-436). The parser reads the increment with getNumericValue and rejects steps larger than the field maximum. Note the message text says '> 60' even though the check is `incr > 59`, and message building appends the actual value.

Source

Thrown at spring-cloud-alibaba-starters/spring-cloud-starter-alibaba-schedulerx/src/main/java/com/alibaba/cloud/scheduling/schedulerx/util/CronExpression.java:436

			}
			else if (c == '*') {
				i++;
			}
			c = s.charAt(i);
			if (c == '/') { // is an increment specified?
				i++;
				if (i >= s.length()) {
					throw new ParseException("Unexpected end of string.", i);
				}

				incr = getNumericValue(s, i);

				i++;
				if (incr > 10) {
					i++;
				}
				if (incr > 59 && (type == SECOND || type == MINUTE)) {
					throw new ParseException("Increment > 60 : " + incr, i);
				}
				else if (incr > 23 && (type == HOUR)) {
					throw new ParseException("Increment > 24 : " + incr, i);
				}
				else if (incr > 31 && (type == DAY_OF_MONTH)) {
					throw new ParseException("Increment > 31 : " + incr, i);
				}
				else if (incr > 7 && (type == DAY_OF_WEEK)) {
					throw new ParseException("Increment > 7 : " + incr, i);
				}
				else if (incr > 12 && (type == MONTH)) {
					throw new ParseException("Increment > 12 : " + incr, i);
				}
			}
			else {
				incr = 1;
			}

View on GitHub (pinned to 115d590110)

Solutions

  1. Keep seconds/minutes step <= 59, e.g. '*/70' -> '*/59' or, for 'every 90 seconds', split into multiple triggers or use a higher-level scheduler.
  2. Double-check the field position: a misplaced step in the seconds field is the usual cause.
  3. Validate step bounds per field before constructing the expression.

Example fix

// before
new CronExpression("*/90 * * * * ?");
// after
new CronExpression("*/30 * * * * ?"); // every 30 seconds
Defensive patterns

Strategy: validation

Validate before calling

// Per-field max step map; check the seconds/minutes step <= 59 here.
static boolean stepWithin(String field, int max) {
    int slash = field.indexOf('/');
    if (slash < 0) return true;
    try { return Integer.parseInt(field.substring(slash + 1)) <= max; }
    catch (NumberFormatException e) { return false; }
}

Try / catch

try {
    CronExpression cron = new CronExpression(raw);
} catch (ParseException e) {
    throw new IllegalArgumentException("Invalid cron expression: " + raw, e);
}

Prevention

When it happens

Trigger: `new CronExpression("*/70 * * * * ?")` (seconds step 70), or `new CronExpression("0 */70 * * * ?")` (minutes step 70). Any `*/NN` or `N/NN` in the seconds or minutes field where NN > 59.

Common situations: Developer confuses cron step semantics (e.g. wants 'every 90 seconds' which cron cannot express directly) or copies a seconds value into a step. Typical when migrating from a UI that allowed arbitrary intervals.

Related errors


AI-assisted analysis of alibaba/spring-cloud-alibaba@115d590110 (2026-08-14). Data as JSON: /api/errors/2eb23729db0d37c4. Report an issue: GitHub.