使用声纳转轮分析多模块项目时,我经常会收到“读取超时”错误。我让Jenkins配置了SonarQube 5.1.1。我们的项目是一种web项目,我们有几个用于分析的声纳插件,如web,css,java,findbugs,js,xml和jacoco。如果我加载了给定的链接" http://172.21.145.84:9000/batch/project?key=webportal&preview=false"从浏览器可以工作,但有时加载响应数据需要很长时间。任何人都可以就此失败向我提出任何建议吗?我已经分享了下面的声纳日志。
SonarQube Runner 2.4
Java 1.7.0_45 Oracle Corporation (64-bit)
Windows 7 6.1 amd64
INFO: Runner configuration file: C:\sonar-runner-2.4\conf\sonar-runner.properties
INFO: Project configuration file: D:\Jenkins\jobs\Webportal_2.0_Drop1Branch\workspace\DataModel\..\ucfed_webportal_plugin_att\sonar-project.properties
INFO: Default locale: "en_US", source code encoding: "UTF-8"
INFO: Work directory: D:\Jenkins\jobs\Webportal_2.0_Drop1Branch\workspace\DataModel\..\ucfed_webportal_plugin_att\.sonar
INFO: SonarQube Server 5.1.1
17:11:29.762 INFO - Load global repositories
17:11:30.027 INFO - Load global repositories (done) | time=281ms
17:11:30.042 INFO - Server id: 20150707155744
17:11:30.042 INFO - User cache: C:\Users\Administrator\.sonar\cache
17:11:30.042 INFO - Install plugins
17:11:30.479 INFO - Install JDBC driver
17:11:30.495 INFO - Create JDBC datasource for jdbc:h2:tcp://localhost/sonar
17:11:32.538 INFO - Initializing Hibernate
17:11:35.409 INFO - Load project repositories
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 26.832s
Final Memory: 46M/303M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
ERROR: Unable to execute Sonar
ERROR: Caused by: Unable to request: /batch/project?key=webportal &preview=false
ERROR: Caused by: Read timed out
ERROR:
ERROR: To see the full stack trace of the errors, re-run SonarQube Runner with the -e switch.
ERROR: Re-run SonarQube Runner using the -X switch to enable full debug logging.
Build step 'Invoke Standalone Sonar Analysis' marked build as failure
Extended Email Publisher is currently disabled in project settings
Finished: FAILURE
答案 0 :(得分:2)
由于SQL查询结果集很大,我遇到了同样的问题。 将 sonar.jdbc.maxWait 强化为 300000 就可以了。 很好的帮助!谢谢你!
答案 1 :(得分:1)
正如您所看到的,错误与读取超时有关,这是因为它必须读取的项目非常大。在我的例子中,我修改了配置文件的 sonar.jdbc.maxWait 值:/sonarqube-5.1.2/conf/sonar.properties
# The maximum number of milliseconds that the pool will wait (when there
# are no available connections) for a connection to be returned before
# throwing an exception, or <= 0 to wait indefinitely.
sonar.jdbc.maxWait=10000
执行此更改时,错误消失。 祝你好运
答案 2 :(得分:1)
在使用SonarQube的长期过程中,通过记住下面提到的几点,我能够通过一些调整来解决上述问题。
会给出好结果。
答案 3 :(得分:0)
您正面临以下限制,我们将尝试在SonarQube 5.2中解决:SONAR-6604
(我在故障单说明中添加了对帖子的引用)
请注意,您使用的是基于嵌入式H2数据库的默认安装,因此您不能期望获得良好的性能。我想你一定注意到了页面底部的红色大警告。