Jira startup fails with Multiple entries with same key error

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

Symptoms

An exception due to multiple entries with the same key can cause Jira to either fail to start or fail to send Service Management Notifications.

1. Jira fails to start and display this message:

(Auto-migrated image: description temporarily unavailable)

From Jira_Home/log/atlassian-jira.log, this error is thrown:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 2016-01-31 17:02:42,744 localhost-startStop-1 ERROR [c.a.jira.startup.LauncherContextListener] Unable to start Jira. java.lang.IllegalArgumentException: Multiple entries with same key: AutomationRule-2=Sun Jan 31 00:00:00 SGT 2016 and AutomationRule-2=Sun Jan 18 00:00:00 SGT 2015 at com.google.common.collect.ImmutableMap.checkNoConflict(ImmutableMap.java:150) at com.google.common.collect.RegularImmutableMap.checkNoConflictInBucket(RegularImmutableMap.java:104) at com.google.common.collect.RegularImmutableMap.<init>(RegularImmutableMap.java:70) at com.google.common.collect.ImmutableMap$Builder.build(ImmutableMap.java:254) at com.atlassian.jira.scheduler.OfBizClusteredJobDao.refresh(OfBizClusteredJobDao.java:111) at com.atlassian.scheduler.caesium.impl.SchedulerQueueImpl.refreshClusteredJobsFromDao(SchedulerQueueImpl.java:139) at com.atlassian.scheduler.caesium.impl.SchedulerQueueImpl.refreshClusteredJobsUnderLock(SchedulerQueueImpl.java:130) at com.atlassian.scheduler.caesium.impl.SchedulerQueueImpl.refreshClusteredJobs(SchedulerQueueImpl.java:117) at com.atlassian.scheduler.caesium.impl.CaesiumSchedulerService.refreshClusteredJobs(CaesiumSchedulerService.java:319) at com.atlassian.scheduler.caesium.impl.CaesiumSchedulerService.startImpl(CaesiumSchedulerService.java:245) at com.atlassian.jira.scheduler.JiraCaesiumSchedulerService.startImpl(JiraCaesiumSchedulerService.java:36) at com.atlassian.scheduler.core.AbstractSchedulerService.start(AbstractSchedulerService.java:180) at com.atlassian.jira.scheduler.JiraSchedulerLauncher.proceedIfAllClear(JiraSchedulerLauncher.java:41) at com.atlassian.jira.scheduler.JiraSchedulerLauncher.start(JiraSchedulerLauncher.java:27) at com.atlassian.jira.startup.ActiveServicesLauncher.start(ActiveServicesLauncher.java:55) at com.atlassian.jira.startup.DefaultJiraLauncher.lambda$postDbLaunch$499(DefaultJiraLauncher.java:134) at com.atlassian.jira.startup.DefaultJiraLauncher$$Lambda$16/878583859.run(Unknown Source) 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:121) at com.atlassian.jira.startup.DefaultJiraLauncher.lambda$start$497(DefaultJiraLauncher.java:90) at com.atlassian.jira.startup.DefaultJiraLauncher$$Lambda$2/679677406.run(Unknown Source) at com.atlassian.jira.util.devspeed.JiraDevSpeedTimer.run(JiraDevSpeedTimer.java:31) at com.atlassian.jira.startup.DefaultJiraLauncher.start(DefaultJiraLauncher.java:88) at com.atlassian.jira.startup.LauncherContextListener.contextInitialized(LauncherContextListener.java:79) ... 5 filtered at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)

2. Service Management Notifications fail to send

1 2 2017-10-23 16:56:16,738 Jira-Bootstrap ERROR [c.a.jira.scheduler.JiraSchedulerLauncher] A RuntimeException occurred during JiraSchedulerLauncher servlet context initialisation - Multiple entries with same key: sd.custom.notification.batch.send=Fri Oct 20 10:26:48 CEST 2017 and sd.custom.notification.batch.send=Fri Oct 20 10:26:48 CEST 2017. java.lang.IllegalArgumentException: Multiple entries with same key: sd.custom.notification.batch.send=Fri Oct 20 10:26:48 CEST 2017 and sd.custom.notification.batch.send=Fri Oct 20 10:26:48 CEST 2017

both are related to JRASERVER-64325 - Jira fails to start due to duplicate job IDs in the clusteredjob table.

Diagnosis

  • According to the error message above, there are 2 entries with the same key AutomationRule-2

  • These entries are stored in the clusteredjob table in the Jira database:

    • One has next_run scheduled on Sun Jan 31 00:00:00 SGT 2016

    • The other has next_run scheduled on Sun Jan 18 00:00:00 SGT 2015

      Example keys below

      1 Multiple entries with same key: AutomationRule-2=Sun Jan 31 00:00:00 SGT 2016 and AutomationRule-2=Sun Jan 18 00:00:00 SGT 2015

      Or

      1 Multiple entries with same key: sd.custom.notification.batch.send=Fri Oct 20 10:26:48 CEST 2017 and sd.custom.notification.batch.send=Fri Oct 20 10:26:48 CEST 2017
  • This SQL query identifies the entries:

1 select * from clusteredjob where job_id = 'AutomationRule-2';

replace AutomationRule-2 with the job_id found in the error message

  • This query can also be used to find other offending jobs with multiple entries:

1 select job_id,count(1) from clusteredjob group by job_id having count(1)>1;
  • The outcome might look like this:

(Auto-migrated image: description temporarily unavailable)

Cause

The duplicate entry causes Jira not to start up properly.

The entry whose ID is older should be deleted.

In this case, it's the one that reads AutomationRule-2 (the ID is 10020).

The root cause is still unknown.

Solution

Resolution

  • Shut down Jira and back up the database properly.

  • Delete the problematic entry:

    1 delete from clusteredjob where id = 10020;

    replace 10020 with the ID found in the Diagnosis section and evaluated according to the Cause section

    Always back up your data before making any database modifications. If possible, test any alter, insert, update, or delete SQL commands on a staging server first.

  • Restart Jira.

Updated on April 9, 2025

Still need help?

The Atlassian Community is here for you.