Jira startup fails with Multiple entries with same key error

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

プラットフォームについて: Server と Data Center のみ - この記事は、サーバーおよびデータセンター プラットフォームのアトラシアン製品にのみ適用されます。

症状

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:

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

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

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 - Getting issue details... STATUS

診断

  • 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

      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

      または

      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:
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:
select job_id,count(1) from clusteredjob group by job_id having count(1)>1;


  • The outcome might look like:

原因

The duplicate entry causes Jira not to start up properly.

The entry whose  ID  is older should be deleted.

tip/resting Created with Sketch.

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

The root cause is still unknown.

ソリューション

  • Shut down Jira and back up the database properly

  • Delete the problematic entry:

    delete from clusteredjob where id = 10020;

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

    データベースの変更を行う場合は必ず事前にバックアップを取得してください。可能な場合は、まずステージング サーバーで SQL コマンドの変更、挿入、更新、または削除を行うようにします。

  • Jira を再起動します。

説明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.
製品Jira
プラットフォームサーバー
最終更新日 2021 年 11 月 23 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.