SonarQube扫描程序 - SocketException Socket Closed - 套接字

时间:2018-01-31 15:58:55

标签: sonarqube sonarqube-scan

我试图用sonarqube扫描我的项目,无论我尝试什么,它都在尝试将报告上传到本地sonarqube服务器时失败。

使用声纳扫描仪下载扫描为maven目标时,会报告相同类型的问题:

声纳扫描仪

10:28:42.304 DEBUG: Upload report
10:28:52.553 INFO: ------------------------------------------------------------------------
10:28:52.554 INFO: EXECUTION FAILURE
10:28:52.557 INFO: ------------------------------------------------------------------------
10:28:52.558 INFO: Total time: 28.827s
10:28:52.775 INFO: Final Memory: 49M/298M
10:28:52.776 INFO: ------------------------------------------------------------------------
10:28:52.777 ERROR: Error during SonarQube Scanner execution
java.lang.IllegalStateException: Fail to request http://localhost:9000/api/ce/submit?projectKey=abc:abc
...
...
Caused by: java.net.SocketTimeoutException: timeout
...
...
Caused by: java.net.SocketException: Socket closed

Maven声纳:声纳目标

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 45.193 s
[INFO] Finished at: 2018-01-31T10:38:54-05:00
[INFO] Final Memory: 80M/452M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.3.0.603:sonar (default-cli) on project abc: Fail to request http://localhost:9000/api/ce/submit?projectKey=abc:abc&projectName=abc: timeout: Socket closed -> [Help 1]

查看声纳服务器的日志,我在access.log中找到了以下相关的查看语句

127.0.0.1 - - [31/Jan/2018:10:39:04 -0500] "POST /api/ce/submit?projectKey=abc:abc&projectName=abc HTTP/1.1" 400 56 "-" "ScannerMaven/3.3.0.603/3.5.0" "AWFM1VQ1EuWVn5rHAAAf"

web.log中的这个错误

2018.01.31 10:39:04 WARN  web[AWFM1VQ1EuWVn5rHAAAf][o.s.s.w.ServletRequest] Can't read file part for parameter report
java.io.IOException: org.apache.tomcat.util.http.fileupload.FileUploadBase$IOFileUploadException: Processing of multipart/form-data request failed. Unexpected EOF read on the socket
...
...
Caused by: org.apache.tomcat.util.http.fileupload.FileUploadBase$IOFileUploadException: Processing of multipart/form-data request failed. Unexpected EOF read on the socket    
...
...
Caused by: java.io.EOFException: Unexpected EOF read on the socket

我尝试使用以下版本并获得相同的结果:

| sonar-scanner | maven sonar plugin | sonarqube |
| n/a           | 3.4.0.905          | 6.5       |
| n/a           | 3.4.0.905          | 6.7.1     |
| n/a           | 3.3.0.603          | 6.7.1     |
| 3.0.3.778     | n/a                | 6.7.1     |

我也尝试过我的其他项目,他们做同样的事情。

我做错了什么?

编辑:我尝试了另一个我的项目,一个小项目,它运行良好。似乎只要上传报告的时间少于10秒就可以了。但是,一上传大约需要10秒钟,它就会被切断:

14:10:38.537 INFO: Analysis report generated in abc\.scannerwork\scanner-report
14:10:38.537 DEBUG: Upload report
14:10:48.864 INFO: ------------------------------------------------------------------------
14:10:48.864 INFO: EXECUTION FAILURE

时间戳的差异似乎总是10s +/-几百毫秒。

我不知道为什么当两个项目都在我的同一台计算机上时上传这么小的报告需要这么长时间,但有没有办法增加这个超时?

0 个答案:

没有答案