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

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

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

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.

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.

Resolution

Always back up your data before performing any modification to the database. If possible, try your modifications on a test server.

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

    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;

    (info) Example of result:

    +-----------+--------+---------------+
    | 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:

    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);
    

    (info) 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:

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

    (info)  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:

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

    (info)  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


Last modified on Mar 11, 2019

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.