sonarqube 5.x差异视图KO(JSON解析exception)

在SONARQUBE控制台中,当我尝试为我的项目使用差异视图时(combobox – >“自上次分析以来”或“超过30天”)我要求只看到差异(新增加)我得到一个弹出错误“执行ES搜索请求“。

问题是生成的JSON不符合JSON:“pre_zone”:“GMT + 01:00”

请参阅下面的Java日志:

引起:org.elasticsearch.action.search.SearchPhaseExecutionException:无法执行阶段[查询],所有分片都失败; shardFailures {[Ke-Y5HFKSmS4todFkKRspg] [issues] [0]:SearchParseException [[issues] [0]:query [ConstantScore(BooleanFilter(+ cache(severity:CRITICAL)+ CustomQueryWrappingFilter(parent_filter [authorization](filtered)(ConstantScore(cache(cache) BooleanFilter(+ cache(users:admin)cache(groups:sonar-users)cache(groups:anyone)cache(groups:sonar-administrators))))) – > cache(_type:authorization)))+ no_cache(issueCreatedAt: {1451826843000 TO *])+缓存(NotFilter(cache(BooleanFilter(_field_names:resolution))))+缓存(项目:ea3bbe4c-0aa6-4668-84b0-f0929544d334)))],来自[0],大小[50] ,sort [,,,!,]:解析失败[无法解析源[{“from”:0,“size”:50,“query”:{“filtered”:{“query”:{“match_all”: {}}, “filter”:{ “布尔”:{ “必须”:[{ “术语”:{ “严重性”:[ “关键”]}},{ “has_parent”:{ “查询”:{“过滤“:{” 查询 “:{” MATCH_ALL “:{}},” filter “:{” 布尔 “:{” 必须 “:{” 或 “:{” filter “:[{” 术语 “:{” 用户” : “管理员”}},{ “术语”:{ “组”: “声纳用户”},{ “术语”:{ “组”: “任何人”},{ “术语”:{ “组” : “声纳管理员”}}]}}, “_缓存”:真正} }}}, “PARENT_TYPE”: “授权”}},{ “范围”:{ “issueCreatedAt”:{ “从”: “2016-01-03T13:14:03.000Z”, “为”:NULL,“include_lower “:假的,” include_upper “:真正},” _缓存 “:假}},{” ………………………., “min_doc_count”:0, “pre_zone”:“GMT + 01:00” ,“post_zone”:“ GMT + 01:00 ”,“格式”:“yyyy-MM-dd’T’HH:mm:ssZ”, “extended_bounds”:{ “分钟”:1451826843000, “最大值”:1451924812731}}}}}]]]; 嵌套:NumberFormatException [输入字符串:“GMT + 01”]; }

你知道如何解决这个问题吗? (我无法强制java时间。它是一个共享服务器)。

看起来你的Elasticsearch索引搞砸了。 尝试删除data/es目录并重新启动服务器。

我发现了问题。 您需要指定JVM的时区。 这是在sonar.conf文件中完成的。 在该文件中,在WEB SERVER部分中,我添加了以下行:

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

这解决了我的问题!