声纳ERROR超时试图锁定表" PROJECT_MEASURES&#34 ;; SQL语句:

时间:2015-05-18 23:34:16

标签: plugins views sonarqube sonar-runner sonarqube-5.0

我在使用Gradle 2.3 / 4时使用SonarQube 5.1(使用默认数据库H2)。

在SonarQube中,我使用了Views组合管理插件的试用版(将SonarQube项目的指标作为一个组件组合在一起,让您可以创建像给定团队,部门,经理下的所有项目一样的视图,所有应用项目,所有服务项目等。

sonarRunner任务在Gradle中成功运行。分析完成后,我必须运行另一个命令来选择" Views Portfolio插件"我每2分钟运行一次的命令(使用Jenkins工作)是:声纳 - 跑步者视图

sonarRunner任务工作好几天,但今天我在Jenkins看到一个错误。

我在这里缺少什么想法?

PS :我每隔2分钟就会自动运行几分钟。

00:00:05.987 23:29:38.207 INFO  - Load module settings
00:00:06.382 23:29:38.603 INFO  - Load rules
00:00:07.456 23:29:39.677 INFO  - Index files
00:00:07.463 23:29:39.683 INFO  - 0 files indexed
00:00:07.913 23:29:40.134 INFO  - Sensor ViewsSensor
00:00:09.935 23:29:42.155 WARN  - SQL Error: 50200, SQLState: HYT00
00:00:09.935 23:29:42.156 ERROR - Timeout trying to lock table "PROJECT_MEASURES"; SQL statement:
00:00:09.935 select measuremod0_.id as id5_, measuremod0_.alert_status as alert2_5_, measuremod0_.alert_text as alert3_5_, measuremod0_.characteristic_id as characte4_5_, measuremod0_.measure_data as measure5_5_, measuremod0_.description as descript6_5_, measuremod0_.metric_id as metric7_5_, measuremod0_.person_id as person8_5_, measuremod0_.project_id as project9_5_, measuremod0_.rule_id as rule10_5_, measuremod0_.rule_priority as rule11_5_, measuremod0_.snapshot_id as snapshot12_5_, measuremod0_.tendency as tendency5_, measuremod0_.text_value as text14_5_, measuremod0_.url as url5_, measuremod0_.value as value5_, measuremod0_.variation_value_1 as variation17_5_, measuremod0_.variation_value_2 as variation18_5_, measuremod0_.variation_value_3 as variation19_5_, measuremod0_.variation_value_4 as variation20_5_, measuremod0_.variation_value_5 as variation21_5_ from project_measures measuremod0_ where measuremod0_.snapshot_id=? and (measuremod0_.person_id is null) [50200-176]
00:00:09.972 INFO: ------------------------------------------------------------------------
00:00:09.972 INFO: EXECUTION FAILURE
00:00:09.972 INFO: ------------------------------------------------------------------------
00:00:09.973 Total time: 9.802s
00:00:10.234 Final Memory: 43M/1448M
00:00:10.235 INFO: ------------------------------------------------------------------------
00:00:10.236 ERROR: Error during Sonar runner execution
00:00:10.237 ERROR: Unable to execute Sonar
00:00:10.237 ERROR: Caused by: org.hibernate.exception.GenericJDBCException: could not execute query
00:00:10.237 ERROR: Caused by: could not execute query
00:00:10.238 ERROR: Caused by: Timeout trying to lock table "PROJECT_MEASURES"; SQL statement:
00:00:10.238 select measuremod0_.id as id5_, measuremod0_.alert_status as alert2_5_, measuremod0_.alert_text as alert3_5_, measuremod0_.characteristic_id as characte4_5_, measuremod0_.measure_data as measure5_5_, measuremod0_.description as descript6_5_, measuremod0_.metric_id as metric7_5_, measuremod0_.person_id as person8_5_, measuremod0_.project_id as project9_5_, measuremod0_.rule_id as rule10_5_, measuremod0_.rule_priority as rule11_5_, measuremod0_.snapshot_id as snapshot12_5_, measuremod0_.tendency as tendency5_, measuremod0_.text_value as text14_5_, measuremod0_.url as url5_, measuremod0_.value as value5_, measuremod0_.variation_value_1 as variation17_5_, measuremod0_.variation_value_2 as variation18_5_, measuremod0_.variation_value_3 as variation19_5_, measuremod0_.variation_value_4 as variation20_5_, measuremod0_.variation_value_5 as variation21_5_ from project_measures measuremod0_ where measuremod0_.snapshot_id=? and (measuremod0_.person_id is null) [50200-176]
00:00:10.238 ERROR: 
00:00:10.239 ERROR: To see the full stack trace of the errors, re-run SonarQube Runner with the -e switch.
00:00:10.239 ERROR: Re-run SonarQube Runner using the -X switch to enable full debug logging.
00:00:10.271 Build step 'Execute shell' marked build as failure

对于这个项目,当我尝试在SonarQube中看到项目本身时,我看到以下带有黄色背景的行:

No analysis has been performed since creation. The only available section is the configuration.

所有其他项目都显示有效的SonarQube仪表板页面。

1 个答案:

答案 0 :(得分:1)

找到第一期的解决方案。我正在使用Views Portfolio插件进行POC,它需要定期运行“sonar-runner views”命令来发布/获取Views的新数据。

有一个Jenkins工作每2分钟运行一次“声纳 - 跑步者视图”,同时,其他Jenkins工作(对于一个项目)正在做sonarRunner(分析)然后这个错误即将来临。

要解决这个问题,我将运行 sonar-runner views 命令的作业更改为NOT,以便在任何其他Jenkins作业正在进行时运行(在Job的配置中重新设置复选框)。

现在我没有收到SQL错误。


我还在看为什么即使sonarRunner任务(Gradle)成功,也没有在SonarQube主页上生成特定项目。 即我得到了:

No analysis has been performed since creation. The only available section is the configuration.

PS :所有其他项目的sonarRunner任务显示相同的成功运行,并且它们在SonarQube中可见。

找到第二个问题的解决方案即解决“自创建以来未执行任何分析。唯一可用的部分是配置”。

我发现几天前我更新了几个插件(即声纳-api插件等从XX到XY版本)但是他们都坐在 PENDING安装状态即我下载后,我没有重启声纳实例来挑选它们。

我刚刚重新启动了声纳实例,错误消失了,现在一切正常。