{"record":{"id":"4470aa93617fc684","repo":"flowable/flowable-engine","slug":"invalid-day-of-week-value","errorCode":null,"errorMessage":"Invalid Day-of-Week value: '","messagePattern":"Invalid Day-of-Week 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":575,"sourceCode":"                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) {\n                    c = s.charAt(i + 3);\n                    if (c == '-') {\n                        i += 4;\n                        sub = s.substring(i, i + 3);\n                        eval = getDayOfWeekNumber(sub);\n                        if (eval < 0) {\n                            throw new ParseException(\"Invalid Day-of-Week value: '\" + sub + \"'\", i);\n                        }\n                    } else if (c == '#') {\n                        try {\n                            i += 4;\n                            nthdayOfWeek = Integer.parseInt(s.substring(i));\n                            if (nthdayOfWeek < 1 || nthdayOfWeek > 5) {\n                                throw new Exception();\n                            }\n                        } catch (Exception e) {","sourceCodeStart":557,"sourceCodeEnd":593,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/calendar/CronExpression.java#L557-L593","documentation":"Thrown by storeExpressionVals when parsing the Day-of-Week field of a cron expression: getDayOfWeekNumber(sub) returned < 0, meaning the 3-letter token (e.g. 'MON', 'FRI') or name at position i is not a recognized day-of-week. The library only accepts SUN-SAT (0-7, or 1-7 mapping), 3-letter abbreviations, and numeric values in this position. Any unrecognized token in the Day-of-Week slot is rejected with this ParseException.","triggerScenarios":"Calling new CronExpression(expr) or validateExpression(expr) where the 6th/7th field contains a token that getDayOfWeekNumber cannot resolve, e.g. a misspelled day name ('SND', 'WEDNESDAY' full name), a number out of range like '8' or '0' if unsupported, or a shifted field position where Day-of-Month tokens land in the Day-of-Week slot.","commonSituations":"Hand-written cron strings with full day names ('Monday') instead of 3-letter abbreviations; expressions copied from Unix crontab with 5 fields pasted into a 6/7-field Quartz-style parser causing field misalignment; typos like 'MNO'; locale-specific day abbreviations.","solutions":["Check the Day-of-Week field token: use only SUN, MON, TUE, WED, THU, FRI, SAT (uppercase 3-letter) or numbers 1-7 (or 0-7 where 0/7=SUN).","Verify the expression has the correct number of fields (6 or 7 for Quartz/Flowable: sec min hour day-of-month month day-of-week [year]); a missing field shifts day names into the wrong slot.","Replace '?' or '*' if the field is intentionally 'any day' and the token is garbage.","Call CronExpression.validateExpression(cronExpr) at application startup to fail fast on misconfigured schedules."],"exampleFix":"// before\nnew CronExpression(\"0 0 12 ? * Monday\");\n// after\nnew CronExpression(\"0 0 12 ? * MON\");","handlingStrategy":"validation","validationCode":"private static final java.util.regex.Pattern DOW_TOKEN = java.util.regex.Pattern.compile(\"^(MON|TUE|WED|THU|FRI|SAT|SUN|[0-7])(-([0-7]|MON|TUE|WED|THU|FRI|SAT|SUN))?$\");\n// before calling new CronExpression(expr): check field 6 against DOW_TOKEN","typeGuard":null,"tryCatchPattern":"try {\n    new CronExpression(expr);\n} catch (java.text.ParseException e) {\n    throw new IllegalArgumentException(\"Invalid cron Day-of-Week field: \" + e.getMessage(), e);\n}","preventionTips":["Use only 3-letter uppercase day abbreviations (SUN-SAT) or numbers 1-7","Keep the 6/7-field Quartz cron layout (sec min hour dom month dow [year])","Run CronExpression.validateExpression on all schedules at startup"],"tags":["cron","parse-error","scheduler"],"backgroundTag":"invalid-argument-format","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"}