Error rendering 'com.atlassian.jira.jira-view-issue-plugin:timetrackingmodule'
Symptoms
Viewing particular issues shows the following error:
Error rendering 'com.atlassian.jira.jira-view-issue-plugin:timetrackingmodule'. Please contact your JIRA administrators.
The following appears in the atlassian-jira.log
:
2015-01-26 15:09:11,209 http-bio-8014-exec-21 ERROR matheus 909x54x1 1fg0cr8 192.168.10.239 /browse/DEMO-1 [jira.web.component.ModuleWebComponentImpl] An exception occured while rendering the web panel: com.atlassian.jira.jira-view-issue-plugin:timetrackingmodule (null)
java.lang.NullPointerException
at com.atlassian.jira.security.DefaultPermissionManager.doIssuePermissionCheck(DefaultPermissionManager.java:284)
at com.atlassian.jira.security.DefaultPermissionManager.hasPermission(DefaultPermissionManager.java:207)
at com.atlassian.jira.security.WorkflowBasedPermissionManager.hasPermission(WorkflowBasedPermissionManager.java:111)
at com.atlassian.jira.security.DefaultPermissionManager.hasPermission(DefaultPermissionManager.java:202)
at com.atlassian.jira.security.WorkflowBasedPermissionManager.hasPermission(WorkflowBasedPermissionManager.java:104)
at sun.reflect.GeneratedMethodAccessor263.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
Diagnosis
Run the following queries in JIRA's database - if anything is returning, please continue to the "Workaround" section:
SELECT il.* FROM issuelink il LEFT JOIN jiraissue ji ON ji.id = il.destination WHERE ji.issuenum IS NULL;
SELECT il.* FROM issuelink il LEFT JOIN jiraissue ji ON ji.id = il.source WHERE ji.issuenum IS NULL;
You can see with the queries below which issues are being affected by this problem:
SELECT p.pkey, ji.issuenum FROM jiraissue ji JOIN (SELECT il.* FROM issuelink il LEFT JOIN jiraissue ji ON ji.id = il.destination WHERE ji.issuenum IS NULL) AS pl ON pl.source = ji.id JOIN project p ON ji.project = p.id;
SELECT p.pkey, ji.issuenum FROM jiraissue ji JOIN (SELECT il.* FROM issuelink il LEFT JOIN jiraissue ji ON ji.id = il.source WHERE ji.issuenum IS NULL) AS pl ON pl.destination = ji.id JOIN project p ON ji.project = p.id;
The issues returned with this second query will not display the same errors described above, but still are part of orphaned links that should be removed.
Workaround
- Backup JIRA!
- Stop JIRA.
Run the following SQL statements in JIRA's database:
DELETE FROM issuelink WHERE id IN (SELECT il.id FROM issuelink il LEFT JOIN jiraissue ji ON ji.id = il.destination WHERE ji.issuenum IS NULL); DELETE FROM issuelink WHERE id IN (SELECT il.id FROM issuelink il LEFT JOIN jiraissue ji ON ji.id = il.source WHERE ji.issuenum IS NULL);
Restart JIRA.
After that you should no longer see problems viewing those issues.