-
Bug
-
Resolution: Unresolved
-
Medium
-
None
-
7.3.9, 7.6.10, 8.8.1, 8.5.9, 8.13.13, 8.13.18, 8.20.16, 8.20.17, 9.4.21
-
7.03
-
75
-
Severity 2 - Major
-
28
-
Current Behavior
After deleting a custom field, one or more nodes in JIRA Data Center show NullPointerException when searching for issues or when viewing issues.
- NullPointerException may occur on other pages as well.
Example stacktrace:
com.atlassian.cache.CacheException: java.lang.NullPointerException at com.atlassian.cache.ehcache.DelegatingCache.get(DelegatingCache.java:104) at com.atlassian.jira.cache.DeferredReplicationCache.get(DeferredReplicationCache.java:48) at com.atlassian.jira.issue.fields.config.persistence.CachedFieldConfigSchemePersister.getConfigSchemesForCustomField(CachedFieldConfigSchemePersister.java:100) at com.atlassian.jira.issue.fields.config.manager.FieldConfigSchemeManagerImpl.getConfigSchemesForField(FieldConfigSchemeManagerImpl.java:48) at com.atlassian.jira.issue.fields.ImmutableCustomField.getConfigurationSchemes(ImmutableCustomField.java:1222) at com.atlassian.jira.jql.permission.CustomFieldClausePermissionChecker.hasPermissionToUseClause(CustomFieldClausePermissionChecker.java:44) at com.atlassian.jira.jql.permission.DefaultClausePermissionHandler.hasPermissionToUseClause(DefaultClausePermissionHandler.java:46) at com.atlassian.jira.issue.search.managers.DefaultSearchHandlerManager.getVisibleClauseHandlers(DefaultSearchHandlerManager.java:186) at com.atlassian.jira.web.component.jql.DefaultAutoCompleteJsonGenerator.getVisibleFieldNamesJson(DefaultAutoCompleteJsonGenerator.java:70) ... Caused by: java.lang.NullPointerException at com.atlassian.jira.issue.fields.config.persistence.FieldConfigSchemePersisterImpl.lambda$getConfigSchemesForCustomField$0(FieldConfigSchemePersisterImpl.java:202) at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:174) at java.util.HashMap$ValueSpliterator.forEachRemaining(HashMap.java:1625) at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481) at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499) at com.atlassian.jira.issue.fields.config.persistence.FieldConfigSchemePersisterImpl.getConfigSchemesForCustomField(FieldConfigSchemePersisterImpl.java:205) at com.atlassian.jira.issue.fields.config.persistence.CachedFieldConfigSchemePersister.loadSchemesByCustomFieldId(CachedFieldConfigSchemePersister.java:207) at com.atlassian.cache.ehcache.LoadingCache.getFromLoader(LoadingCache.java:145) at com.atlassian.cache.ehcache.LoadingCache.loadValueAndReleaseLock(LoadingCache.java:100) at com.atlassian.cache.ehcache.LoadingCache.get(LoadingCache.java:76) at com.atlassian.cache.ehcache.DelegatingCache.get(DelegatingCache.java:99) ... 268 more
Expected Results
Deleting custom field does not cause errors on any node
Cause
The cause is believed to be a race condition where the cache on NPE nodes reference a custom field that no longer exists.
Environment
JIRA Data Center with two or more nodes
Steps to reproduce
- Set breakpoint in DefaultSearchHandlerManager.java#getVisibleClauseHandlers
- Line 186, pause thread
- Attempt to add issue link - From an issue, add link then add by searching for issues (so that JQL autocomplete will be retrieved)
- Breakpoint is it.
- On another node, delete custom field
- On paused node, flush caches
- Mute breakpoints, run
- Stacktrace in logs, unable to use JQL autocomplete
Workaround
Nodes showing NullPointerException will need to be restarted or have caches flushed. NullPointerException should not appear after restart.
- Success has been reported when using ScriptRunner to flush caches
- /plugins/servlet/scriptrunner/admin/builtin/exec/com.onresolve.scriptrunner.canned.jira.admin.JiraClearCaches
- NullPointerException that continues after restart indicates a different problem is occurring
- is related to
-
JRASERVER-66995 JIRA may cache wrong value config scheme due to race condition
- Gathering Impact
-
JRASERVER-63501 Better scaling of Custom Fields and Field Configurations
- Gathering Interest
-
JRASERVER-68168 Make FieldLayoutCache population more efficient in Jira
- Gathering Interest
- causes
-
ITPLAT-100 Loading...
- has action
-
WPTIN-8220 Loading...
- mentioned in
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...