Details
-
Bug
-
Resolution: Fixed
-
Low
-
7.11.0
-
None
-
7.11
-
3
-
Severity 2 - Major
-
Description
Environment
- Only affects JIRA Administration -> Projects (Admin mode)
- It's not known why issuetype=null in database
Steps to reproduce
- Create a project with any number of issues
- In database set issue type of any issue to null value
update jiraissue set issuetype = null where id = <issue_id>
- Reindex Jira
- Go to <Jira URL>/secure/project/BrowseProjects.jspa
Expected result
Page loads correctly
Actual result
Page responds with 500 showing following stacktrace:
java.lang.NullPointerException at com.atlassian.jira.web.action.browser.ProjectDataForArchivingCollector.lambda$getMapToUpdatedDate$1236(ProjectDataForArchivingCollector.java:50) [classes/:?] at java.util.stream.Collectors.lambda$toMap$173(Collectors.java:1321) [?:1.8.0_65] at java.util.stream.ReduceOps$3ReducingSink.accept(ReduceOps.java:169) [?:1.8.0_65] at java.util.HashMap$EntrySpliterator.forEachRemaining(HashMap.java:1683) [?:1.8.0_65] at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481) [?:1.8.0_65] at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) [?:1.8.0_65] at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) [?:1.8.0_65] at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) [?:1.8.0_65] at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499) [?:1.8.0_65] at com.atlassian.jira.web.action.browser.ProjectDataForArchivingCollector.getMapToUpdatedDate(ProjectDataForArchivingCollector.java:50) [classes/:?] at com.atlassian.jira.web.action.browser.BrowseProjects$2.get(BrowseProjects.java:169) [classes/:?] at com.atlassian.jira.web.action.browser.BrowseProjects$2.get(BrowseProjects.java:153) [classes/:?] at com.google.common.base.Suppliers$MemoizingSupplier.get(Suppliers.java:125) [guava-18.0.jar:?] at com.atlassian.jira.web.action.browser.BrowseProjects.doExecute(BrowseProjects.java:287) [classes/:?] at webwork.action.ActionSupport.execute(ActionSupport.java:165) [webwork-1.4-atlassian-30.jar:?] at com.atlassian.jira.action.JiraActionSupport.execute(JiraActionSupport.java:63) [jira-api-7.11.3-SNAPSHOT.jar:?] at webwork.interceptor.DefaultInterceptorChain.proceed(DefaultInterceptorChain.java:39) [webwork-1.4-atlassian-30.jar:?] at webwork.interceptor.NestedInterceptorChain.proceed(NestedInterceptorChain.java:31) [webwork-1.4-atlassian-30.jar:?] at webwork.interceptor.ChainedInterceptor.intercept(ChainedInterceptor.java:16) [webwork-1.4-atlassian-30.jar:?] at webwork.interceptor.DefaultInterceptorChain.proceed(DefaultInterceptorChain.java:35) [webwork-1.4-atlassian-30.jar:?] at webwork.dispatcher.GenericDispatcher.executeAction(GenericDispatcher.java:225) [webwork-1.4-atlassian-30.jar:?] at webwork.dispatcher.GenericDispatcher.executeAction(GenericDispatcher.java:154) [webwork-1.4-atlassian-30.jar:?] at com.atlassian.jira.web.dispatcher.JiraWebworkActionDispatcher.service(JiraWebworkActionDispatcher.java:138) [classes/:?] at javax.servlet.http.HttpServlet.service(HttpServlet.java:742) [servlet-api.jar:?] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) [catalina.jar:8.5.29] ...
Workaround
Before executing this operation please back up your system
To ensure data integrity, the following steps should be followed:
- Identify the offending issue and its important field values with this SQL query:
select j.id, j.project, p.pkey, j.issuenum, j.issuetype, j.summary, j.description, j.issuestatus, j.workflow_id from jiraissue j inner join project p on j.project = p.id where j.issuetype is null order by p.pkey, j.issuenum;
Sample output:
id project pkey issuenum issuetype summary description issuestatus workflow_id 11300 10200 PUB 3 NULL test NULL 10001 11002
Take note of issue ID 11300 for the last step
- From GUI, create a new issue in project PUB (found above) of any issue type
- View the new issue -> Mouse over Edit button -> Get issue ID from browser status bar e.g. 11400
- Run this query to get the same data of the new issue:
select j.id, j.project, p.pkey, j.issuenum, j.issuetype, j.summary, j.description, j.issuestatus, j.workflow_id from jiraissue j inner join project p on j.project = p.id where j.id = 11400
Sample output:
id project pkey issuenum issuetype summary description issuestatus workflow_id 11400 10200 PUB 14 10002 test NULL 10000 11500
- Update the offending issue (use ID from step 1) with the same issuetype, issuestatus, and workflow_id returned above (if necessary update its summary and description as well):
update jiraissue set issuetype = 10002, issuestatus = 10000, workflow_id = 11500 where id = 11300;
This will place the issue in the right type, workflow, and status
- Restart and re-index JIRA
If only 1 project is affected, re-index only that project