Error "Issue Type for issue with id '...' is null" when searching issues in Jira

お困りですか?

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

コミュニティに質問

プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Fisheye および Crucible は除く

    

問題

When searching for issues in Jira, a big block of errors might be shown on the screen, starting with:

The message is "An error occurred whilst rendering this message. Please contact the administrators, and inform them of this bug. Details: ------- org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getHtml' in class com.atlassian.jira.issue.fields.layout.column.ColumnLayoutItemImpl threw exception java.lang.IllegalArgumentException: Issue Type for issue with id '...' is null."

環境

Confirmed in Jira 8.5 and Jira Service Management 4.5.

Likely to happen on several Jira 7 and 8 versions as well.

診断

The error on the screen will start with:

An error occurred whilst rendering this message. Please contact the administrators, and inform them of this bug. Details: ------- org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getHtml' in class com.atlassian.jira.issue.fields.layout.column.ColumnLayoutItemImpl threw exception java.lang.IllegalArgumentException: Issue Type for issue with id '...' is null.

And in the atlassian-jira.log we should see:

2020-05-07 07:54:00,037 http-nio-127.0.0.1-8080-exec-61 ERROR <username> 473x2230574x1 e0lj6e <ip addresses>,127.0.0.1 /issues/ [c.atlassian.velocity.DefaultVelocityManager] MethodInvocationException occurred getting message body from Velocity: java.lang.IllegalArgumentException: Issue Type for issue with id '...' is null.

Which '...' can be any number that represents an issue's internal id on the jiraissue database table.

原因

This error is caused due to issues not having an associated issue type, just like the error messages suggest.

This is an exception to Jira's behavior and might have happened during interrupted operations like moving issues, bulk editions, data import or direct interference on the database.

ソリューション

The solution is to identify the corrupted issues, fix them on the database and further delete them if needed.

(info) The queries below are for the PostgreSQL database. You may need to alter them for your own database type.

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

  1. The number of affected issues might be higher than what was triggered by the issue search, so we perform a broader search on the database:

    select i.id, p.pkey, i.issuenum, i.issuetype
    from jiraissue i
    join project p on p.id = i.project
    where i.issuetype is null or i.issuetype in ('', ' ');
  2. For each different project key (pkey) that was returned above, select an issue type id available from the output of the query below:

    select p.pkey, it.id, it.pname
    from project p
    join configurationcontext cc on p.id = cc.project
    join fieldconfigschemeissuetype fci on fci.fieldconfigscheme = cc.fieldconfigscheme
    join optionconfiguration oc on oc.fieldconfig = fci.fieldconfiguration
    join issuetype it on it.id = oc.optionid
    where p.pkey = 'PROJECT-KEY'; -- <<< Replace PROJECT-KEY
  3. Update the issues with the desired issue type id:

    To update issues separately
    update jiraissue set summary = 'abcdefghijk', issuetype = <issue-type-id> where id in (<list of issue ids separated by comma>);
    To update all corrupted issues
    update jiraissue set summary = 'abcdefghijk', issuetype = <issue-type-id> where issuetype is null or i.issuetype in ('', ' ');
  4. Jira を再起動します。

  5. After Jira's back online, we may search for those corrected issues and bulk edit them as we want — even bulk delete them if that's the intention.

    JQL to search for the issues
    summary ~ 'abcdefghijk'




最終更新日 2022 年 11 月 16 日

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

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