xuxueli/xxl-job · error · ParseException
Increment >= 60 : {}
Error message
Increment >= 60 : {} What it means
Thrown by checkIncrementRange when a step/increment value in the seconds or minutes field exceeds 59. The maximum meaningful step for a field that cycles through 0-59 is 59; values of 60 or above are rejected as illogical.
Source
Thrown at xxl-job-admin/src/main/java/com/xxl/job/admin/business/scheduler/cron/CronExpression.java:728
c = s.charAt(i);
if (c >= '0' && c <= '9') {
ValueSet vs = getValue(val, s, i);
val = vs.value;
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()) {View on GitHub (pinned to e74c784f68)
Solutions
- Lower the increment to 59 or less for seconds/minutes fields.
- If you need a longer interval, move the logic to the hours or days field (e.g., every 2 hours instead of every 120 minutes).
- Validate step values against the field's maximum before building the cron string.
Example fix
// before "0/75 * * * * ?" // after "0/15 * * * * ?"
Defensive patterns
Strategy: validation
Validate before calling
// Validate step increments for seconds (field 0) and minutes (field 1)
String[] parts = cron.trim().split("\\s+");
for (int idx : new int[]{0, 1}) {
if (parts.length > idx && parts[idx].contains("/")) {
int step = Integer.parseInt(parts[idx].substring(parts[idx].indexOf("/") + 1));
if (step > 59) throw new IllegalArgumentException("Second/minute step must be <= 59: " + step);
}
} Type guard
boolean isValidSecondMinuteStep(String field) {
if (!field.contains("/")) return true;
int step = Integer.parseInt(field.substring(field.indexOf("/") + 1));
return step >= 1 && step <= 59; Try / catch
try {
new CronExpression(cron);
} catch (ParseException e) {
if (e.getMessage().contains("Increment >= 60")) {
// reduce the step to 59 or less
}
} Prevention
- Clamp seconds/minutes step values to 1-59 before building the expression.
- For intervals >= 60 seconds, move the logic to the minutes or hours field.
- Add input validation in any UI or API that accepts cron step values.
When it happens
Trigger: A cron expression like '0/60 * * * * ?' or '0-30/65 * * * * ?' where the increment after '/' in the seconds or minutes field is >= 60. The check at line 727 tests incr > 59 with type SECOND or MINUTE.
Common situations: Computing an increment dynamically and accidentally producing a value >= 60, or misunderstanding the range of the seconds/minutes field.
Related errors
- Increment >= 24 : {}
- Increment >= 31 : {}
- Increment >= 7 : {}
- Increment >= 12 : {}
- Unexpected character '{}' after '/'
AI-assisted analysis of xuxueli/xxl-job@e74c784f68 (2026-08-14).
Data as JSON: /api/errors/3fb53dba5648ce61.
Report an issue: GitHub.