searchedSpaces query returns incorrect error response

XMLWordPrintable

    • Severity 3 - Minor

      Issue Summary

      • This is a high priority PIR AIR for - https://ops.internal.atlassian.com/jira/browse/PIR-12098 for HOT-99124.
      • The root cause of HOT-99124 - When creating a new page it shows "Editing is restricted for this content" is failures in xp-content-search (HOT-99122). This bug is for misleading error "Editing is restricted for this content" which shows up on the screen when users land in the editor after creating a new page.
      • The FE shows above error on the screen because `searchedSpaces` query which is a part of `SpaceSelectorQuery` returns incorrect error response.
        Sample query -
      searchedSpaces: search(cql: $cql, first: $limit) {
            count
            nodes {
              space {
                id
                homepage {
                  id
                  title
                }
                operations {
                  operation
                  targetType
                }
                key
                icon {
                  path
                }
                name
                containsExternalCollaborators
              }
            }
          } 

      Sample incorrect error response -

      {
        "errors": [
          {
            "message": "a0ce0ab6-3b1a-416d-a631-31129a79976d: com.atlassian.confluence.api.service.exceptions.BadRequestException: CQL was parsed but the search manager was unable to execute the search. CQL: 'type = 'space' AND (space.key = '~323374754'\n          OR space.title ~ '~323374754*'\n          OR space.title ~ '~323374754')'. Error message: com.atlassian.confluence.core.ConfluenceException: There was an error returned from XP-Search Aggregator API: 502",
            "path": [
              "search"
            ],
            "extensions": {
              "microsID": "a0ce0ab6-3b1a-416d-a631-31129a79976d",
              "data": {
                "authorized": false,
                "valid": true,
                "errors": [],
                "successful": false,
                "notSuccessful": true
              },
              "statusCode": 400
            }
          }
        ],
        "data": {
          "search": null
        }
      } 

      Notice the `"authorized": false` field in the response. This is should ideally be `true` because this is clearly not an authorization error. This ticket is for fixing that.

      Steps to Reproduce

      1. When xpsearch-aggregator is not working, try creating a page

      Expected Results

      Appropriate error message should be displayed

      Actual Results

      "Editing is restricted for this content" is being displayed as error

      ...
      

      Workaround

      Currently there is no workaround

            Assignee:
            Valianstin Zobau (Inactive)
            Reporter:
            srisreeni
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: