The Exact Error
Error: value 60 out of range [0..59] for minutes field
Or:
Invalid cron expression: '0 25 * * *'
QuartzException: '8' is not a valid value for hour
Quick summary: A value in one of the cron fields exceeds the allowed range ā 60 in minutes, 25 in hours, 8 in day-of-week for standard cron. Each field has a strict numeric range.
Why This Error Happens
A cron expression has 5 (or 6) fields, each with a specific allowed range. If any value falls outside its range, the expression is invalid.
Common causes:
1. Wrong range ā 60 for minutes (valid: 0-59), 24 for hours (valid: 0-23).
2. Day-of-week off-by-one ā Standard cron: 0=Sunday. Quartz/AWS: 1=Sunday. If you use 8, all implementations reject it.
3. Month confusion ā Month is 1-12 in cron (January=1), not 0-11 like JavaScript's Date.getMonth().
4. Step value errors ā */0 (zero step) is meaningless.
Step-by-Step Diagnosis
Step 1 ā Map fields to positions
Standard cron (5 fields):
* * * * *
| | | | |
| | | | +-- day of week (0-7, 0 and 7 = Sunday)
| | | +----- month (1-12)
| | +-------- day of month (1-31)
| +----------- hour (0-23)
+-------------- minute (0-59)
Quartz/AWS (6 fields):
* * * * * *
| | | | | |
| | | | | +-- day of week (1-7, 1 = Sunday)
| | | | +----- month (1-12)
| | | +-------- day of month (1-31)
| | +----------- hour (0-23)
| +-------------- minute (0-59)
+------------------ seconds (0-59)
Step 2 ā Validate each field
# 0 25 * * *
# hour=25 ā INVALID! Valid: 0-23
# 0 12 * * 8
# day-of-week=8 ā INVALID! Valid: 0-7