SonarQube与Sonar-runner无法存储报告

时间:2015-06-05 06:41:11

标签: sonarqube sonar-runner

我使用Oracle数据库安装了SonarQube 5.1和sonar-runner 2.4。在我的项目上运行sonar-runner时,分析进展顺利,直到发布报告的所有步骤都没有问题,但是记录器给了我这个:

08:04:45.705 INFO  - Sensor JavaSquidSensor (done) | time=147026ms
08:04:45.705 INFO  - Sensor Lines Sensor
08:04:46.007 INFO  - Sensor Lines Sensor (done) | time=302ms
08:04:46.008 INFO  - Sensor QProfileSensor
08:04:46.016 INFO  - Sensor QProfileSensor (done) | time=8ms
08:04:46.017 INFO  - Sensor InitialOpenIssuesSensor
08:04:46.363 INFO  - Sensor InitialOpenIssuesSensor (done) | time=346ms
08:04:46.364 INFO  - Sensor ProjectLinksSensor
08:04:46.474 INFO  - Sensor ProjectLinksSensor (done) | time=110ms
08:04:46.475 INFO  - Sensor VersionEventsSensor
08:04:46.908 INFO  - Sensor VersionEventsSensor (done) | time=433ms
08:04:46.909 INFO  - Sensor SurefireSensor
08:04:46.911 INFO  - parsing /app/aim/jenkinsNew/jobs/Unit Testing with Code Coverage (DEV)/workspace/download/Omegapoint/.sonar/build/surefire-reports
08:04:46.911 WARN  - Reports path not found: /app/aim/jenkinsNew/jobs/Unit Testing with Code Coverage (DEV)/workspace/download/Omegapoint/.sonar/build/surefire-reports
08:04:46.912 INFO  - Sensor SurefireSensor (done) | time=3ms
08:04:46.912 INFO  - Sensor SCM Sensor
08:04:46.912 INFO  - No SCM system was detected. You can use the 'sonar.scm.provider' property to explicitly specify it. 
08:04:46.912 INFO  - Sensor SCM Sensor (done) | time=0ms
08:04:46.912 INFO  - Sensor CPD Sensor
08:04:46.912 INFO  - JavaCpdEngine is used for java
08:04:46.915 INFO  - Cross-project analysis disabled
08:04:53.913 INFO  - Sensor CPD Sensor (done) | time=7001ms
08:04:53.917 INFO  - No quality gate is configured.
08:04:55.523 INFO  - Execute decorators...
08:05:13.250 INFO  - Store results in database
08:05:39.050 INFO  - Analysis reports generated in 2135ms, dir size=1 MB
08:05:42.067 INFO  - Analysis reports compressed in 3016ms, zip size=927 KB
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 4:09.242s
Final Memory: 26M/230M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
ERROR: Unable to execute Sonar
ERROR: Caused by: Fail to execute request [code=500, url=http://XXX.XXX.XXX.XXX:9010/api/computation/submit_report?projectKey=SonarCube-report]: {"errors":[{"msg":"Fail to store analysis report of project SonarCube-report"}]}
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.

服务器SonarQube日志sonar.log提供了一个长输出(此处截断):

2015.06.05 08:58:41 ERROR web[o.s.s.w.WebServiceEngine] Fail to process request http://XXX.XXX.XXX.XXX:9010/api/computation/submit_report?projectKey=SonarCube-report
java.lang.IllegalStateException: Fail to store analysis report of project SonarCube-report
    at org.sonar.server.computation.ReportQueue.add(ReportQueue.java:67) ~[sonar-server-5.1.jar:na]
    at org.sonar.server.computation.ws.SubmitReportWsAction.handle(SubmitReportWsAction.java:75) ~[sonar-server-5.1.jar:na]
    at org.sonar.server.ws.WebServiceEngine.execute(WebServiceEngine.java:84) ~[sonar-server-5.1.jar:na]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95) ~[na:1.7.0]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:56) ~[na:1.7.0]
    at java.lang.reflect.Method.invoke(Method.java:620) ~[na:2.6 (12-15-2014)]

  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1157) [na:1.7.0]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:627) [na:1.7.0]
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-8.0.18.jar:8.0.18]
    at java.lang.Thread.run(Thread.java:863) [na:1.7.0]
Caused by: java.io.IOException: not opened for reading
    at org.jruby.util.io.ChannelStream.checkReadable(ChannelStream.java:134) ~[jruby-complete-1.7.9.jar:na]
    at org.jruby.util.io.ChannelStream.bufferedRead(ChannelStream.java:994) ~[jruby-complete-1.7.9.jar:na]
    at org.jruby.util.io.ChannelStream.access$300(ChannelStream.java:62) ~[jruby-complete-1.7.9.jar:na]
    at org.jruby.util.io.ChannelStream$InputStreamAdapter.read(ChannelStream.java:1570) ~[jruby-complete-1.7.9.jar:na]
    at java.io.InputStream.read(InputStream.java:114) ~[na:1.7.0]
    at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1792) ~[commons-io-2.4.jar:2.4]
    at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1769) ~[commons-io-2.4.jar:2.4]
    at org.apache.commons.io.IOUtils.copy(IOUtils.java:1744) ~[commons-io-2.4.jar:2.4]
    at org.apache.commons.io.FileUtils.copyInputStreamToFile(FileUtils.java:1512) ~[commons-io-2.4.jar:2.4]
    at org.sonar.server.computation.ReportQueue.saveReportOnDisk(ReportQueue.java:88) ~[sonar-server-5.1.jar:na]
    at org.sonar.server.computation.ReportQueue.add(ReportQueue.java:61) ~[sonar-server-5.1.jar:na]
    ... 357 common frames omitted

我已经仔细检查过数据库是否包含所有声纳表和数据,并且它是可以访问的。由于我在这个过程中得到了这么多,我认为连接到数据库不是问题?有什么建议吗?

2 个答案:

答案 0 :(得分:0)

由于我无法评论(在stackoverflow上需要更多“声望”)这就是我的想法:

首先,我认为你是对的,它不是数据库问题。这似乎是收集存储数据的服务器的一个问题。

所以要解决这个问题,请检查以下内容:

  1. 在声纳分析运行时检查服务器的端口9010是否打开/免费。
  2. 检查您的sonar.properties文件,了解您如何配置Web服务器。
  3. 检查wrapper.conf文件
  4. 检查您的access.log
  5. 让我知道你发现了什么。

答案 1 :(得分:0)

我在SonarQube服务器上遇到了类似的问题。根本原因是iNode计数。 SonarQube目录在其tmp目录下有几百万个文件。我删除了这个tmp下的所有文件以释放inode&重启了。 inode计数(df -ih)然后看起来很正常,SQ开始正常工作。