在使用 Sonar 运行器分析多模块项目时,我经常收到“读取超时”错误。我为 Jenkins 配置了 SonarQube 5.1.1。我们的项目是一种 Web 项目,我们有几个用于分析的 Sonar 插件,如 web、css、java、findbugs、js、xml 和 jacoco。如果我从浏览器加载给定的链接“http://172.21.145.84:9000/batch/project?key=webportal&preview=false ”,它可以工作,但有时加载响应数据需要很长时间。有人可以给我关于这次失败的任何建议吗?我在下面分享了 Sonar 日志。
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
最佳答案
事实证明,由于 SQL 查询结果集很大,我遇到了同样的问题。 将 sonar.jdbc.maxWait 增加到 300000 就可以了。 很有帮助!非常感谢!
关于jenkins - SonarQube 5.1.1 加载项目存储库时发生读取超时错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31423318/