Uploaded image for project: 'Central AI/Rovo'
  1. Central AI/Rovo
  2. AI-913

Using SpacesWithCreatePermission in CQL can cause 500 Internal Server Error

    XMLWordPrintable

Details

    • Minor
    • 1

    Description

      Issue Summary

      When using CQL that searches over a large number of space, the REST search endpoint can return a 500 error. This is caused by the CQL being interpolated into a Lucene query that gets sent to the back end service, and the query exceeds the 2048 term limit.

      Steps to Reproduce

      1. Do a CQL search with
        /wiki/rest/api/content/search?cql=type = 'space' and space in spacesWithCreatePermission(<permission>)

      Expected Results

      The endpoint returns with the expected data.

      Actual Results

      The below exception is thrown

      "statusCode": 500,
      "message": "com.atlassian.confluence.api.service.exceptions.SSStatusCodeException: CQL was parsed but the search manager was unable to execute the search. Error message: com.atlassian.confluence.api.service.exceptions.SSStatusCodeException: There was an error returned from XP-Search Aggregator API: HTTP/1.1 500 Internal Server Error" 

      Workaround

      Re-write the CQL to not use spacesWithCreatePermission.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jrichards@atlassian.com James Richards
              Votes:
              3 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated: