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(
at com.atlassian.jira.issue.managers.CachingCustomFieldManager.getCustomFieldObject(
at com.atlassian.jira.issue.managers.CachingCustomFieldManager.getCustomFieldObject(
at com.xpandit.raven.c.l.a(Unknown Source)
... 311 more
Caused by: java.lang.NullPointerException: null key in entry: null=null
at com.atlassian.jira.issue.managers.CachingCustomFieldManager$CustomFieldInMemoryStore.<init>(
at com.atlassian.jira.issue.managers.CachingCustomFieldManager.loadAllCustomFields(
at com.atlassian.cache.memory.MemoryCacheManager$1$1.load(
at com.atlassian.cache.memory.MemoryCacheManager$1$1.load(
at com.atlassian.cache.memory.DelegatingCachedReference.getUnderLock(
at com.atlassian.cache.memory.DelegatingCachedReference.get(
... 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

1 votes

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.



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!



For information , I put here a related issue in JIRA :

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

2,958 views 12 18
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot