Received java.lang.NumberFormatException when viewing issue history tab

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

The following appears in the atlassian-jira.log:

2014-10-22 09:49:51,745 http-bio-xxx-exec-4 ERROR xxx xxxx xxx xxxx /browse/CAPA-106 [com.atlassian.velocity.DefaultVelocityManager] MethodInvocationException occurred getting message body from Velocity: java.lang.NumberFormatException: For input string: "null"
java.lang.NumberFormatException: For input string: "null"
	at java.lang.NumberFormatException.forInputString(Unknown Source)
	at java.lang.Long.parseLong(Unknown Source)
	at java.lang.Long.<init>(Unknown Source)
	at com.atlassian.jira.issue.tabpanels.ChangeHistoryAction.getPrettyDuration(ChangeHistoryAction.java:222)
	at sun.reflect.GeneratedMethodAccessor7444.invoke(Unknown Source)  <+1>
	at java.lang.reflect.Method.invoke(Unknown Source)

Diagnose

Search for the Null value in change history table.

select * from changeitem where groupid in (select ID from changegroup where issueid in (select ID from jiraissue where project = (select ID from project where pkey = '<PROJECT_KEY>') and issuenum = '<ISSUE_NUMBER>'));

Cause

There are few 'Null' value in change history table.

Workaround

For JIRA 6.x and above

  1. Backup JIRA.
  2. Shutdown JIRA.
  3. Run the SQL command below:

    update changeitem set newvalue='<ANY_VALUE>' , newstring='<ANY_VALUE>' where groupid in (select ID from changegroup where issueid in (select ID from jiraissue where project = (select ID from project where pkey = '<PROJECT_KEY>') and issuenum = '<ISSUE_NUMBER>')) and newvalue = 'null';


  4. Start JIRA.
  5. Run Integrity Checker to fix any errors returned (if no errors should be fine).

 

Last modified on Mar 30, 2016

Was this helpful?

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