Bobcares

JIRA error NullPointerException when Deleting a Custom Field | Easy fix

by | Dec 17, 2021

JIRA error NullPointerException when Deleting a Custom Field can be resolved with this handy trick from the experts at Bobcares.

At Bobcares, we offer solutions for every query, big and small, as a part of our Server Management Service.

Let’s take a look at how our Support Team recently helped a customer with a JIRA error when deleting a custom field.

Jira error NullPointerException when Deleting a Custom Field

The NullPointerException often pops up while creating or updating an issue in JIRA.

JIRA error NullPointerException when Deleting a Custom Field

This error will prevent us from deleting a custom field. We can find the stacktrace as seen below in the JIRA log files:

java.lang.NullPointerException

at com.atlassian.jira.issue.customfields.persistence.OfBizCustomFieldValuePersister.removeAllValues(OfBizCustomFieldValuePersister.java:180)
at com.atlassian.jira.issue.customfields.persistence.EagerLoadingOfBizCustomFieldPersister.removeAllValues(EagerLoadingOfBizCustomFieldPersister.java:62)
at com.atlassian.jira.issue.customfields.impl.AbstractSingleFieldType.remove(AbstractSingleFieldType.java:106)
at com.atlassian.jira.issue.fields.CustomFieldImpl.remove(CustomFieldImpl.java:649)
at com.atlassian.jira.issue.managers.DefaultCustomFieldManager.removeCustomField(DefaultCustomFieldManager.java:374)
at com.atlassian.jira.web.action.admin.customfields.DeleteCustomField.doExecute(DeleteCustomField.java:34)
at webwork.action.ActionSupport.execute(ActionSupport.java:153)
...

(more)

This error occurs due to a corrupt database. Usually due to custom field value being NULL.

Our Support Team has come up with an innovative solution to put an end to the NullPointerException error.

  1. First, we have to stop JIRA.
  2. Then, we will execute the following SQL query to verify if any custom file has NULL value:
    select * from customfieldvalue where ISSUE is null; 
    +-------+-------+-------------+-----------+------------------+-------------+-----------+-----------+-----------+
    | ID    | ISSUE | CUSTOMFIELD | PARENTKEY | STRINGVALUE      | NUMBERVALUE | TEXTVALUE | DATEVALUE | VALUETYPE |
    +-------+-------+-------------+-----------+------------------+-------------+-----------+-----------+-----------+
    | 36625 |  NULL |       10000 | NULL      | Field value      |        NULL | NULL      | NULL      | NULL      | 
    +-------+-------+-------------+-----------+------------------+-------------+-----------+-----------+-----------+
    1 row in set (0.00 sec)
    
  3. After that, we can remove the custom field value with the following command:
    delete from custom field value where issue is null;
  4. Then, we have to restart JIRA for the changes to take effect.

[Hunting for a solution to another query? We are just a click away.]

Conclusion

To conclude, the skilled Support Engineers at Bobcares demonstrated what to do when we get the NullPointerException when deleting a custom field.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.