Jira can't start up after upgrade because of Duplicate Plugin key

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

After upgrading Jira, when attempting to start the instance, the Jira server will not start fully and the logging shows a "Duplicate key" error.

Environment

Observed in 9.4.11 but could impact any version of Jira.

Diagnosis

  • The Jira process is running but Jira itself is inaccessible via the browser.

  • atlassian-jira.log contains entries like the following, stating that it is unable to start because of a duplicate key, then announcing immediately afterward that startup is complete

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 33 34 35 36 37 38 2023-10-10 11:57:45,761-0700 main ERROR [c.a.jira.startup.LauncherContextListener] Unable to start JIRA. java.lang.IllegalStateException: Duplicate key com.atlassian.jira.plugin.PluginVersionImpl@351aa09a[id=#####,key=<key>,name=SAML Single Sign On for Jira,version=4.0.11,created=<date>] at java.util.stream.Collectors.lambda$throwingMerger$0(Collectors.java:133) at java.util.HashMap.merge(HashMap.java:1254) at java.util.stream.Collectors.lambda$toMap$58(Collectors.java:1320) at java.util.stream.ReduceOps$3ReducingSink.accept(ReduceOps.java:169) at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1384) at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:566) at com.atlassian.jira.plugin.startup.PluginVersionsChangeAnalyser.buildReport(PluginVersionsChangeAnalyser.java:38) at com.atlassian.jira.plugin.JiraPluginManager.processPluginSystemChanges(JiraPluginManager.java:349) at com.atlassian.jira.plugin.JiraPluginManager.lateStartup(JiraPluginManager.java:135) at com.atlassian.jira.component.pico.ComponentManager$PluginSystem.lateStartup(ComponentManager.java:694) at com.atlassian.jira.component.pico.ComponentManager.lateStartPluginSystem(ComponentManager.java:301) at com.atlassian.jira.upgrade.PluginSystemLauncher.lateStart(PluginSystemLauncher.java:66) at com.atlassian.jira.startup.DefaultJiraLauncher.postDBActivated(DefaultJiraLauncher.java:168) at com.atlassian.jira.startup.DefaultJiraLauncher.lambda$postDbLaunch$2(DefaultJiraLauncher.java:144) at com.atlassian.jira.config.database.DatabaseConfigurationManagerImpl.doNowOrEnqueue(DatabaseConfigurationManagerImpl.java:307) at com.atlassian.jira.config.database.DatabaseConfigurationManagerImpl.doNowOrWhenDatabaseActivated(DatabaseConfigurationManagerImpl.java:202) at com.atlassian.jira.startup.DefaultJiraLauncher.postDbLaunch(DefaultJiraLauncher.java:135) at com.atlassian.jira.startup.DefaultJiraLauncher.lambda$start$0(DefaultJiraLauncher.java:102) at com.atlassian.jira.util.devspeed.JiraDevSpeedTimer.run(JiraDevSpeedTimer.java:31) at com.atlassian.jira.startup.DefaultJiraLauncher.start(DefaultJiraLauncher.java:100) at com.atlassian.jira.startup.LauncherContextListener.initSlowStuff(LauncherContextListener.java:154) at com.atlassian.jira.startup.LauncherContextListener.initSlowStuffInBackground(LauncherContextListener.java:139) at com.atlassian.jira.startup.LauncherContextListener.contextInitialized(LauncherContextListener.java:101) ... 5 filtered at java.util.concurrent.FutureTask.run(FutureTask.java:266) at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134) ... 5 filtered at java.util.concurrent.FutureTask.run(FutureTask.java:266) at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134) ... 11 filtered at java.lang.reflect.Method.invoke(Method.java:498) ... 2 filtered 2023-10-10 11:57:45,764-0700 main INFO [c.a.jira.startup.LauncherContextListener] Startup is complete. Jira is ready to serve.

Cause

There are too many instances of the same plugin key present in the pluginversion table - some condition has caused there be duplicate entries in the pluginversion table for a given plugin, in this case, it's the SAML Single Sign On for Jira plugin, but it could be any plugin.

Solution

Use the following queries to locate and remove the duplicate pluginkey values in the database.

  1. ⚠️ Take a database backup first, just in case you need to roll back to it! ⚠️

  2. Run the following query to identify all pluginkeys that have more than one entry present:

    1 SELECT pluginkey, count(pluginkey) FROM pluginversion GROUP BY pluginkey HAVING count(pluginkey) > 1;
  3. Run this next query to get a list of all the rows containing those duplicate keys for the plugin

    1 SELECT * FROM pluginversion WHERE pluginkey='<key>'; -- where <key> is anything that appeared in step 2 with more than one key
  4. Run this final query using the id values obtained from the previous one to delete all but one of the duplicated pluginkeys. Do not delete everything that you found in step three! If you found two duplicate keys you would only want to delete one of them. If you found three, delete only two.

    1 DELETE FROM pluginversion WHERE id = '<id>'; -- where <id> is one of the items that appeared in step 3
  5. Restart Jira. It should come up properly and be ready for use.

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.