{"record":{"id":"2215918fd98b50b7","repo":"xuxueli/xxl-job","slug":"increment-24","errorCode":null,"errorMessage":"Increment >= 24 : {}","messagePattern":"Increment >= 24 : (.+?)","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":730,"sourceCode":"                    ValueSet vs = getValue(val, s, i);\n                    val = vs.value;\n                    i = vs.pos;\n                }\n                i = checkNext(i, s, val, type);\n                return i;\n            }\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;","sourceCodeStart":712,"sourceCodeEnd":748,"githubUrl":"https://github.com/xuxueli/xxl-job/blob/e74c784f68f81fa89cb350913ef15794865d7b12/xxl-job-admin/src/main/java/com/xxl/job/admin/business/scheduler/cron/CronExpression.java#L712-L748","documentation":"Thrown by checkIncrementRange when a step/increment value in the hours field exceeds 23. The hours field cycles through 0-23, so an increment of 24 or more is meaningless.","triggerScenarios":"A cron expression like '* 0/24 * * * ?' where the increment after '/' in the hour field is >= 24. The check at line 729 tests incr > 23 with type HOUR.","commonSituations":"Generating an increment for the hours field from a minutes-based calculation without converting, or copying a pattern from another field.","solutions":["Reduce the hour increment to 23 or less.","For intervals longer than a day, use the day-of-month field instead.","Validate step values against 23 for the hours field before constructing the expression."],"exampleFix":"// before\n\"* 0/30 * * * ?\"\n// after\n\"* 0/12 * * * ?\"","handlingStrategy":"validation","validationCode":"// Validate step increment for hours (field index 2)\nString[] parts = cron.trim().split(\"\\\\s+\");\nif (parts.length > 2 && parts[2].contains(\"/\")) {\n    int step = Integer.parseInt(parts[2].substring(parts[2].indexOf(\"/\") + 1));\n    if (step > 23) throw new IllegalArgumentException(\"Hour step must be <= 23: \" + step);\n}","typeGuard":"boolean isValidHourStep(String hourField) {\n    if (!hourField.contains(\"/\")) return true;\n    int step = Integer.parseInt(hourField.substring(hourField.indexOf(\"/\") + 1));\n    return step >= 1 && step <= 23;","tryCatchPattern":"try {\n    new CronExpression(cron);\n} catch (ParseException e) {\n    if (e.getMessage().contains(\"Increment >= 24\")) {\n        // move to day-based scheduling\n    }\n}","preventionTips":["Clamp hour step values to 1-23 before building the expression.","For intervals >= 24 hours, use the day-of-month field instead.","Validate increment values against the field maximum in your cron builder."],"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"}