Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-82600

CQL Searching with Operators fails with INVALID_SYNTAX_CANNOT_PARSE

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Low
    • None
    • 7.13.14, 8.1.1, 7.19.7, 8.1.3
    • Search - Core
    • None

    Description

      Issue Summary

      This is reproducible on Data Center: yes

      Searching a text starting or ending with an equal sign (=) fails with an error in Confluence UI. Also, some operators like OR, AND or NOT cause the same error message.

      Steps to Reproduce

      Approach 1)

      1. Access to the Quick Navigator search in the top right of your Confluence instance.
      2. On the Search field, search by any of the following: =, =text, text=, OR, AND, NOT.

      Approach 2)

      1. Use the REST API for searching:
        https://<CONFLUENCE_HOST:CONFLUENCE_PORT>/confluence/rest/api/search?cql=siteSearch%20~%20%22=%22%20AND%20type%20in%20(%22space%22,%22user%22,%22com.atlassian.confluence.extra.team-calendars:calendar-content-type%22,%22attachment%22,%22page%22,%22com.atlassian.confluence.extra.team-calendars:space-calendars-view-content-type%22,%22blogpost%22)&start=0&limit=20&excerpt=highlight&expand=space.icon&includeArchivedSpaces=false&src=next.ui.search
        

      Expected Results

      Confluence searches as text for any title that contains the equal sign.

      Actual Results

      When using approach 1) to reproduce the issue, the following message appears in the UI:

      Something went wrong. Refresh the page, or contact your admin if this keeps happening.
      

      When using approach 2) to reproduce the issue, the request returns a HTTP 500 error code:

      {"statusCode":500,"message":"","reason":"Internal Server Error"}
      

      Either way, the below exception is thrown in the atlassian-confluence.log file:

      2023-03-24 08:59:42,540 ERROR [http-nio-8090-exec-3] [rest.api.model.ExceptionConverter] convertServiceException No status code found for exception, converting to internal server error :                                                                                                                             -- url: /confluence/rest/api/search | userName: admin | referer: https://linux-38361.prod.atl-cd.net/confluence/index.action | traceId: 440720dc6cea8288  java.lang.IllegalArgumentException: INVALID_SYNTAX_CANNOT_PARSE: Syntax Error, cannot parse =:                                                                     at com.atlassian.confluence.impl.search.v2.mappers.AbstractTextFieldQueryMapper.tryParse(AbstractTextFieldQueryMapper.java:30)                             at com.atlassian.confluence.impl.search.v2.mappers.QueryStringQueryMapper.convertToLuceneQuery(QueryStringQueryMapper.java:34)                             at com.atlassian.confluence.impl.search.v2.mappers.QueryStringQueryMapper.convertToLuceneQuery(QueryStringQueryMapper.java:15)   
      ...
      ... 
      Caused by: INVALID_SYNTAX_CANNOT_PARSE: Syntax Error, cannot parse =:                                                                                              at org.apache.lucene.queryparser.flexible.standard.parser.StandardSyntaxParser.generateParseException(StandardSyntaxParser.java:1054)                      at org.apache.lucene.queryparser.flexible.standard.parser.StandardSyntaxParser.jj_consume_token(StandardSyntaxParser.java:936)                             at org.apache.lucene.queryparser.flexible.standard.parser.StandardSyntaxParser.Clause(StandardSyntaxParser.java:486)                                       at org.apache.lucene.queryparser.flexible.standard.parser.StandardSyntaxParser.ModClause(StandardSyntaxParser.java:303)                                    at org.apache.lucene.queryparser.flexible.standard.parser.StandardSyntaxParser.ConjQuery(StandardSyntaxParser.java:234)                                    at org.apache.lucene.queryparser.flexible.standard.parser.StandardSyntaxParser.DisjQuery(StandardSyntaxParser.java:204)                                    at org.apache.lucene.queryparser.flexible.standard.parser.StandardSyntaxParser.Query(StandardSyntaxParser.java:166)                                        at org.apache.lucene.queryparser.flexible.standard.parser.StandardSyntaxParser.TopLevelQuery(StandardSyntaxParser.java:147)                                at org.apache.lucene.queryparser.flexible.standard.parser.StandardSyntaxParser.parse(StandardSyntaxParser.java:65)                                         at org.apache.lucene.queryparser.flexible.core.QueryParserHelper.parse(QueryParserHelper.java:250)                                                         at org.apache.lucene.queryparser.flexible.standard.StandardQueryParser.parse(StandardQueryParser.java:168)                                                 at com.atlassian.confluence.impl.search.v2.mappers.AbstractTextFieldQueryMapper.tryParse(AbstractTextFieldQueryMapper.java:28)                             ... 410 more    

      Similar bug was reported in Confluence Cloud under CONFCLOUD-53042 - CQL Searching with Operator Throws Error

      Workaround

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

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              d8a006ac9dc7 Iker Alonso
              Votes:
              5 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: