CacheException when restarting JIRA Edited

Hello, I have a JIRA Instance with some custom addons (that add custom fields) , and I encountered a problem when I restart my Instance, JIRA  is correctly starting but i got many errors while going into different screens (errors 500) . Thoses errors are caused by the exception bellow.

Caused by: com.atlassian.cache.CacheException: java.lang.NullPointerException: null key in entry: null=null
at com.atlassian.cache.memory.DelegatingCachedReference.get(DelegatingCachedReference.java:83)
at com.atlassian.jira.issue.managers.CachingCustomFieldManager.getCustomFieldObject(CachingCustomFieldManager.java:282)
at java.util.Optional.map(Optional.java:215)
at com.atlassian.jira.issue.managers.CachingCustomFieldManager.getCustomFieldObject(CachingCustomFieldManager.java:293)
at com.xpandit.raven.c.l.a(Unknown Source)
... 311 more
Caused by: java.lang.NullPointerException: null key in entry: null=null
at com.google.common.collect.CollectPreconditions.checkEntryNotNull(CollectPreconditions.java:31)
at com.google.common.collect.ImmutableMultimap$Builder.put(ImmutableMultimap.java:169)
at com.google.common.collect.ImmutableListMultimap$Builder.put(ImmutableListMultimap.java:167)
at com.google.common.collect.Multimaps.index(Multimaps.java:1509)
at com.google.common.collect.Multimaps.index(Multimaps.java:1455)
at com.atlassian.jira.issue.managers.CachingCustomFieldManager$CustomFieldInMemoryStore.<init>(CachingCustomFieldManager.java:519)
at com.atlassian.jira.issue.managers.CachingCustomFieldManager.loadAllCustomFields(CachingCustomFieldManager.java:147)
at com.atlassian.cache.memory.MemoryCacheManager$1$1.load(MemoryCacheManager.java:129)
at com.atlassian.cache.memory.MemoryCacheManager$1$1.load(MemoryCacheManager.java:105)
at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3527)
at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2319)
at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2282)
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2197)
at com.google.common.cache.LocalCache.get(LocalCache.java:3937)
at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3941)
at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4824)
at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4830)
at com.atlassian.cache.memory.DelegatingCachedReference.getUnderLock(DelegatingCachedReference.java:93)
at com.atlassian.cache.memory.DelegatingCachedReference.get(DelegatingCachedReference.java:78)
... 316 more

 

Did anyone have already encountered the same error ? and have found a solution to put back JIRA on it's feets.

1 answer

1 accepted

This widget could not be displayed.

Hi Jonathan,

The first thing I would do since this is a custom add-on is see if you're cfname is being set to NULL at any point.  If so there is a bug that you can find at Prevent the method updateCustomField() from accepting NULL values:

Problem Definition

The method updateCustomField(Long id, String name, String description, CustomFieldSearcher searcher)() mentioned in this documentation allows NULL values for the name parameter.

If this method is called by a script that passes a NULL value for the name parameter, a 500 error will be returned when accessing any page in JIRA except the admin section, as shown in the screenshot below:

For this reason, the method updateCustomField() should not allow null values.

Hopefully that's all that's going on at this point.  If that is the case please vote on JRASERVER-65856 to add impact and make the necessary changes to your code. 

If that is not the issue you're running into paste the code you're working with and we 'll go from there.

Cheers,

Branden

Hello @Branden McElveen

Thanks for your response; It helped me a lot.

You were right, there were cfname values at null in the database (in the customfield table) , after fixing this there were no more null pointer exception from custom fields cache at jira startup.

Theses null values were generated by my plugin, witch create custom fields when the plugin is enabled (with customFieldManager.createCustomField(...)). Now I working on fixing the creation of custom fields to avoid creating customfields with no cfname.

I don't use the method updateCustomField so i don't think my issue is related to JRASERVER-65856. However after fixing my plugin i will add feedback about the use of the createCustomField method.

Hi Jonathan,

I'm glad that helped even though it wasn't completely related.  Please don't hesitate to reach out to us if you run into any issues in the future!

Cheers,

Branden

For information , I put here a related issue in JIRA : https://jira.atlassian.com/browse/JRASERVER-64957

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted yesterday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

72 views 1 0
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you