Error 500 on all analyses after package-based upgrade to 6.3 (ES error : no mapping for key.sortable_analyzer)

334 views
Skip to first unread message

Loïc

unread,
Apr 3, 2017, 10:27:35 AM4/3/17
to SonarQube
Hello,

I am running SonarQube under Ubuntu 16.04, installed with apt-get.
/etc/apt/sources.list.d/sonar.sources.list contains one single line : "deb http://downloads.sourceforge.net/project/sonar-pkg/deb binary/"

Recently I upgraded my SonarQube to release 6.3 using a simple "apt-get upgrade".
Then I called the /setup endpoint to upgrade the DB and I am able to access the UI and browse my projects.

However, from this moment all maven-based builds started to fail on sonar:sonar with the following message :

[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.2:sonar (default-cli) on project MyProject-parent: Unable to load component class org.sonar.scanner.report.ActiveRulesPublisher: Unable to load component interface org.sonar.api.batch.rule.ActiveRules: Error 500 on http://sonarqubehost:9000/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt&activation=true&qprofile=js-sonar-way-56541&p=1&ps=500 : {"errors":[{"msg":"An error has occurred. Please contact your administrator"}]} -> [Help 1]
[ERROR] 

On this error, this is what I get in web.log :

2017.04.03 12:33:24 ERROR web[AVslTZi0sHt42KbRAAC6][o.s.s.w.WebServiceEngine] Fail to process request http://sonarqubehost:9000/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt&activation=true&qprofile=js-sonar-way-56541&p=1&ps=500
java.lang.IllegalStateException: Fail to execute ES search request '{"from":0,"size":500,"query":{"bool":{"must":{"match_all":{}},"filter":{"bool":{"must":[{"terms":{"lang":["js"]}},{"has_child":{"query":{"bool":{"must":{"term":{"profile":"js-sonar-way-56541"}}}},"child_type":"activeRule"}},{"bool":{"must_not":{"term":{"status":"REMOVED"}}}}]}}}},"sort":[{"updatedAt":{"order":"desc"}},{"key.sortable_analyzer":{"order":"asc"}}]}' on indices '[rules]' on types '[rule]'
        at org.sonar.server.es.request.ProxySearchRequestBuilder.get(ProxySearchRequestBuilder.java:48)
        at org.sonar.server.es.request.ProxySearchRequestBuilder.get(ProxySearchRequestBuilder.java:36)
        at org.sonar.server.rule.index.RuleIndex.search(RuleIndex.java:142)
        at org.sonar.server.rule.ws.SearchAction.doSearch(SearchAction.java:353)
 [...snip...]
Caused by: org.elasticsearch.search.SearchParseException: No mapping found for [key.sortable_analyzer] in order to sort on
        at org.elasticsearch.search.sort.SortParseElement.addSortField(SortParseElement.java:213)
        at org.elasticsearch.search.sort.SortParseElement.addCompoundSortField(SortParseElement.java:187)
        at org.elasticsearch.search.sort.SortParseElement.parse(SortParseElement.java:85)
        at org.elasticsearch.search.SearchService.parseSource(SearchService.java:856)
        at org.elasticsearch.search.SearchService.createContext(SearchService.java:667)
        at org.elasticsearch.search.SearchService.createAndPutContext(SearchService.java:633)
 [...snip...]

I've been looking at the release notes, it mentions the APIs, but not this specific error nor ways to fix it.

What can I do ?

Thanks,

Loïc

G. Ann Campbell

unread,
Apr 4, 2017, 10:57:03 AM4/4/17
to SonarQube
Hi,

I'm not familiar with the details of the apt-get upgrade procedure for SonarQube, but assuming it does an in-place upgrade (which is not the recommended procedure) then your Elasticsearch indexes are out of whack. Stop the server, delete $SONARQUBE_HOME/data/es, restart, and you should be fine.


Ann

Loïc

unread,
Apr 5, 2017, 4:51:38 AM4/5/17
to SonarQube
Thank you, that solved the issue.
May I suggest you add this information in the "Upgrading" page (for example below "Anything else") ?

Thanks again for your help,

Loïc

G. Ann Campbell

unread,
Apr 5, 2017, 8:23:03 AM4/5/17
to Loïc, SonarQube
Thanks Loic,

We'll take it under advisement. (Altho if you're following the Upgrade procedure you shouldn't need to do this, so an explicit mention might muddy the waters.)


Ann



---
G. Ann CAMPBELL | SonarSource
Product Manager

--
You received this message because you are subscribed to a topic in the Google Groups "SonarQube" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sonarqube/0m1NwnRegSA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sonarqube+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/58da54f7-29d2-4cee-b579-f5e698ffd76a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages