Confluence CQL search API returns a Bad Request response when searching for non-existent space(s) instead of returning an empty result set.

XMLWordPrintable

    • 1
    • Severity 3 - Minor

      Issue Summary

      When performing a CQL search in Confluence that includes a Space key (or multiple Space keys) that do not exist, Confluence returns an error instead of an empty result set.

      • In Confluence 9.2, this results in an Internal Server Error (HTTP 500).
      • In Confluence 9.3.1 and later, this results in a Bad Request with a parameters should not be empty message.

      Steps to Reproduce

      1. Create a Confluence instance and run the official search API from The Confluence Data Center REST API using a non-existing Space:
      https://BASE_URL/rest/api/search?cql=space+%3D+%27thisspace%27&start=0&limit=100&excerpt=highlight
      1. Alternatively, you can also run Confluence’s internal search API:
      https://BASE_URL/rest/searchv3/1.0/cqlSearch?cql=space+%3D+%27thisspace%27&start=0&limit=100&excerpt=highlight

      Expected Results

      If the Space exists in Confluence, the API returns an HTTP 200 response and retrieves its details.

      If the Space doesn’t exist, the API returns either 404 (Not Found) response or 200 response, with empty result list (as it does for non-permitted spaces).

      Actual Results

      If the Space exists in Confluence, the API returns an HTTP 200 response and retrieves its details.

      If the Space doesn’t exist, the API returns an HTTP 500 or HTTP 400 response (depends on the Confluence version), with the following content:

      {
      "statusCode": 400,
      "message": "parameters should not be empty",
      "reason": "Bad Request"
      } 

      Workaround

      Currently there is no known workaround for this behavior. A workaround will be added here when available

      Versions Tested

      • Confluence 9.2.X (LTS)
      • Confluence 9.3.1

            Assignee:
            Saba Taseer
            Reporter:
            Murilo Bellini
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: