{"record":{"id":"7295c400cd11b179","repo":"flowable/flowable-engine","slug":"invalid-month-value","errorCode":null,"errorMessage":"Invalid Month value: '","messagePattern":"Invalid Month value: '","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":559,"sourceCode":"        }\n    }\n\n    protected int storeExpressionVals(int pos, String s, int type) throws ParseException {\n\n        int incr = 0;\n        int i = skipWhiteSpace(pos, s);\n        if (i >= s.length()) {\n            return i;\n        }\n        char c = s.charAt(i);\n        if ((c >= 'A') && (c <= 'Z') && !\"L\".equals(s) && !\"LW\".equals(s) && !s.matches(\"^L-[0-9]*[W]?\")) {\n            String sub = s.substring(i, i + 3);\n            int sval = -1;\n            int eval = -1;\n            if (type == MONTH) {\n                sval = getMonthNumber(sub) + 1;\n                if (sval <= 0) {\n                    throw new ParseException(\"Invalid Month value: '\" + sub + \"'\", i);\n                }\n                if (s.length() > i + 3) {\n                    c = s.charAt(i + 3);\n                    if (c == '-') {\n                        i += 4;\n                        sub = s.substring(i, i + 3);\n                        eval = getMonthNumber(sub) + 1;\n                        if (eval <= 0) {\n                            throw new ParseException(\"Invalid Month value: '\" + sub + \"'\", i);\n                        }\n                    }\n                }\n            } else if (type == DAY_OF_WEEK) {\n                sval = getDayOfWeekNumber(sub);\n                if (sval < 0) {\n                    throw new ParseException(\"Invalid Day-of-Week value: '\" + sub + \"'\", i);\n                }\n                if (s.length() > i + 3) {","sourceCodeStart":541,"sourceCodeEnd":577,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/calendar/CronExpression.java#L541-L577","documentation":"In storeExpressionVals, when parsing the MONTH field as a 3-letter name (JAN, FEB, ...), getMonthNumber returns <= 0 for unknown names and this ParseException is thrown at the offending position. Only English three-letter month abbreviations (case-insensitive) are accepted; numbers 1-12 must be used instead of names for numeric tokens.","triggerScenarios":"new CronExpression(expr, clockReader) with a month field token whose first three characters are not a valid English month abbreviation, e.g. '0 0 12 * JANU ?' or a misspelled/translated month like 'ENE' or 'MRZ'.","commonSituations":"Localized cron examples (German MRZ, Spanish ENE) copied into Flowable config; typos such as 'JNA'; four-letter month names like 'JULY' whose first-3 slice 'JUL' parses but remainder breaks later (or full names truncated unexpectedly).","solutions":["Use standard English three-letter abbreviations: JAN FEB MAR APR MAY JUN JUL AUG SEP OCT NOV DEC","Or use numeric months 1-12 instead of names","Fix localization: translate the schedule's month names to English before constructing","Pre-validate month tokens with a whitelist before creating CronExpression"],"exampleFix":"// before\nString cron = \"0 0 12 * MRZ ?\"; // German \"März\"\n// after\nString cron = \"0 0 12 * MAR ?\"; // English abbreviation (or \"0 0 12 * 3 ?\")","handlingStrategy":"validation","validationCode":"java.util.Set<String> MONTHS = java.util.Set.of(\"JAN\",\"FEB\",\"MAR\",\"APR\",\"MAY\",\"JUN\",\"JUL\",\"AUG\",\"SEP\",\"OCT\",\"NOV\",\"DEC\");\nif (!MONTHS.contains(sub.toUpperCase())) throw new IllegalArgumentException(\"bad month name: \" + sub);","typeGuard":null,"tryCatchPattern":"try { new CronExpression(expr, clockReader); }\ncatch (ParseException e) { if (e.getMessage().startsWith(\"Invalid Month value\")) { /* fix month token */ } throw e; }","preventionTips":["Only JAN..DEC English abbreviations are accepted — translate localized crons","Prefer numeric months 1-12 to avoid name issues","Normalize input to upper case and trim before parsing"],"tags":["cron","parsing","month","flowable"],"backgroundTag":"invalid-enum-value","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}