Error thrown when accessing or creating JIRA Agile board due to Dead References on Cascading Select custom field
Problem
1) Javascript Error thrown when accessing JIRA Agile board due to Dead References on Cascading Select custom field. The following was thrown when the user loads any of the JIRA Agile boards
An error occurred whilst rendering this message. Please contact the administrators, and inform them about this bug.
Details:----- org.apache.velocity.exception.MethodInvocationException: Invocation of method 'shouldShowSidebar' in class com.atlassian.greenhopper.web.rapid.RapidBoardAction threw exception
com.atlassian.cache.CacheException: com.atlassian.util.concurrent.LazyReference$InitializationException: java.lang.NullPointerException
at com.pyxis.greenhopper-webactions/templates/greenhopper/web/board/rapid/rapid-board.vm[line19, column 22].....
The following appears in the atlassian-jira.log
/secure/RapidBoard.jspa [com.atlassian.velocity.DefaultVelocityManager] MethodInvocationException occurred getting message body from Velocity: com.atlassian.cache.CacheException: com.atlassian.util.concurrent.LazyReference$InitializationException: java.lang.NullPointerException
com.atlassian.cache.CacheException: com.atlassian.util.concurrent.LazyReference$InitializationException: java.lang.NullPointerException
at com.atlassian.cache.memory.DelegatingCache$DelegatingLoadingCache.get(DelegatingCache.java:306)
at com.atlassian.cache.compat.delegate.DelegatingCache.get(DelegatingCache.java:37)
at com.atlassian.greenhopper.service.query.QueryToProjectMapper.getProjectContextIdsForQuery(QueryToProjectMapper.java:76)
at com.atlassian.greenhopper.service.query.QueryServiceImpl.getProjectsForRapidView(QueryServiceImpl.java:114)
at com.atlassian.greenhopper.service.query.QueryServiceImpl.getExplicitProjectsForRapidViewFilterQuery(QueryServiceImpl.java:101)
at com.atlassian.greenhopper.service.rapid.ProjectRapidViewServiceImpl.findRapidViewsByProject(ProjectRapidViewServiceImpl.java:53)
at com.atlassian.greenhopper.web.sidebar.BoardSidebarRenderer.projectIsPartOfRapidViewFilter(BoardSidebarRenderer.java:110)
at com.atlassian.greenhopper.web.sidebar.BoardSidebarRenderer.shouldShowProjectSidebar(BoardSidebarRenderer.java:103)
at com.atlassian.greenhopper.web.sidebar.BoardSidebarRenderer.shouldShowSidebar(BoardSidebarRenderer.java:96)
at com.atlassian.greenhopper.web.sidebar.BoardSidebarRenderer.shouldShowSidebar(BoardSidebarRenderer.java:83)
at com.atlassian.greenhopper.web.rapid.RapidBoardAction.shouldShowSidebar(RapidBoardAction.java:241) <+3> (NativeMethodAccessorImpl.java:62) (DelegatingMethodAccessorImpl.java:43)
2) JIRA throws an error when creating a new board. The following happens in the atlassian-jira.log
There was a SQL exception thrown by the Active Objects library:
Database:
- name:Oracle
- version:Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
- minor version:1
- major version:11
Driver:
- name:Oracle JDBC driver
- version:11.2.0.2.0
java.sql.SQLIntegrityConstraintViolationException: ORA-00001: unique constraint (XXXXXX.SYS_XXXXXXX) violated
See related: - JRASERVER-64276Getting issue details... STATUS
Diagnosis
- Check the custom field in the JQL of the affected board filter that causes this problem
- Identify the custom field that causes the problem, get the customfield ID
Run the following SQL query to see if there is any custom fields that is not associated with any field configuration
SELECT distinct(customfieldconfig) FROM customfieldoption WHERE customfieldconfig NOT IN (SELECT id FROM fieldconfiguration); 10480 10470 10240
If any rows returned, proceed to resolution.
Sometimes you have to fine tune the SQL query to get a complete list. In that case, you can run the SQL query from step 3 and the SQL query below to verify the complete list of the problematic custom field:
SELECT distinct(cf.cfname) AS "Custom Field Name", cfo.customfieldconfig AS "Field Config" FROM customfieldoption cfo LEFT JOIN customfield cf ON cfo.customfield = cf.id WHERE customfieldconfig IN ( SELECT distinct(customfieldconfig) FROM customfieldoption WHERE customfieldconfig NOT IN (SELECT id FROM fieldconfiguration));
Check that data with ID:10480,10470,10240 from customfieldoption are not used in Issues:
select count(*) from customfieldvalue where stringvalue in (select cast(id as text) from customfieldoption where customfield = 10040 and customfieldconfig in (10240,10470,10480));
Cause
The custom field has dead references in the 'customfieldoption' table.
Resolution
Always back up your data before performing any modifications to the database. If possible, test any alter, insert, update, or delete SQL commands on a staging server first.
- Stop JIRA.
Delete the entries in 'customfieldtoption' table that aren't related to this custom field context.
delete from customfieldoption where customfield=ID_from_diagnosis_step_2 and customfieldconfig=ID_from_diagnosis_step_3;
- Start JIRA and verify the problem is no longer present.