Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-63264

ClusteredJobFactory fails to recognize job types after JIRA 7 upgrade on SQLServer

    XMLWordPrintable

Details

    Description

      Summary

      When upgrading to JIRA 7, startup fails due to an exception while starting the scheduler, reporting that it does not recognize the type of schedule data it finds.

      It reports "Unsupported schedule type: I" or "Unsupported schedule type: C" both of which are supported schedule types (interval and cron expression, respectively). The problem is caused by the column having an unexpected type and therefore including an unexpected trailing space character in its value.

      Environment

      • SQLServer
      • Upgrading to JIRA 7 from a previous version
      • A specific character encoding may be required to trigger this (uncertain)

      Steps to Reproduce

      1. Install a JIRA version prior to JIRA 7 on SQLServer
      2. Attempt an upgrade to JIRA 7

      Expected Results

      1. JIRA starts normally

      Actual Results

      The below exception is thrown in the atlassian-jira.log file:

       2016-08-30 09:12:12,057 JIRA-Bootstrap ERROR [c.atlassian.jira.ComponentManager] Error occurred while starting component 'com.atlassian.jira.service.DefaultServiceManager'.
       java.lang.IllegalArgumentException: Unsupported schedule type: I
       at com.atlassian.jira.scheduler.ClusteredJobFactory.badType(ClusteredJobFactory.java:131)
       at com.atlassian.jira.scheduler.ClusteredJobFactory.toScheduleType(ClusteredJobFactory.java:111)
       at com.atlassian.jira.scheduler.ClusteredJobFactory.getSchedule(ClusteredJobFactory.java:70)
       at com.atlassian.jira.scheduler.ClusteredJobFactory.build(ClusteredJobFactory.java:42)
       at com.atlassian.jira.scheduler.ClusteredJobFactory.build(ClusteredJobFactory.java:21)
       at com.atlassian.jira.entity.SelectQueryImpl$ExecutionContextImpl.forEach(SelectQueryImpl.java:231)
       at com.atlassian.jira.entity.SelectQueryImpl$ExecutionContextImpl.consumeWith(SelectQueryImpl.java:214)
       at com.atlassian.jira.entity.SelectQueryImpl$ExecutionContextImpl.singleValue(SelectQueryImpl.java:191)
       at com.atlassian.jira.scheduler.OfBizClusteredJobDao.find(OfBizClusteredJobDao.java:88)
       ...
      

      and the JIRA startup fails.
       

      Notes

      • This column is supposed to be of type NCHAR(1)
      • For reasons that aren't completely clear, it is being set to NCHAR(2)
      • The ClusteredJobFactory class should probably tolerate trailing whitespace when loading this field, but it does not.

      Workaround

      • Alter the "clusteredjob.sched_type" column, setting its data type to NCHAR(1)

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              cfuller crf
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: