试图锁定表“PROJECT_MEASURES"的声纳错误超时;SQL语句: [英] sonar ERROR Timeout trying to lock table "PROJECT_MEASURES"; SQL statement:

查看:141
本文介绍了试图锁定表“PROJECT_MEASURES"的声纳错误超时;SQL语句:的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是带有 Gradle 2.3/4 的 SonarQube 5.1(使用默认数据库 H2).

在 SonarQube 中,我正在使用 Views 投资组合管理插件的试用版,该插件(将 SonarQube 项目的指标组合为一个组件,并允许您创建像给定团队、部门、经理、所有应用程序项目下的所有项目一样的视图,所有服务项目等

sonarRunner 任务在 Gradle 中成功运行.分析完成后,我必须运行另一个命令来选择视图组合插件"的最新分析,我每 2 分钟运行一次的命令(使用 Jenkins 作业)是:sonar-runner views

sonarRunner 任务运行了好几天,但今天我在 Jenkins 中看到了一个错误.

知道我在这里缺少什么吗?.

PS:几分钟后它会自动运行,因为我每 2 分钟运行一次作业.

00:00:05.987 23:29:38.207 INFO - 加载模块设置00:00:06.382 23:29:38.603 信息 - 加载规则00:00:07.456 23:29:39.677 信息-索引文件00:00:07.463 23:29:39.683 信息-索引了 0 个文件00:00:07.913 23:29:40.134 信息-传感器视图传感器00:00:09.935 23:29:42.155 警告-SQL 错误:50200,SQLState:HYT0000:00:09.935 23:29:42.156 错误 - 尝试锁定表PROJECT_MEASURES"超时;SQL语句:00:00:09.935 选择measuremod0_.id作为id5_,measuremod0_.alert_status作为alert2_5_,measuremod0_.alert_text作为alert3_5_,measuremod0_.characteristic_id作为characte4_5_,measuremod0_.measure_data作为measure5_5_,measuremod0_.measure_data作为measure5_5_,measure0_mod_description作为metric5_script,measure0_.alert_text作为alert3_5_person_id 为 person8_5_,measuremod0_.project_id 为 project9_5_,measuremod0_.rule_id 为 rule10_5_,measuremod0_.rule_priority 为 rule11_5_,measuremod0_.snapshot_id 为 snapshot12_5_,measuremod0_.tendency 为value5_,measuremod0_.variation_value_1 作为variation17_5_,measuremod0_.variation_value_2 作为variation18_5_,measuremod0_.variation_value_3 作为variation19_5_,measuremod0_.variation_value_4 作为variation20_5_,measuremod0_.variation_value_5 作为variation20_5_,measuremod0_.variation_value_5 作为variation20_5_measure_mod_measure_5 中的measure_mod和(measuremod0_.person_id 为空)[50200-176]00:00:09.972 信息:------------------------------------------------------------------------00:00:09.972 信息:执行失败00:00:09.972 信息:------------------------------------------------------------------------00:00:09.973 总时间:9.802s00:00:10.234 最终内存:43M/1448M00:00:10.235 信息:----------------------------------------------------------------------00:00:10.236 错误:Sonar runner 执行过程中出错00:00:10.237 错误:无法执行声纳00:00:10.237 错误:由:org.hibernate.exception.GenericJDBCException:无法执行查询00:00:10.237 错误:原因:无法执行查询00:00:10.238 错误:由:超时尝试锁定表PROJECT_MEASURES";SQL语句:00:00:10.238 选择measuremod0_.id 作为id5_,measuremod0_.alert_status 作为alert2_5_,measuremod0_.alert_text 作为alert3_5_,measuremod0_.characteristic_id 作为characte4_5_,measuremod0_.measure_data 作为measure5_5_,measuremod0_.measure_data 作为measure5_5_,measure0_.measure_data 作为measure5_5_,measure0_mod_description 作为metric_mod5_script,measured_mod0_.person_id 为 person8_5_,measuremod0_.project_id 为 project9_5_,measuremod0_.rule_id 为 rule10_5_,measuremod0_.rule_priority 为 rule11_5_,measuremod0_.snapshot_id 为 snapshot12_5_,measuremod0_.tendency 为value5_,measuremod0_.variation_value_1 作为variation17_5_,measuremod0_.variation_value_2 作为variation18_5_,measuremod0_.variation_value_3 作为variation19_5_,measuremod0_.variation_value_4 作为variation20_5_,measuremod0_.variation_value_5 作为variation20_5_,measuremod0_.variation_value_5 作为variation20_5_measure_mod_measure_5 中的measure_mod和(measuremod0_.person_id 为空)[50200-176]00:00:10.238 错误:00:00:10.239 错误:要查看错误的完整堆栈跟踪,请使用 -e 开关重新运行 SonarQube Runner.00:00:10.239 错误:使用 -X 开关重新运行 SonarQube Runner 以启用完整的调试日志记录.00:00:10.271 构建步骤执行 shell"将构建标记为失败

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

自创建以来未进行任何分析.唯一可用的部分是配置.

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

解决方案

找到第一个问题的解决方案.我正在做一个关于使用 Views Portfolio 插件的 POC,它需要定期运行sonar-runner views"命令来发布/获取视图的新数据.

有一个 Jenkins 作业每 2 分钟只运行一次sonar-runner 视图",与此同时,其他 Jenkins 作业(对于一个项目)正在执行 sonarRunner(分析)然后这个错误就来了.

为了解决这个问题,我将正在运行 sonar-runner views 命令的作业更改为不运行,如果任何其他 Jenkins 作业正在进行中(限制作业配置中的复选框).

现在我没有收到那个 SQL 错误.


我仍在研究为什么即使 sonarRunner 任务(Gradle)成功,它也不会在 SonarQube 主页中生成特定项目.即我得到:

自创建以来未执行任何分析.唯一可用的部分是配置.

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

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

我发现几天前我更新了一些插件(即声纳 API 插件等,从 XX 到 XY 版本)但它们都处于PENDING 安装状态,即在我下载它们后,我没有重新启动声纳实例来选择它们.

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

I'm using SonarQube 5.1 (using default Database H2) with Gradle 2.3/4.

In SonarQube, I'm using a trial version for Views portfolio management plugin which (combines SonarQube project's metrics across as a component and lets you create views like all projects under a given team, department, manager, all app projects, all service projects etc.

sonarRunner task is working successfully in Gradle. Once the analysis is done, I have to run another command to pick the latest analysis for "Views Portfolio plugin" and the command I run every 2 minutes (using a Jenkins job) is: sonar-runner views

sonarRunner task worked fine for few days but today I'm seeing an error in Jenkins.

Any ideas what I'm missing here?.

PS: It works automatically after few minutes as I'm running the job every 2 minutes.

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

For this project, when I try to see the project itself in SonarQube, I see the following line with yellow background:

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

All other projects show valid SonarQube dashboard page.

解决方案

Found the solution to the first issue. I was doing a POC on using Views Portfolio plugin and it requires to regularly run "sonar-runner views" command to publish/fetch new data for Views.

There was a Jenkins job which was running just "sonar-runner views" every 2 minutes and at the same time, other Jenkins job (for a project) was doing sonarRunner (analysis) then this error was coming.

To solve it, I changed the job which was running sonar-runner views command to NOT to run if any of the other Jenkins jobs were in progress (retrict checkbox in Job's configuration).

Now I'm not getting that SQL error.


I'm still looking at why even when sonarRunner task (Gradle) is successful, it is not generating a particular project in SonarQube home page. i.e. I'm getting:

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

PS: All other project's sonarRunner task shows the same successful run and they are visible in SonarQube.

Found the solution for the second issue i.e
to resolve the "No analysis has been performed since creation. The only available section is the configuration".

I found the few days back I updated few plugins (i.e. sonar-api pluging etc etc from X.X to X.Y version) but they all were sitting in PENDING installation state i.e. after I downloaded them, I didn't restart sonar instance to pick them.

I just restarted sonar instance and the error is gone, everything is working now.

这篇关于试图锁定表“PROJECT_MEASURES"的声纳错误超时;SQL语句:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆