JIRA wont boot after upgrade to 7

After sorting out some Plugin issues, JIRA was working after the upgrade. It's suddenly stopped now with following error in logs:

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)
at com.atlassian.scheduler.caesium.impl.CaesiumSchedulerService.getJobDetails(CaesiumSchedulerService.java:230)
at com.atlassian.scheduler.core.DelegatingSchedulerService.getJobDetails(DelegatingSchedulerService.java:97)
at com.atlassian.jira.service.DefaultServiceManager.ensureServiceScheduled(DefaultServiceManager.java:538)
at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
at java.util.Iterator.forEachRemaining(Iterator.java:116)
at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
at com.atlassian.jira.service.DefaultServiceManager.ensureServicesScheduled(DefaultServiceManager.java:531)
at com.atlassian.jira.service.DefaultServiceManager.start(DefaultServiceManager.java:112)
at com.atlassian.jira.ComponentManager.runStartable(ComponentManager.java:280)
at com.atlassian.jira.ComponentManager.quickStart(ComponentManager.java:210)
at com.atlassian.jira.ComponentManager.start(ComponentManager.java:157)
at com.atlassian.jira.upgrade.PluginSystemLauncher.start(PluginSystemLauncher.java:43)
at com.atlassian.jira.startup.DefaultJiraLauncher.lambda$postDbLaunch$2(DefaultJiraLauncher.java:144)
at com.atlassian.jira.config.database.DatabaseConfigurationManagerImpl.doNowOrEnqueue(DatabaseConfigurationManagerImpl.java:298)
at com.atlassian.jira.config.database.DatabaseConfigurationManagerImpl.doNowOrWhenDatabaseActivated(DatabaseConfigurationManagerImpl.java:194)
at com.atlassian.jira.startup.DefaultJiraLauncher.postDbLaunch(DefaultJiraLauncher.java:135)
at com.atlassian.jira.startup.DefaultJiraLauncher.lambda$start$0(DefaultJiraLauncher.java:101)
at com.atlassian.jira.util.devspeed.JiraDevSpeedTimer.run(JiraDevSpeedTimer.java:31)
at com.atlassian.jira.startup.DefaultJiraLauncher.start(DefaultJiraLauncher.java:99)
at com.atlassian.jira.startup.LauncherContextListener.initSlowStuff(LauncherContextListener.java:149)
at java.lang.Thread.run(Thread.java:745)

I can't find anything referencing this on the web so am now at a loss as to a fix. Java version is correct. Plugins are fine. Get the same issue when all plugins removed.

JIRA runs but is locked with redirect to "JIRALockedError" page. Ubuntu installation.

6 answers

1 vote
Chris Fuller Atlassian Team Aug 30, 2016

The exception is coming from inside the supporting code for the scheduler.  It is trying to look at one of the jobs from the database and understand whether it is using a cron expression or a simple interval to control when the job should run.  The valid values here are 'C' from cron expressions and 'I' for simple intervals.

Of course, 'I' is one of those, so the error message doesn't immediately seem to make any sense.  Here's the relevant part of the code:

private static Type toScheduleType(String value) {
    if (value != null && value.length() == 1) {
        switch (value.charAt(0)) {
            case 'C':
                return Type.CRON_EXPRESSION;
            case 'I':
                return Type.INTERVAL;
        }
    }
    throw badType(value);
}

 

This suggests to me that somehow the database value has ended up with additional characters that we just don't see, such as trailing whitespace.  I have no idea how that could have happened, but it's the best guess I've got.

I would suggest going into the database and running this query:

SELECT DISTINCT '"' || sched_type || '"' FROM clusteredjob;

The only two values you should see here are exactly "C" and "I" and if you see anything else, even just a trailing space like "I ", then that is probably why this is happening.

That said, I've never seen this, and even as the author of most of the code related to the scheduler, I have trouble understanding how it could have ended up in that state.

I had this same issue. The issue is that there ARE trailing spaces in the column because the schema in SQL Server is set to nchar(2) for the sched_type column in the clusteredjob table. I solved the issue byt changing the column type to char(1). Perhaps the code that checks this should do some type of trim or the schema be changed to char(1).

Chris Fuller Atlassian Team Nov 21, 2016

This makes some sense, but I don't understand why the column was declared as NCHAR(2). This field is declared to be an "indicator" which has the corresponding SQLServer definition of:

<field-type-def type="indicator" sql-type="NCHAR(1)" java-type="String"></field-type-def>

 

which clearly says it's supposed to be NCHAR(1).  My guess is that this is something funny with character encoding settings, but I'm not sure.

In any case, having the code tolerate trailing whitespace is a reasonable workaround.

 

Chris Fuller Atlassian Team Nov 21, 2016

I have reported this as

https://jira.atlassian.com/browse/JRA-63264

However, I suggest that you submit a support request for this and mention both that JRA and what you found.

Your UI is working ? 

 

No, just redirects to locked page.

Should have mentioned, installed on Ubuntu.

Below link might help you.

JiraLockedError with "JIRA Startup Failed" error

 

Thanks,

Hemant

0 vote
Chris Fuller Atlassian Team Nov 21, 2016

@Lesley Oakey: Your database type is actually more important.  Based on Tom's answer, I have opened this bug report:

 https://jira.atlassian.com/browse/JRA-63264

As I suggested to him, you should submit a support request for this and refer to that JRA and this discussion.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Fadoua M. Boualem
Published Monday in Trello

Using Trello to manage events

As a Jira power user, I was at first doubtful that Trello could benefit my workflow. Jira already uses boards (ones you can customize!), so why would I even need to use Trello?! In this post you will...

476 views 7 8
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you