すでにSonar analysis fails with SocketTimeoutExceptionとRead timed out on SonarQube analysisで議論されている問題と同様の問題がありますが、バージョン5.6.2では私たちに起こります。真夜中に始まり、早朝に終わる一連の夜間ビルドとして、ソナー解析が多数あります。最初の分析(分析の時に最初のカップルは)報告書のアップロード時にしてSocketTimeoutExceptionの影響を受けます。この中にいる間SocketTimeoutExceptionのためにソナーレポートのアップロードが失敗する
[exec] 00:15:33.724 DEBUG: Upload report
[exec] 00:16:34.065 INFO: ------------------------------------------------------------------------
[exec] 00:16:34.065 INFO: EXECUTION FAILURE
[exec] 00:16:34.065 INFO: ------------------------------------------------------------------------
[exec] 00:16:34.065 INFO: Total time: 1:28.329s
[exec] 00:16:34.320 ERROR: Error during SonarQube Scanner execution
[exec] java.lang.IllegalStateException: Fail to request http://mysonar:9000/sonar/api/ce/submit?projectKey=myproject&projectName=myproject
[exec] at org.sonarqube.ws.client.HttpConnector.doCall(HttpConnector.java:212)
[exec] at org.sonarqube.ws.client.HttpConnector.post(HttpConnector.java:175)
[exec] at org.sonarqube.ws.client.HttpConnector.call(HttpConnector.java:146)
[exec] at org.sonar.batch.bootstrap.BatchWsClient.call(BatchWsClient.java:67)
[exec] at org.sonar.batch.report.ReportPublisher.upload(ReportPublisher.java:172)
[exec] at org.sonar.batch.report.ReportPublisher.execute(ReportPublisher.java:127)
[exec] at org.sonar.batch.phases.PublishPhaseExecutor.publishReportJob(PublishPhaseExecutor.java:64)
[exec] at org.sonar.batch.phases.PublishPhaseExecutor.executeOnRoot(PublishPhaseExecutor.java:51)
[exec] at org.sonar.batch.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:86)
[exec] at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:192)
[exec] at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
[exec] at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
[exec] at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:241)
[exec] at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:236)
[exec] at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:226)
[exec] at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
[exec] at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
[exec] at org.sonar.batch.task.ScanTask.execute(ScanTask.java:47)
[exec] at org.sonar.batch.task.TaskContainer.doAfterStart(TaskContainer.java:86)
[exec] at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
[exec] at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
[exec] at org.sonar.batch.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:106)
[exec] at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:119)
[exec] at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:62)
[exec] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[exec] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[exec] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[exec] at java.lang.reflect.Method.invoke(Method.java:498)
[exec] at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
[exec] at com.sun.proxy.$Proxy0.execute(Unknown Source)
[exec] at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:233)
[exec] at org.sonarsource.scanner.api.EmbeddedScanner.runAnalysis(EmbeddedScanner.java:151)
[exec] at org.sonarsource.scanner.cli.Main.runAnalysis(Main.java:110)
[exec] at org.sonarsource.scanner.cli.Main.execute(Main.java:74)
[exec] at org.sonarsource.scanner.cli.Main.main(Main.java:61)
[exec] Caused by: java.net.SocketTimeoutException: timeout
[exec] at okio.Okio$3.newTimeoutException(Okio.java:207)
[exec] at okio.AsyncTimeout.exit(AsyncTimeout.java:261)
[exec] at okio.AsyncTimeout$2.read(AsyncTimeout.java:215)
[exec] at okio.RealBufferedSource.indexOf(RealBufferedSource.java:306)
[exec] at okio.RealBufferedSource.indexOf(RealBufferedSource.java:300)
[exec] at okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:196)
[exec] at com.squareup.okhttp.internal.http.HttpConnection.readResponse(HttpConnection.java:191)
[exec] at com.squareup.okhttp.internal.http.HttpTransport.readResponseHeaders(HttpTransport.java:79)
[exec] at com.squareup.okhttp.internal.http.HttpEngine.readNetworkResponse(HttpEngine.java:909)
[exec] at com.squareup.okhttp.internal.http.HttpEngine.access$300(HttpEngine.java:93)
[exec] at com.squareup.okhttp.internal.http.HttpEngine$NetworkInterceptorChain.proceed(HttpEngine.java:894)
[exec] at com.squareup.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:748)
[exec] at com.squareup.okhttp.Call.getResponse(Call.java:277)
[exec] at com.squareup.okhttp.Call$ApplicationInterceptorChain.proceed(Call.java:234)
[exec] at com.squareup.okhttp.Call.getResponseWithInterceptorChain(Call.java:196)
[exec] at com.squareup.okhttp.Call.execute(Call.java:79)
[exec] at org.sonarqube.ws.client.HttpConnector.doCall(HttpConnector.java:209)
[exec] ... 34 more
[exec] Caused by: java.net.SocketException: Socket closed
[exec] at java.net.SocketInputStream.read(SocketInputStream.java:204)
[exec] at java.net.SocketInputStream.read(SocketInputStream.java:141)
[exec] at okio.Okio$2.read(Okio.java:139)
[exec] at okio.AsyncTimeout$2.read(AsyncTimeout.java:211)
[exec] ... 48 more
[exec] 00:16:34.322 ERROR:
[exec] 00:16:34.322 ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
[exec] 00:16:34.320 INFO: Final Memory: 59M/426M
[exec] 00:16:34.320 INFO: ------------------------------------------------------------------------
[exec] Result: 1
[echo] Sonar execution failed, please check the log
通常、アップロードは、(最大のプロジェクトのための200ms程度)だけでミリ秒を要します60秒後にタイムアウトが発生したようです(00:15:33にアップロード、00:16:34に失敗)。同時に、サーバのaccess.log
は非常に奇妙なパターンを示しています。POST /sonar/api/ce/submit
は、最初のアップロード要求の6分後とクライアントがTimeoutExceptionを受信してから5分後に00:21:39にサーバに到着しますクライアントとサーバーは完全に同期しています)。
10.0.206.160 - - [13/Mar/2017:00:15:09 +0100] "GET /sonar/batch/project.protobuf?key=myprojectkey HTTP/1.1" 200 2556 "-" "SonarQubeRunner/2.7"
10.0.206.160 - - [13/Mar/2017:00:15:09 +0100] "GET /sonar/api/qualityprofiles/search.protobuf?projectKey=myprojectkey HTTP/1.1" 200 909 "-" "SonarQubeRunner/2.7"
10.0.206.160 - - [13/Mar/2017:00:21:39 +0100] "POST /sonar/api/ce/submit?projectKey=myprojectkey&projectName=myproject HTTP/1.1" 200 60 "-" "SonarQubeRunner/2.7"
でも見知らぬ人、ソナーGUIは実際に(、クライアントで夜12時15分)最初のアップロード時のタイムスタンプを持つすべての分析結果を提示し、バックグラウンドタスクビューには、次のタイムスタンプを示しています= 12提出されました: 15:33 AM、開始= 12:22:03 AM、終了= 12:22:08 AM。 基本的に、分析の観点からはすべてが機能しますが、依然としてタイムアウト例外のためにビルドが失敗します。