java.lang.IllegalArgumentException while accessing an issue in a JIRA application

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

JIRA applications throw a java.lang.IllegalArgumentException while accessing an issue. The following appears on the screen:

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 System Error A system error has occurred. Please try submitting this problem via the Support Request Page Otherwise, please create a support issue on our support system at http://support.atlassian.com with the following information: a description of your problem cut & paste the error and system information found below attach the application server log file ( /opt/jira-install/jira/webapps/atlassian-jira/data/current/log/atlassian-jira.log ) Cause: java.lang.IllegalArgumentException: Passed List had more than one value. Stack Trace: [hide] java.lang.IllegalArgumentException: Passed List had more than one value. at org.ofbiz.core.entity.EntityUtil.getOnly(EntityUtil.java:62) at com.atlassian.jira.issue.managers.DefaultIssueManager.getIssue(DefaultIssueManager.java:120) at com.atlassian.jira.issue.managers.DefaultIssueManager.getIssueObject(DefaultIssueManager.java:278) at com.atlassian.jira.servlet.QuickLinkServlet.linkToIssue(QuickLinkServlet.java:139) at com.atlassian.jira.servlet.QuickLinkServlet.service(QuickLinkServlet.java:46) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.atlassian.jira.web.filters.steps.ChainedFilterStepRunner.doFilter(ChainedFilterStepRunner.java:74) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.atlassian.core.filters.HeaderSanitisingFilter.doFilter(HeaderSanitisingFilter.java:44) ...

Diagnosis

The following query should not return any result. In case it does, consult the resolution section.

1 select ja.pkey, ja.id, p.pname as 'Project' from jiraissue ja, jiraissue jb, project p where ja.pkey=jb.pkey AND ja.id != jb.id and p.id=ja.project;

Cause

The cause of this issue is unknown. Possibly related to database transactions that have not completed successfully while creating issues, then inserting duplicated entries in the database.

Solution

Resolution

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.

  1. Shutdown the application.

  2. Run the following query to identify if there are issues with duplicated pkey:

    1 select ja.pkey, ja.id, p.pname as 'Project' from jiraissue ja, jiraissue jb, project p where ja.pkey=jb.pkey AND ja.id != jb.id and p.id=ja.project;

    ℹ️ Example of result:

    1 2 3 4 5 6 7 8 +-----------+--------+---------------+ | pkey | id | Project | +-----------+--------+---------------+ | CSP-20091 | 108204 | Confluence | | CSP-20091 | 108203 | Confluence | | JSP-16781 | 59748 | JIRA | | JSP-16781 | 59766 | JIRA | +-----------+--------+---------------+
  3. Run this query to find the correct empty slot for a pkey in these projects:

    1 select pkey from jiraissue where id in (select max(id) from jiraissue where project in (select distinct ja.project from jiraissue ja, jiraissue jb where ja.pkey=jb.pkey AND ja.id != jb.id) group by project);

    ℹ️ Check the value returned, which is the last issue created in each project, and add "1" to the number. For example, if this query returns JSP-16838, then use JSP-16839 on the queries listed in step 4 and 5.

  4. Modify the pkey of the duplicated issues:

    1 UPDATE jiraissue SET pkey = '<New_pkey_from_step_3>' WHERE id = <id_from_step_2>;

    ℹ️ Where <New_pkey_from_step_3> is the pkey from step 3 +1 and <id_from_step_2> is the id of one of the issue with duplicated pkey.

  5. Run the following query as well to update the project counter:

    1 UPDATE project SET pcounter = <New_pkey_from_step_3_only_numbers> WHERE pname = '<Project_from_step_2>';

    ℹ️ Where <New_pkey_from_step_3_only_numbers> is only the numers of the pkey from step 3 +1.

  6. Restart the JIRA application.

  7. Manually perform a re-indexing

Updated on April 7, 2025

Still need help?

The Atlassian Community is here for you.