sonarqube 5.x differential views KO (JSON parsing exception)

杀马特。学长 韩版系。学妹 提交于 2019-12-10 12:20:02

问题


In SONARQUBE console when I try to use differential views for my project (combo box -> “since previous analysis” or “over 30 days”) and I ask to see only the difference (new adds) I get a popup error “Fail to execute ES search request”.

The problem is the JSON generated who is no JSON compliant : "pre_zone":"GMT+01:00"

See the java logs below :

Caused by: org.elasticsearch.action.search.SearchPhaseExecutionException: Failed to execute phase [query], all shards failed; shardFailures {[Ke-Y5HFKSmS4todFkKRspg][issues][0]: SearchParseException[[issues][0]: query[ConstantScore(BooleanFilter(+cache(severity:CRITICAL) +CustomQueryWrappingFilter(parent_filter[authorization](filtered(ConstantScore(cache(BooleanFilter(+cache(users:admin) cache(groups:sonar-users) cache(groups:Anyone) cache(groups:sonar-administrators)))))->cache(_type:authorization))) +no_cache(issueCreatedAt:{1451826843000 TO *]) +cache(NotFilter(cache(BooleanFilter(_field_names:resolution)))) +cache(project:ea3bbe4c-0aa6-4668-84b0-f0929544d334)))],from[0],size[50],sort[,,,!,]: Parse Failure [Failed to parse source [{"from":0,"size":50,"query":{"filtered":{"query":{"match_all":{}},"filter":{"bool":{"must":[{"terms":{"severity":["CRITICAL"]}},{"has_parent":{"query":{"filtered":{"query":{"match_all":{}},"filter":{"bool":{"must":{"or":{"filters":[{"term":{"users":"admin"}},{"term":{"groups":"sonar-users"}},{"term":{"groups":"Anyone"}},{"term":{"groups":"sonar-administrators"}}]}},"_cache":true}}}},"parent_type":"authorization"}},{"range":{"issueCreatedAt":{"from":"2016-01-03T13:14:03.000Z","to":null,"include_lower":false,"include_upper":true},"_cache":false}},{"............................,"min_doc_count":0,"pre_zone":"GMT+01:00","post_zone":"GMT+01:00","format":"yyyy-MM-dd'T'HH:mm:ssZ","extended_bounds":{"min":1451826843000,"max":1451924812731}}}}}]]]; nested: NumberFormatException[For input string: "GMT+01"]; }

Do you have any idea how to work around this issues? (I cannot force the java time. It is a shared server).


回答1:


It looks like your Elasticsearch index is messed up. Try deleting your data/es directory and restarting the server.




回答2:


I found the problem. You need to specify the timezone for the JVM. This is done in the in the sonar.conf file. In that file, within the WEB SERVER section, I added this line:.

sonar.web.javaAdditionalOpts=-Duser.timezone=America/Los_Angeles

This solved the problem for me!



来源:https://stackoverflow.com/questions/34596110/sonarqube-5-x-differential-views-ko-json-parsing-exception

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!