Uploaded image for project: 'Xray for Jira'
  1. Xray for Jira
  2. XRAY-11746

Version filter search in the Test Coverage panel fails with Oracle error ORA-01795 when the project IN clause exceeds 1000 entries

    XporterXMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Unresolved
    • Xray DC 8.4.6
    • Xray DC 8.5.5
    • Test Coverage
    • None
      • Jira Version:
        10.3.22

      • App Version:
        8.4.6-j10

    • UNCOVERED

    Description

      The Version filter on the Test Coverage (Requirement Coverage) panel of a Requirement issue calls /rest/raven/1.0/searchVersion/projectFixVersions to search Fix Versions. That endpoint builds a single SQL query with one bind parameter per project in scope:

      SELECT DISTINCT V.VNAME FROM PROJECTVERSION V WHERE LOWER(V.VNAME) LIKE :search || '%' AND V.PROJECT IN (<projects>) ORDER BY V.VNAME
      

      On Oracle databases, an IN list is limited to 1000 expressions. When the number of projects passed into this query exceeds that limit, Oracle rejects the statement with ORA-01795: maximum number of expressions in a list is 1000, and the request fails every time. The Version filter becomes completely unusable on any instance where this project count is exceeded. This is the same class of defect previously fixed in XRAY-8099 and XRAY-7389 for other unchunked IN clauses, just not this code path (com.xpandit.raven.repository.ProjectsVersionRepositoryImpl).

      Pre-conditions

      • Xray Data Center running on an Oracle database.
      • The Jira instance (or the set of projects visible to the requesting user, pending confirmation above) has more than 1000 projects.

      How to reproduce

      1. On an Oracle backed Xray Data Center instance with more than 1000 projects, open any Requirement type issue.
      2. Go to the Test Coverage panel (with Requirement Coverage enabled).
      3. Open the Version filter and enter a search term (or just open the dropdown, depending on how the search is triggered).
      4. Observe the request to /rest/raven/1.0/searchVersion/projectFixVersions fails.

      Actual result/Attachments

      The user sees Jira's generic AJAX error dialog: "The Jira server was contacted but has returned an error response. We are unsure of the result of this operation." No Fix Versions are returned and the Version filter cannot be used. Server side, every call to the endpoint throws:

      org.jdbi.v3.core.statement.UnableToExecuteStatementException: java.sql.SQLSyntaxErrorException: ORA-01795: maximum number of expressions in a list is 1000
      [statement: SELECT DISTINCT V.VNAME FROM PROJECTVERSION V WHERE LOWER(V.VNAME) LIKE :search || '%' AND V.PROJECT IN (<projects>) ORDER BY V.VNAME]
      

      Stack trace runs through com.xpandit.raven.repository.ProjectsVersionRepositoryImpl and com.xpandit.raven.rest.internal.h. Reproduced consistently: 52 out of 52 calls failed the same way in the customer log over a six minute window (log attached from SUPPORT-121517). A screenshot of the client side dialog is attached (hostname cropped for customer privacy).

      Expected result

      The Version filter should return matching Fix Versions successfully regardless of how many projects exist in scope, by chunking the project IN clause into batches under the Oracle 1000 element limit (or an equivalent fix), consistent with how XRAY-8099 and XRAY-7389 addressed similar IN clause limits elsewhere.

      Version

      •  Jira: 10.3.22
      •  Xray: 8.4.6-j10 (App Version)
      • Hosting: Data Center
      • Database: Oracle

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              joao.silva João Silva
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: