flowable/flowable-engine · error · ParseException

Invalid Month value: '

Error message

Invalid Month value: '

What it means

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.

Source

Thrown at modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/calendar/CronExpression.java:559

        }
    }

    protected int storeExpressionVals(int pos, String s, int type) throws ParseException {

        int incr = 0;
        int i = skipWhiteSpace(pos, s);
        if (i >= s.length()) {
            return i;
        }
        char c = s.charAt(i);
        if ((c >= 'A') && (c <= 'Z') && !"L".equals(s) && !"LW".equals(s) && !s.matches("^L-[0-9]*[W]?")) {
            String sub = s.substring(i, i + 3);
            int sval = -1;
            int eval = -1;
            if (type == MONTH) {
                sval = getMonthNumber(sub) + 1;
                if (sval <= 0) {
                    throw new ParseException("Invalid Month value: '" + sub + "'", i);
                }
                if (s.length() > i + 3) {
                    c = s.charAt(i + 3);
                    if (c == '-') {
                        i += 4;
                        sub = s.substring(i, i + 3);
                        eval = getMonthNumber(sub) + 1;
                        if (eval <= 0) {
                            throw new ParseException("Invalid Month value: '" + sub + "'", i);
                        }
                    }
                }
            } else if (type == DAY_OF_WEEK) {
                sval = getDayOfWeekNumber(sub);
                if (sval < 0) {
                    throw new ParseException("Invalid Day-of-Week value: '" + sub + "'", i);
                }
                if (s.length() > i + 3) {

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Use standard English three-letter abbreviations: JAN FEB MAR APR MAY JUN JUL AUG SEP OCT NOV DEC
  2. Or use numeric months 1-12 instead of names
  3. Fix localization: translate the schedule's month names to English before constructing
  4. Pre-validate month tokens with a whitelist before creating CronExpression

Example fix

// before
String cron = "0 0 12 * MRZ ?"; // German "März"
// after
String cron = "0 0 12 * MAR ?"; // English abbreviation (or "0 0 12 * 3 ?")
Defensive patterns

Strategy: validation

Validate before calling

java.util.Set<String> MONTHS = java.util.Set.of("JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC");
if (!MONTHS.contains(sub.toUpperCase())) throw new IllegalArgumentException("bad month name: " + sub);

Try / catch

try { new CronExpression(expr, clockReader); }
catch (ParseException e) { if (e.getMessage().startsWith("Invalid Month value")) { /* fix month token */ } throw e; }

Prevention

When it happens

Trigger: 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'.

Common situations: 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).

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11). Data as JSON: /api/errors/7295c400cd11b179. Report an issue: GitHub.