JIRA Throw Error When Trying To Export Search Result Into Excel(All fields)
症状
When user try to export search result into Excel while selecting All Fields, JIRA throw the following trace:
An error occurred whilst rendering this message. Please contact the administrators, and inform them of this bug. Details: ------- org.apache.velocity.exception.MethodInvocationException: Invocation of method 'hasValue' in class com.atlassian.jira.issue.fields.CustomFieldImpl threw exception class java.lang.RuntimeException : java.lang.reflect.InvocationTargetException
診断
- JIRA version 4.4.x
- GreenHopper Plugin is installed
- If entered the Plugin Safe Mode, the error no longer persist
If GreenHopper plugin is enabled, and user try to add the Global Rank to the default Column in the Issue Navigator, JIRA will throw another trace:
An error occurred whilst rendering this message. Please contact the administrators, and inform them of this bug. Details: ------- org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getSortComparatorSource' in class com.atlassian.jira.issue.fields.CustomFieldImpl threw exception class java.lang.NoClassDefFoundError : com/atlassian/greenhopper/customfield/rank/RankLuceneFieldSorter
In the JIRA logs, the following trace can be found:
2011-09-04 17:43:43,040 http-8082-4 ERROR admin 1063x232x1 1fbk5gm 127.0.0.1 /secure/ViewUserIssueColumns!default.jspa [com.atlassian.velocity.DefaultVelocityManager] MethodInvocationException occurred getting message body from Velocity: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException java.lang.RuntimeException: java.lang.reflect.InvocationTargetException at com.atlassian.activeobjects.tx.TransactionalProxy$1.doInTransaction(TransactionalProxy.java:47 ... Caused by: java.lang.RuntimeException: Entry to update not found: issueId=13081, nextValue=15001 at com.atlassian.greenhopper.service.rank.RankDaoImpl.setNextForIssue(RankDaoImpl.java:94)
原因
A bug reported at https://jira.atlassian.com/browse/JRA-25808 . The rank index in the Database is broken. In this example, issue with ID 13081 is referenced as "next" by 13082, but 13081 is not in the index (it should be last, having "null" as next). This causes the next "rank last" operation (the default initial action for previously unranked issues) to fail.
ソリューション
Update the database manually. The steps are as follow:
- shutdown JIRA
- backup JIRA's database
- check if there a table that is started with AO and end with RANK_ISSUE_LINK. Please replace the XXXX with hash name exist in the JIRA database
then run the following SQL query to check if there any entry that has issue with NEXT_ID 13081:
SELECT * FROM AO_XXXX_RANK_ISSUE_LINK where NEXT_ID=13081;
Replace the "13081" with the "issueID" value reported in the logs.
Then, check if there any any ISSUE_ID with 13081
SELECT * FROM AO_XXXX_RANK_ISSUE_LINK where ISSUE_ID=13081;
Then, insert an entry to the table manually:
insert into AO_XXXX_RANK_ISSUE_LINK (ISSUE_ID) values (13081);
- restart JIRA