Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-5525

Elastic search does not support colon in active rule keys

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 4.4
    • Fix Version/s: None
    • Component/s: ElasticSearch, Rules
    • Labels:
      None

      Description

      The resharper plugin declares rule keys with ":", for example "resharper-cs:CSharpWarnings::CS0618".

      When searching for this rule in the Rules space, the rule is not display and an error is generated :

      2014.08.12 10:12:16 ERROR [o.s.s.w.WebServiceEngine]  Fail to process request org.sonar.server.ws.ServletRequest@78064515
      org.elasticsearch.action.search.SearchPhaseExecutionException: Failed to execute phase [query_fetch], all shards failed; shardFailures {[AJJkWsWXR8eEVdlB-bL3lw][rules][0]: SearchParseException[[rules][0]: from[0],size[25]: Parse Failure [Failed to parse source [{"from":0,"size":25,"query":{"filtered":{"query":{"bool":{"should":[{"query_string":{"query":"resharper-cs:CSharpWarnings::CS0618","fields":["name.words^20.0","htmlDesc.words^3.0"],"use_dis_max":true,"default_operator":"and","auto_generate_phrase_queries":true,"enable_position_increments":true,"fuzziness":1,"boost":20.0,"lenient":false}},{"multi_match":{"query":"resharper-cs:CSharpWarnings::CS0618","fields":["key","key.grams"],"operator":"AND","boost":15.0}},{"multi_match":{"query":"resharper-cs:CSharpWarnings::CS0618","fields":["_key","_key.grams"],"operator":"AND","boost":35.0}},{"multi_match":{"query":"resharper-cs:CSharpWarnings::CS0618","fields":["lang","lang.grams"],"operator":"AND","boost":3.0}},{"multi_match":{"query":"resharper-cs:CSharpWarnings::CS0618","fields":["debtChar","debtChar.grams"],"operator":"AND","boost":5.0}},{"multi_match":{"query":"resharper-cs:CSharpWarnings::CS0618","fields":["debtSubChar","debtSubChar.grams"],"operator":"AND","boost":5.0}},{"multi_match":{"query":"resharper-cs:CSharpWarnings::CS0618","fields":["_tags","_tags.grams"],"operator":"AND","boost":10.0}},{"multi_match":{"query":"resharper-cs:CSharpWarnings::CS0618","fields":["debtChar","debtChar.grams"],"operator":"OR","boost":1.0}},{"multi_match":{"query":"resharper-cs:CSharpWarnings::CS0618","fields":["debtSubChar","debtSubChar.grams"],"operator":"OR","boost":1.0}},{"multi_match":{"query":"resharper-cs:CSharpWarnings::CS0618","fields":["_tags","_tags.grams"],"operator":"OR","boost":1.0}}]}},"filter":{"bool":{"must":[{"bool":{"should":{"term":{"lang":"c"}}}},{"has_child":{"query":{"constant_score":{"filter":{"bool":{"must":{"term":{"profile":"c-sonar-way-13734"}}}}}},"child_type":"activeRules"}}],"must_not":{"term":{"status":"REMOVED"}}}}}},"_source":{"includes":["status","name","lang","key"],"excludes":[]},"sort":[{"_score":{}}],"aggregations":{"languages":{"terms":{"field":"lang","size":10,"min_doc_count":1,"order":{"_count":"desc"}}},"tags":{"terms":{"field":"_tags","size":10,"min_doc_count":1,"order":{"_count":"desc"}}},"repositories":{"terms":{"field":"repo","size":10,"min_doc_count":1,"order":{"_count":"desc"}}}}}]]]; nested: QueryParsingException[[rules] Failed to parse query [resharper-cs:CSharpWarnings::CS0618]]; nested: ParseException[Cannot parse 'resharper-cs:CSharpWarnings::CS0618': Encountered " ":" ": "" at line 1, column 27.
      Was expecting one of:
          <EOF>
          <AND> ...
          <OR> ...
          <NOT> ...
          "+" ...
          "-" ...
          <BAREOPER> ...
          "(" ...
          "*" ...
          "^" ...
          <QUOTED> ...
          <TERM> ...
          <FUZZY_SLOP> ...
          <PREFIXTERM> ...
          <WILDTERM> ...
          <REGEXPTERM> ...
          "[" ...
          "{" ...
          <NUMBER> ...
          ]; nested: ParseException[Encountered " ":" ": "" at line 1, column 27.
      Was expecting one of:
          <EOF>
          <AND> ...
          <OR> ...
          <NOT> ...
          "+" ...
          "-" ...
          <BAREOPER> ...
          "(" ...
          "*" ...
          "^" ...
          <QUOTED> ...
          <TERM> ...
          <FUZZY_SLOP> ...
          <PREFIXTERM> ...
          <WILDTERM> ...
          <REGEXPTERM> ...
          "[" ...
          "{" ...
          <NUMBER> ...
          ]; }
      	at org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.onFirstPhaseResult(TransportSearchTypeAction.java:276) ~[elasticsearch-1.1.2.jar:na]
      	at org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction$3.onFailure(TransportSearchTypeAction.java:222) ~[elasticsearch-1.1.2.jar:na]
      	at org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteFetch(SearchServiceTransportAction.java:307) ~[elasticsearch-1.1.2.jar:na]
      	at org.elasticsearch.action.search.type.TransportSearchQueryAndFetchAction$AsyncAction.sendExecuteFirstPhase(TransportSearchQueryAndFetchAction.java:71) ~[elasticsearch-1.1.2.jar:na]
      	at org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:214) ~[elasticsearch-1.1.2.jar:na]
      	at org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction$2.run(TransportSearchTypeAction.java:188) ~[elasticsearch-1.1.2.jar:na]
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) ~[na:1.7.0_51]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) ~[na:1.7.0_51]
      	at java.lang.Thread.run(Thread.java:744) ~[na:1.7.0_51]
      

      Please note that this error is not the same in SonarQube 4.5

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              fabemn OLD - Fabrice Bellingard
              Reporter:
              julien.lancelot Julien Lancelot
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: