java.lang.IllegalArgumentException: The provided cron string does not have 7 parts: 0 0 * * * ? * 2,3,4,5,6

Atlassian JIRA | Yilin Mo [Atlassian] | 5 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    When creating a new subscription for a filter, add a job with the following cron expression: {code} 0 0 * * * ? * 2,3,4,5,6 {code} The job can be successfully created (as in the screenshot creation.png), but when we edit, it throw a system error(detail in the file cron_error) like : {noformat} Cause: java.lang.IllegalArgumentException: The provided cron string does not have 7 parts: 0 0 * * * ? * 2,3,4,5,6 Stack Trace: [hide] java.lang.IllegalArgumentException: The provided cron string does not have 7 parts: 0 0 * * * ? * 2,3,4,5,6 at com.atlassian.jira.web.component.cron.parser.CronExpressionParser.parseCronString(CronExpressionParser.java:322) at com.atlassian.jira.web.component.cron.parser.CronExpressionParser.parseAndValidateCronString(CronExpressionParser.java:305) at com.atlassian.jira.web.component.cron.parser.CronExpressionParser.<init>(CronExpressionParser.java:75) at com.atlassian.jira.web.action.filter.FilterSubscription.doDefault(FilterSubscription.java:107) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) {noformat} It looks like the Cron expression will only check the first 6 components, if they're OK, the job can be create even the expression is illegal for example: {code} 0 0 * * * ? * 2,3,4,5,6 8 0 0 * * * ? * 2,3,4,5,6 8 11 21 .... {code} The only workaround solution is to delete the job.

    Atlassian JIRA | 5 years ago | Yilin MO [Atlassian]
    java.lang.IllegalArgumentException: The provided cron string does not have 7 parts: 0 0 * * * ? * 2,3,4,5,6
  2. 0

    When creating a new subscription for a filter, add a job with the following cron expression: {code} 0 0 * * * ? * 2,3,4,5,6 {code} The job can be successfully created (as in the screenshot creation.png), but when we edit, it throw a system error(detail in the file cron_error) like : {noformat} Cause: java.lang.IllegalArgumentException: The provided cron string does not have 7 parts: 0 0 * * * ? * 2,3,4,5,6 Stack Trace: [hide] java.lang.IllegalArgumentException: The provided cron string does not have 7 parts: 0 0 * * * ? * 2,3,4,5,6 at com.atlassian.jira.web.component.cron.parser.CronExpressionParser.parseCronString(CronExpressionParser.java:322) at com.atlassian.jira.web.component.cron.parser.CronExpressionParser.parseAndValidateCronString(CronExpressionParser.java:305) at com.atlassian.jira.web.component.cron.parser.CronExpressionParser.<init>(CronExpressionParser.java:75) at com.atlassian.jira.web.action.filter.FilterSubscription.doDefault(FilterSubscription.java:107) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) {noformat} It looks like the Cron expression will only check the first 6 components, if they're OK, the job can be create even the expression is illegal for example: {code} 0 0 * * * ? * 2,3,4,5,6 8 0 0 * * * ? * 2,3,4,5,6 8 11 21 .... {code} The only workaround solution is to delete the job.

    Atlassian JIRA | 5 years ago | Yilin Mo [Atlassian]
    java.lang.IllegalArgumentException: The provided cron string does not have 7 parts: 0 0 * * * ? * 2,3,4,5,6

    Root Cause Analysis

    1. java.lang.IllegalArgumentException

      The provided cron string does not have 7 parts: 0 0 * * * ? * 2,3,4,5,6

      at com.atlassian.jira.web.component.cron.parser.CronExpressionParser.parseCronString()
    2. com.atlassian.jira
      FilterSubscription.doDefault
      1. com.atlassian.jira.web.component.cron.parser.CronExpressionParser.parseCronString(CronExpressionParser.java:322)
      2. com.atlassian.jira.web.component.cron.parser.CronExpressionParser.parseAndValidateCronString(CronExpressionParser.java:305)
      3. com.atlassian.jira.web.component.cron.parser.CronExpressionParser.<init>(CronExpressionParser.java:75)
      4. com.atlassian.jira.web.action.filter.FilterSubscription.doDefault(FilterSubscription.java:107)
      4 frames
    3. Java RT
      NativeMethodAccessorImpl.invoke0
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      1 frame