NullPointerException when Deleting a Custom Field

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

症状

When creating or updating an issue, the following error is thrown in JIRA:


When trying to delete a custom field, the custom field cannot be removed. The stacktrace will appear as following 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)

原因

The database is corrupted. There is a custom field value associated to a 'NULL' issue.

ソリューション

データベースの変更を行う場合は必ず事前にバックアップを取得してください。可能な場合は、まずステージング サーバーで SQL コマンドの変更、挿入、更新、または削除を行うようにします。

  1. Jira を停止します。
  2. Perform the following SQL query to check whether there are any custom fields assigned to 'NULL' issue. You should get

    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. Remove the custom field value:

    delete from customfieldvalue where issue is null;
    
  4. Jira を再起動します。

Last modified on Mar 21, 2024

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.