Errors when trying to display or edit filters with broken JQL

お困りですか?

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

コミュニティに質問


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

このナレッジベース記事は製品の Data Center バージョン用に作成されています。Data Center 固有ではない機能の Data Center ナレッジベースは、製品のサーバー バージョンでも動作する可能性はありますが、テストは行われていません。サーバー*製品のサポートは 2024 年 2 月 15 日に終了しました。サーバー製品を利用している場合は、アトラシアンのサーバー製品のサポート終了のお知らせページにて移行オプションをご確認ください。

*Fisheye および Crucible は除く

要約

Due to invalid JQL stored in a Jira filter's or board quick filter's content, loading pages containing that filter fail with an error 500. Often, NoViableAltException  is shown.

環境

Jira Server or Jira Data Center

診断

Any attempt to load or edit filters will fail with 500 errors, internal server configuration errors, or uncaught exceptions.

For example, viewing the Manage Filters page will not work, and an error like the following will be displayed:

com.atlassian.cache.CacheException: com.atlassian.jira.exception.DataAccessException: com.atlassian.jira.jql.parser.JqlParseException: com.atlassian.jira.jql.parser.antlr.RuntimeRecognitionException: NoViableAltException(59@[])


原因

The JQL in one or more filters' database entry has an invalid syntax.  This will cause most screens that use filters, even unrelated filters, to fail to load.  Editing or even removing the broken filters via the REST API may also fail.
Because it is not possible to save a filter with invalid JQL through the Jira interface, the underlying cause of this problem in the database is unknown in these situations.

ソリューション

(warning) Note that manual manipulation of the database can be dangerous. Please make sure you have a backup of your database before you attempt these changes.

(info) If possible, the filter should be edited (or deleted) with the REST API as described in the REST API Filter documentation. Direct database edits should be used as a last resort.

(info) The following statements are written for postgres and may need to be modified to work in other database systems.

  1. Identify the filter with the invalid JQL by checking the filter and quick filter tables:
    1. SELECT id, filtername, reqcontent FROM searchrequest;
      SELECT id, "LONG_QUERY" FROM "AO_60DB71_QUICKFILTER";
      1. find the filter with the invalid JQL statement in the reqcontent and/or LONG_QUERY columns
    2. if the error message contains a filter id, you may wish to look it up directly like so:
      1. SELECT id, filtername, reqcontent FROM searchrequest WHERE id = <filter_id_here>;
        id     | filtername   | reqcontent
        -------+--------------+-----------------------------
        10100  | brokenfilter | invalid jql "@" /$ \ ? here
      2. SELECT * FROM searchrequest;
        id     | filtername            | authorname    | description | username      | groupname | projectid | reqcontent                       | fav_count | filtername_lower
        -------+-----------------------+---------------+-------------+---------------+-----------+-----------+----------------------------------+-----------+-----------------------
        10000  | Filter for DEVL board | JIRAUSER10000 |             | JIRAUSER10000 |           |           | project = DEVL ORDER BY Rank ASC | 9001      | filter for devl board
        10100  | brokenfilter          | JIRAUSER10000 |             | JIRAUSER10000 |           |           | invalid jql "@" /$ \ ? here      | 1         | brokenfilter
  2. Edit the database record in question to set the filter content to a valid JQL
    1. For a filter:

      UPDATE searchrequest SET reqcontent = 'project = PROJKEY' WHERE id = <filter_id_here>;
    2. For a board Quick Filter:

      UPDATE "AO_60DB71_QUICKFILTER" SET LONG_QUERY = 'project = PROJKEY' WHERE id = <quick_filter_id_here>;
  3. Confirm that the previously problematic page works as expected




最終更新日 2022 年 11 月 3 日

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

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