Error when removing an option from a select list custom field

お困りですか?

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

コミュニティに質問

症状

When trying to remove an option from a select list custom field, an error screen is displayed by JIRA.

The following appears in the Technical Details of that error, and also in atlassian-jira.log:

2014-01-31 16:56:30,583 http-bio-10617-exec-19 ERROR admin 1016x557x1 187l96b 0:0:0:0:0:0:0:1%0 /secure/admin/EditCustomFieldOptions!remove.jspa [webwork.util.ValueStack] query="affectedIssues/size" {[id="affectedIssues" type="8" values=""]} {[id="size" type="8" values=""]}
java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
...lots of lines...
Caused by: java.lang.NullPointerException
	at com.atlassian.jira.issue.context.ProjectContext.<init>(ProjectContext.java:49)
	at com.atlassian.jira.issue.fields.config.manager.FieldConfigSchemeManagerImpl.getRelevantConfigScheme(FieldConfigSchemeManagerImpl.java:321)
	at com.atlassian.jira.issue.fields.config.manager.FieldConfigSchemeManagerImpl.getRelevantConfig(FieldConfigSchemeManagerImpl.java:292)
	at com.atlassian.jira.issue.fields.CustomFieldImpl.getRelevantConfig(CustomFieldImpl.java:637)
	at com.atlassian.jira.issue.fields.CustomFieldImpl.getRelevantConfig(CustomFieldImpl.java:644)
	... 274 more

診断

Run the below SQL to detect corrupt entries in the datbase:

select cfv.* from customfieldvalue cfv
left join jiraissue ji on (cfv.issue = ji.id)
where ji.id is null;

If any rows are returned, you are affected by this issue.

原因

There are some assignments of the custom field value to issues which no longer exist. When JIRA tries to delete the custom field value, it fails when looking for the missing issue which the custom field is assigned to. We're not sure how to reproduce this with the JIRA UI, however this could occur due to issues being removed via SQL.

ソリューション

データベースの変更を行う場合は 必ず事前にバックアップを取得してください。可能な場合はテスト サーバーで変更を試すことをおすすめします。

  • Jira を停止します。
  • Run the below sql to remove all the affected issues

    delete from customfieldvalue
    where id in (
        select cfv.id
        from customfieldvalue cfv
        left join jiraissue ji on (cfv.issue = ji.id)
        where ji.id is null);
  • Jira を起動します。
Last modified on Mar 30, 2016

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

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