Installing a JIRA Plugin Results in 'Duplicate entry'

Symptoms

The following appears in the atlassian-jira.log:

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.

  1. Find out the highest sequence value in the pluginversion table. This can be achieved with the following query:

    mysql> SELECT * FROM pluginversion;
    

    It should yield similar results to this:

    | 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 |
    
  2. 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:

    mysql> update SEQUENCE_VALUE_ITEM set SEQ_ID = 10070 where SEQ_NAME = 'PluginVersion';
    

    (info) Keep in mind that that the max ID may differ between each JIRA instance. Modify the SEQ_ID number to be higher or lower as needed, but it should always be higher than the max ID in the pluginversion table.

Was this helpful?

Thanks for your feedback!

Why was this unhelpful?

Have a question about this article?

See questions about this article

Powered by Confluence and Scroll Viewport