Installing a JIRA Plugin Results in 'Duplicate entry'
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
Symptoms
The following appears in the atlassian-jira.log
:
1
2
3
Caused by: com.atlassian.jira.exception.DataAccessException: org.ofbiz.core.entity.GenericEntityException: while inserting:
[GenericEntity:PluginVersion][id,10020][created,2009-05-11 11:34:10.688][name,JIRA Charting Plugin][key,com.atlassian.jira.ext.charting][version,1.4.1] (SQL Exception while executing the following:
INSERT INTO pluginversion (ID, pluginname, pluginkey, pluginversion, CREATED) VALUES (?, ?, ?, ?, ?) (Duplicate entry '10020' for key 1))
Cause
The problem relates to the the sequence value being duplicated for the plugins table.
Resolution
Test the solution in a development environment prior to implementing in production. The provided solution may for each vary slightly depending on the JIRA instance.
Find out the highest sequence value in the pluginversion table. This can be achieved with the following query:
1
mysql> SELECT * FROM pluginversion;
It should yield similar results to this:
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
| ID | pluginname | pluginkey | pluginversion | CREATED | | 10000 | User Format | jira.user.format | 1.0 | 2008-10-06 09:00:34 | | 10001 | Admin Menu Sections | jira.webfragments.admin | 1.0 | 2008-10-06 09:00:34 | | 10002 | Custom Field Types & Searchers | com.atlassian.jira.plugin.system.customfieldtypes | 1.0 | 2008-10-06 09:00:34 | | 10003 | RPC JIRA Plugin | com.atlassian.jira.ext.rpc | 3.13 | 2008-10-07 03:42:44 | | 10004 | Web Resources Plugin | jira.webresources | 1.0 | 2008-10-06 09:00:34 | | 10005 | Issue Operations Plugin | com.atlassian.jira.plugin.system.issueoperations | 1.0 | 2008-10-06 09:00:34 | | 10006 | Workflow Plugin | com.atlassian.jira.plugin.system.workflow | 1.0 | 2008-10-06 09:00:34 | | 10007 | User Navigation Bar Sections | jira.webfragments.user.navigation.bar | 1.0 | 2008-10-06 09:00:34 | | 10008 | Issue Tab Panels Plugin | com.atlassian.jira.plugin.system.issuetabpanels | 1.0 | 2008-10-06 09:00:34 | | 10009 | Renderer Plugin | com.atlassian.jira.plugin.system.jirarenderers | 1.0 | 2008-10-06 09:00:34 | | 10010 | Renderer Component Factories Plugin | com.atlassian.jira.plugin.wiki.renderercomponentfactories | 1.0 | 2008-10-06 09:00:34 | | 10011 | Reports Plugin | com.atlassian.jira.plugin.system.reports | 1.0 | 2008-10-06 09:00:34 | | 10012 | FishEye Plugin | com.atlassian.jira.ext.fisheye | 2.1 | 2008-10-07 03:42:44 | | 10013 | Top Navigation Bar | jira.top.navigation.bar | 1.0 | 2008-10-06 09:00:34 | | 10014 | Webwork Plugin | com.atlassian.jira.plugin.system.webwork1 | 1.0 | 2008-10-06 09:00:34 | | 10015 | Portlets Plugin | com.atlassian.jira.plugin.system.portlets | 1.0 | 2008-10-06 09:00:34 | | 10016 | Preset Filters Sections | jira.webfragments.preset.filters | 1.0 | 2008-10-06 09:00:34 | | 10017 | Browse Project Operations Sections | jira.webfragments.browse.project.operations | 1.0 | 2008-10-06 09:00:34 | | 10018 | Issue Views Plugin | jira.issueviews | 1.0 | 2008-10-06 09:00:34 | | 10019 | User Profile Links | jira.webfragments.user.profile.links | 1.0 | 2008-10-06 09:00:34 | | 10020 | Project Panels Plugin | com.atlassian.jira.plugin.system.project | 1.0 | 2008-10-06 09:00:34 | | 10021 | Content Link Resolvers Plugin | com.atlassian.jira.plugin.wiki.contentlinkresolvers | 1.0 | 2008-10-06 09:00:34 | | 10022 | Wiki Renderer Macros Plugin | com.atlassian.jira.plugin.system.renderers.wiki.macros | 1.0 | 2008-10-06 09:00:34 | | 10023 | View Project Operations Sections | jira.webfragments.view.project.operations | 1.0 | 2008-10-06 09:00:34 | | 10024 | Project Role Actors Plugin | com.atlassian.jira.plugin.system.projectroleactors | 1.0 | 2008-10-06 09:00:34 | | 10025 | JIRA Footer | jira.footer | 1.0 | 2008-10-06 09:00:34 | | 10051 | Current User Status Plugin | com.sourcelabs.jira.plugin.portlet.currentuser | 1.0.1 | 2008-10-07 03:45:24 |
Increase the table's sequence value to be higher than the highest ID number in your instances table. In this case the highest number was '10051', so to be safe the Sequence ID should be updated to '10070' to give a slight buffer. This can be accomplished through the following query:
1
mysql> update SEQUENCE_VALUE_ITEM set SEQ_ID = 10070 where SEQ_NAME = 'PluginVersion';
ℹ️ Keep in mind that that the max
ID
may differ between each JIRA instance. Modify theSEQ_ID
number to be higher or lower as needed, but it should always be higher than the maxID
in the pluginversion table.
Was this helpful?