Uploaded image for project: 'Atlassian Intelligence'
  1. Atlassian Intelligence
  2. AI-300

CQL searched occasionally return unexpected error codes

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Medium
    • Search - Indexing
    • None
    • Major

    Description

      Issue Summary

      When querying Confluence via CQL, occasionally unexpected error codes are returned. Requests that should succeed may result in a HTTP 400 Bad Request, or requests may fail with misleading error messages such as a HTTP 403 permission violation, when the user has full permissions. This affects CQL search endpoints such as

      • /wiki/rest/api/content/search
      • /wiki/rest/api/search

      and GraphQL queries used in other experiences as described here: https://jira.atlassian.com/browse/CONFCLOUD-74101

      Steps to Reproduce

      Query Confluence with CQL. Randomly & rarely, you may get an incorrect error code. This also occurs when Confluence is under heavy load.

      Expected Results

      The query should either succeed, or fail with the correct error code.

      Actual Results

      The HTTP response returns a 400 or other misleading error for requests that are not actually a Bad Request

      Example responses:

      {
        "statusCode": 400,
        "data": {
          "authorized": false,
          "valid": true,
          "errors": [],
          "successful": false
        },
        "message": "com.atlassian.confluence.api.service.exceptions.BadRequestException: CQL was parsed but the search manager was unable to execute the search."
      } 
      {
          "statusCode": 400,
          "data": {
              "authorized": true,
              "valid": true,
              "errors": [],
              "successful": true
          },
          "message": "com.atlassian.confluence.api.service.exceptions.BadRequestException: CQL was parsed but the search manager was unable to execute the search. Error message: java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.FutureTask@521094a3[Not completed, task = java.util.concurrent.Executors$RunnableAdapter@5195d556[Wrapped task = null]] rejected from java.util.concurrent.ThreadPoolExecutor@24b0d3ce[Running, pool size = 10, active threads = 10, queued tasks = 0, completed tasks = 19824]"
      }
      
      {
          "statusCode": 400,
          "data": {
              "authorized": true,
              "valid": true,
              "errors": [],
              "successful": true
          },
          "message": "com.atlassian.confluence.api.service.exceptions.BadRequestException: CQL was parsed but the search manager was unable to execute the search. Error message: org.postgresql.util.PSQLException: FATAL: too many connections for role \"rw-user-1-fd923819-f6ee-43f1-8d60-7d4031591705-3IMNl\""
      }
      

      Workaround

      Retry the request with exponential fallback. That is, treat them the same as a HTTP 429 request.

      Attachments

        Issue Links

          Activity

            People

              nmcginley nmcginley
              nmcginley nmcginley
              Votes:
              8 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

                Created:
                Updated: