{"record":{"id":"9154e32b805db953","repo":"xuxueli/xxl-job","slug":"increment-12","errorCode":null,"errorMessage":"Increment >= 12 : {}","messagePattern":"Increment >= 12 : (.+?)","errorType":"validation","errorClass":"ParseException","httpStatus":null,"severity":"error","filePath":"xxl-job-admin/src/main/java/com/xxl/job/admin/business/scheduler/cron/CronExpression.java","lineNumber":736,"sourceCode":"            }\n        } else {\n            throw new ParseException(\"Unexpected character: \" + c, i);\n        }\n\n        return i;\n    }\n\n    private void checkIncrementRange(int incr, int type, int idxPos) throws ParseException {\n        if (incr > 59 && (type == SECOND || type == MINUTE)) {\n            throw new ParseException(\"Increment >= 60 : \" + incr, idxPos);\n        } else if (incr > 23 && (type == HOUR)) {\n            throw new ParseException(\"Increment >= 24 : \" + incr, idxPos);\n        } else if (incr > 31 && (type == DAY_OF_MONTH)) {\n            throw new ParseException(\"Increment >= 31 : \" + incr, idxPos);\n        } else if (incr > 7 && (type == DAY_OF_WEEK)) {\n            throw new ParseException(\"Increment >= 7 : \" + incr, idxPos);\n        } else if (incr > 12 && (type == MONTH)) {\n            throw new ParseException(\"Increment >= 12 : \" + incr, idxPos);\n        }\n    }\n\n    protected int checkNext(int pos, String s, int val, int type)\n            throws ParseException {\n\n        int end = -1;\n        int i = pos;\n\n        if (i >= s.length()) {\n            addToSet(val, end, -1, type);\n            return i;\n        }\n\n        char c = s.charAt(pos);\n\n        if (c == 'L') {\n            if (type == DAY_OF_WEEK) {","sourceCodeStart":718,"sourceCodeEnd":754,"githubUrl":"https://github.com/xuxueli/xxl-job/blob/e74c784f68f81fa89cb350913ef15794865d7b12/xxl-job-admin/src/main/java/com/xxl/job/admin/business/scheduler/cron/CronExpression.java#L718-L754","documentation":"Thrown by checkIncrementRange when a step/increment value in the Month field exceeds 12. The month field cycles through 1-12, so an increment of 13 or more is rejected.","triggerScenarios":"A cron expression like '0 0 0 1 1/13 ?' where the increment after '/' in the month field is >= 13. The check at line 735 tests incr > 12 with type MONTH.","commonSituations":"Generating a month increment dynamically without clamping to the valid range, or misunderstanding the 1-12 month domain.","solutions":["Reduce the month increment to 12 or less.","If an annual or bi-annual schedule is needed, use a value like '1/6' (every 6 months) or '1/12' (yearly).","Validate step values against 12 for the month field before building the expression."],"exampleFix":"// before\n\"0 0 0 1 1/15 ?\"\n// after\n\"0 0 0 1 1/6 ?\"","handlingStrategy":"validation","validationCode":"// Validate step increment for month (field index 4)\nString[] parts = cron.trim().split(\"\\\\s+\");\nif (parts.length > 4 && parts[4].contains(\"/\")) {\n    int step = Integer.parseInt(parts[4].substring(parts[4].indexOf(\"/\") + 1));\n    if (step > 12) throw new IllegalArgumentException(\"Month step must be <= 12: \" + step);\n}","typeGuard":"boolean isValidMonthStep(String monthField) {\n    if (!monthField.contains(\"/\")) return true;\n    int step = Integer.parseInt(monthField.substring(monthField.indexOf(\"/\") + 1));\n    return step >= 1 && step <= 12;","tryCatchPattern":"try {\n    new CronExpression(cron);\n} catch (ParseException e) {\n    if (e.getMessage().contains(\"Increment >= 12\")) {\n        // the schedule interval exceeds a year; reconsider the approach\n    }\n}","preventionTips":["Clamp month step values to 1-12 before building the expression.","For yearly schedules, use a fixed month value rather than a step.","Validate increments against each field's domain maximum."],"tags":["cron","validation","increment","range"],"backgroundTag":null,"analyzedSha":"e74c784f68f81fa89cb350913ef15794865d7b12","analyzedAt":"2026-08-14T04:22:43.715Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}