{"record":{"id":"8bd518d073e40fdb","repo":"alibaba/spring-cloud-alibaba","slug":"increment-24","errorCode":null,"errorMessage":"Increment > 24 : {}","messagePattern":"Increment > 24 : (.+?)","errorType":"exception","errorClass":"ParseException","httpStatus":null,"severity":"error","filePath":"spring-cloud-alibaba-starters/spring-cloud-starter-alibaba-schedulerx/src/main/java/com/alibaba/cloud/scheduling/schedulerx/util/CronExpression.java","lineNumber":439,"sourceCode":"\t\t\t}\n\t\t\tc = s.charAt(i);\n\t\t\tif (c == '/') { // is an increment specified?\n\t\t\t\ti++;\n\t\t\t\tif (i >= s.length()) {\n\t\t\t\t\tthrow new ParseException(\"Unexpected end of string.\", i);\n\t\t\t\t}\n\n\t\t\t\tincr = getNumericValue(s, i);\n\n\t\t\t\ti++;\n\t\t\t\tif (incr > 10) {\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t\tif (incr > 59 && (type == SECOND || type == MINUTE)) {\n\t\t\t\t\tthrow new ParseException(\"Increment > 60 : \" + incr, i);\n\t\t\t\t}\n\t\t\t\telse if (incr > 23 && (type == HOUR)) {\n\t\t\t\t\tthrow new ParseException(\"Increment > 24 : \" + incr, i);\n\t\t\t\t}\n\t\t\t\telse if (incr > 31 && (type == DAY_OF_MONTH)) {\n\t\t\t\t\tthrow new ParseException(\"Increment > 31 : \" + incr, i);\n\t\t\t\t}\n\t\t\t\telse if (incr > 7 && (type == DAY_OF_WEEK)) {\n\t\t\t\t\tthrow new ParseException(\"Increment > 7 : \" + incr, i);\n\t\t\t\t}\n\t\t\t\telse if (incr > 12 && (type == MONTH)) {\n\t\t\t\t\tthrow new ParseException(\"Increment > 12 : \" + incr, i);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tincr = 1;\n\t\t\t}\n\n\t\t\taddToSet(ALL_SPEC_INT, -1, incr, type);\n\t\t\treturn i;\n\t\t}","sourceCodeStart":421,"sourceCodeEnd":457,"githubUrl":"https://github.com/alibaba/spring-cloud-alibaba/blob/115d5901102009492e05d5ec18c3f79cad4077d0/spring-cloud-alibaba-starters/spring-cloud-starter-alibaba-schedulerx/src/main/java/com/alibaba/cloud/scheduling/schedulerx/util/CronExpression.java#L421-L457","documentation":"Thrown when a step value after '/' exceeds 23 in the HOUR field (guard at CronExpression.java:438-439). Hour steps must be within the 0-23 hour range; the message reports '> 24' though the code checks `incr > 23`.","triggerScenarios":"`new CronExpression(\"0 0 */24 * * ?\")` (hour step 24) or any `*/NN`/`N/NN` in the hours field with NN > 23.","commonSituations":"Wanting 'every 24 hours' which cron cannot express as a single hour step, or an off-by-one from a 1-based UI. Also a field-shift bug where a day-of-month value lands in the hours field.","solutions":["Use a step <= 23 for hours, e.g. '*/24' -> '*/12'.","For 'every 24 hours / every day at a time', use a fixed hour like '0 0 12 * * ?' instead of a step.","Recount the six fields to ensure the step is actually in the hours position."],"exampleFix":"// before\nnew CronExpression(\"0 0 */24 * * ?\");\n// after\nnew CronExpression(\"0 0 */12 * * ?\"); // every 12 hours","handlingStrategy":"validation","validationCode":"static boolean stepWithin(String field, int max) {\n    int slash = field.indexOf('/');\n    if (slash < 0) return true;\n    try { return Integer.parseInt(field.substring(slash + 1)) <= max; }\n    catch (NumberFormatException e) { return false; }\n}","typeGuard":null,"tryCatchPattern":"try {\n    CronExpression cron = new CronExpression(raw);\n} catch (ParseException e) {\n    throw new IllegalArgumentException(\"Invalid cron expression: \" + raw, e);\n}","preventionTips":["Hour steps are capped at 23; for 'every 24h' use a fixed daily time.","Validate hour-step inputs at the configuration boundary.","Recount fields to keep the step in the hours position."],"tags":["cron","schedulerx","spring-cloud-alibaba","configuration","parsing","validation","range-check"],"backgroundTag":null,"analyzedSha":"115d5901102009492e05d5ec18c3f79cad4077d0","analyzedAt":"2026-08-14T04:47:13.900Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}