{"record":{"id":"8895578ac2787fec","repo":"flowable/flowable-engine","slug":"increment-31","errorCode":null,"errorMessage":"Increment > 31 : ","messagePattern":"Increment > 31 : ","errorType":"exception","errorClass":"ParseException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/calendar/CronExpression.java","lineNumber":715,"sourceCode":"                    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) 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);","sourceCodeStart":697,"sourceCodeEnd":733,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/calendar/CronExpression.java#L697-L733","documentation":"checkIncrementRange rejects an increment larger than 31 for the DAY_OF_MONTH field. The step in a day-of-month '/n' expression must be within the field's range (1-31); exceeding it throws this ParseException.","triggerScenarios":"Expressions like \"0 0 0 1/32 * ?\" where the day step exceeds 31.","commonSituations":"Auto-generated schedules with computed step values; misunderstanding that a step can exceed the field's maximum.","solutions":["Reduce the day-of-month step to 31 or less","Use month field stepping or multiple expressions for longer intervals","Validate user-supplied step values against field ranges before constructing CronExpression"],"exampleFix":"// before\nnew CronExpression(\"0 0 0 1/45 * ?\");\n// after\nnew CronExpression(\"0 0 0 1 * ?\"); // or use a longer-interval trigger type","handlingStrategy":"validation","validationCode":"if (dayStep > 31) throw new IllegalArgumentException(\"Day-of-month step must be <= 31\");","typeGuard":null,"tryCatchPattern":"try {\n    CronExpression cron = new CronExpression(expr);\n} catch (ParseException e) {\n    if (e.getMessage().startsWith(\"Increment > 31\")) {\n        throw new ConfigurationException(\"Day-of-month step must be <= 31: \" + expr, e);\n    }\n    throw e;\n}","preventionTips":["Clamp day-of-month steps to 31","Use month/year fields for longer intervals","Test generated expressions against the parser in CI"],"tags":["cron","increment","quartz","scheduling"],"backgroundTag":"value-out-of-range","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}