Problem with Pull Request Decoration

Good afternoon! I already addressed this forum with the same problem, but then they did not tell me what the problem might be. Once again, I apologize for my English)
The problem is that on two of the six projects, the scanner freezes for a rather long period. The last time the scanner crashed for 11 hours, which is why other tasks did not start. Logs give this error:

2020.04.08 13:41:08 ERROR ce[AXFXh1fLny8P9PgEHVSv][c.s.C.D.D.B] An exception was thrown during Merge Request decoration : Couldn't kickstart handshaking
2020.04.08 13:41:08 ERROR ce[AXFXh1fLny8P9PgEHVSv][o.s.c.t.p.a.p.PostProjectAnalysisTasksExecutor] Execution of task class com.sonarsource.C.D.a failed
java.lang.IllegalStateException: Couldn't kickstart handshaking
        at com.sonarsource.C.D.D.F.A(Unknown Source)
        at com.sonarsource.C.D.D.B.A(Unknown Source)
        at com.sonarsource.C.D.a.A(Unknown Source)
        at java.base/java.util.Optional.ifPresent(Unknown Source)
        at com.sonarsource.C.D.a.B(Unknown Source)
        at com.sonarsource.C.D.a.A(Unknown Source)
        at org.sonar.ce.async.SynchronousAsyncExecution.addToQueue(SynchronousAsyncExecution.java:27)
        at com.sonarsource.C.D.a.A(Unknown Source)
        at java.base/java.util.Optional.ifPresent(Unknown Source)
        at com.sonarsource.C.D.a.finished(Unknown Source)
        at org.sonar.ce.task.projectanalysis.api.posttask.PostProjectAnalysisTasksExecutor.executeTask(PostProjectAnalysisTasksExecutor.java:118)
        at org.sonar.ce.task.projectanalysis.api.posttask.PostProjectAnalysisTasksExecutor.finished(PostProjectAnalysisTasksExecutor.java:109)
        at org.sonar.ce.task.step.ComputationStepExecutor.executeListener(ComputationStepExecutor.java:91)
        at org.sonar.ce.task.step.ComputationStepExecutor.execute(ComputationStepExecutor.java:63)
        at org.sonar.ce.task.projectanalysis.taskprocessor.ReportTaskProcessor.process(ReportTaskProcessor.java:81)
        at org.sonar.ce.taskprocessor.CeWorkerImpl$ExecuteTask.executeTask(CeWorkerImpl.java:209)
        at org.sonar.ce.taskprocessor.CeWorkerImpl$ExecuteTask.run(CeWorkerImpl.java:191)
        at org.sonar.ce.taskprocessor.CeWorkerImpl.findAndProcessTask(CeWorkerImpl.java:158)
        at org.sonar.ce.taskprocessor.CeWorkerImpl$TrackRunningState.get(CeWorkerImpl.java:133)
        at org.sonar.ce.taskprocessor.CeWorkerImpl.call(CeWorkerImpl.java:85)
        at org.sonar.ce.taskprocessor.CeWorkerImpl.call(CeWorkerImpl.java:53)
        at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125)
        at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:69)
        at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
        at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
        at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.base/java.lang.Thread.run(Unknown Source)
Caused by: javax.net.ssl.SSLException: Couldn't kickstart handshaking
        at java.base/sun.security.ssl.Alert.createSSLException(Unknown Source)
        at java.base/sun.security.ssl.TransportContext.fatal(Unknown Source)
        at java.base/sun.security.ssl.TransportContext.fatal(Unknown Source)
        at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
        at okhttp3.internal.connection.RealConnection.connectTls(RealConnection.java:336)
        at okhttp3.internal.connection.RealConnection.establishProtocol(RealConnection.java:300)
        at okhttp3.internal.connection.RealConnection.connect(RealConnection.java:185)
        at okhttp3.internal.connection.ExchangeFinder.findConnection(ExchangeFinder.java:224)
        at okhttp3.internal.connection.ExchangeFinder.findHealthyConnection(ExchangeFinder.java:108)
        at okhttp3.internal.connection.ExchangeFinder.find(ExchangeFinder.java:88)
        at okhttp3.internal.connection.Transmitter.newExchange(Transmitter.java:169)
        at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:41)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
        at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:94)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
        at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
        at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:88)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
        at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:221)
        at okhttp3.RealCall.execute(RealCall.java:81)
        ... 30 common frames omitted
        Suppressed: java.net.SocketException: Broken pipe (Write failed)
                at java.base/java.net.SocketOutputStream.socketWrite0(Native Method)
                at java.base/java.net.SocketOutputStream.socketWrite(Unknown Source)
                at java.base/java.net.SocketOutputStream.write(Unknown Source)
                at java.base/sun.security.ssl.SSLSocketOutputRecord.encodeAlert(Unknown Source)
                ... 53 common frames omitted
Caused by: java.net.SocketException: Broken pipe (Write failed)
        at java.base/java.net.SocketOutputStream.socketWrite0(Native Method)
        at java.base/java.net.SocketOutputStream.socketWrite(Unknown Source)
        at java.base/java.net.SocketOutputStream.write(Unknown Source)
        at java.base/sun.security.ssl.SSLSocketOutputRecord.flush(Unknown Source)
        at java.base/sun.security.ssl.HandshakeOutStream.flush(Unknown Source)
        at java.base/sun.security.ssl.ClientHello$ClientHelloKickstartProducer.produce(Unknown Source)
        at java.base/sun.security.ssl.SSLHandshake.kickstart(Unknown Source)
        at java.base/sun.security.ssl.ClientHandshakeContext.kickstart(Unknown Source)
        at java.base/sun.security.ssl.TransportContext.kickstart(Unknown Source)
        ... 51 common frames omitted
2020.04.08 13:41:08 INFO  ce[AXFXh1fLny8P9PgEHVSv][o.s.c.t.p.a.p.PostProjectAnalysisTasksExecutor] Pull Request decoration | status=FAILED | time=41846902ms
2020.04.08 13:41:08 INFO  ce[AXFXh1fLny8P9PgEHVSv][o.s.c.t.CeWorkerImpl] Executed task | project=p2p-page | type=REPORT | pullRequest=2 | id=AXFXh1fLny8P9PgEHVSv | submitter=gitlab | status=SUCCESS | time=41848875ms

Sonarqube: 8.2
Sonarscaner: 4.2
Sonarlint: 8.2

A similar problem is solved if you transfer the project to Low quality, but this is not suitable for solving the problem

And if you open Background Tasks and click Show Warning, a message appears:

Merge Request decoration failed. Please check your configuration and the connectivity to GitLab

Although there are no such problems with other projects

Please tell me how to solve this problem. And let me know if you need anything else

Hello,

do you mean your issue occur during GitLab Merge Request decoration ? Is it an on-premise GitLab, or are you using gitlab.com ?

Yes, the problem appears during the execution of the Gitlab Merge request
We use local Gitlab, but the problem is that this problem appears only on one or two projects. All other projects pass through the scanner without errors and do not create any delays.

ok thanks for the details. To be clear, you are talking about the scanner being frozen during the analysis in your first post. But given the logs you provide, it looks like it’s rather the compute engine background task that is failing. The scanner may be waiting for the quality gate status, but the scanner is not “stuck”, just waiting. The compute engine is stuck.

Could you please give a try to the workaround described here? Basically, you have to edit the gitlab.rb configuration file on your gitlab instance to allow bigger HTTP requests.

1 Like

Thanks for the help, but this method did not help. In gitlab you can see that the analysis failed:

INFO: ------------- Check Quality Gate status
INFO: Waiting for the analysis report to be processed (max 300s)
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 5:32.337s
ERROR: Error during SonarQube Scanner execution
ERROR: Quality Gate check timeout exceeded - View details on http://xx.xx.xx.xx/
INFO: Final Memory: 25M/87M
INFO: ------------------------------------------------------------------------
ERROR: 
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
ERROR: Job failed: exit code 1

But the SonarQube project page shows that the task has not yet been completed: “A background task is in progress. More details available on the Background Tasks page.”
When switching to Background Tasks, it is clear that the process is still in progress and cannot be stopped in any way, this makes it difficult to analyze other projects, because the analysis does not start until the current analysis stops

You can cancel the frozen analysis only by restarting the container with SonarQube, which is not suitable for solving the problem

There are currently two solutions to the problem:

  • Transfer the project from Sonar way to Low quality
  • Reload container with SonarQube

None of these solutions is not appropriate

Is there really no way to solve this problem? I launched a project analysis through gitlab on Friday, and when I returned to my workplace on Monday, it was still checked until I rebooted SonarQube. As a result, Sonar analyzed one project for 63(!!!) hours and did not miss other projects.
I switched the logging level from INFO to DEBUG, but it did not work. It’s just that every second block of lines is repeated about ten times:

2020.04.10 08:24:56 DEBUG ce[AXFjJF-Am6rJf4YPxOyp][o.i.http2.Http2] >> CONNECTION 505249202a20485454502f322e300d0a0d0a534d0d0a0d0a
2020.04.10 08:24:56 DEBUG ce[AXFjJF-Am6rJf4YPxOyp][o.i.http2.Http2] >> 0x00000000     6 SETTINGS
2020.04.10 08:24:56 DEBUG ce[AXFjJF-Am6rJf4YPxOyp][o.i.http2.Http2] >> 0x00000000     4 WINDOW_UPDATE
2020.04.10 08:24:56 DEBUG ce[AXFjJF-Am6rJf4YPxOyp][o.i.http2.Http2] >> 0x00000003  4591 HEADERS       END_HEADERS
2020.04.10 08:24:56 DEBUG ce[AXFjJF-Am6rJf4YPxOyp][o.i.http2.Http2] >> 0x00000003     0 DATA          END_STREAM
2020.04.10 08:24:56 DEBUG ce[][o.i.http2.Http2] << 0x00000000    18 SETTINGS
2020.04.10 08:24:56 DEBUG ce[][o.i.http2.Http2] << 0x00000000     4 WINDOW_UPDATE
2020.04.10 08:24:56 DEBUG ce[][o.i.http2.Http2] << 0x00000000     0 SETTINGS      ACK
2020.04.10 08:24:56 DEBUG ce[][o.i.http2.Http2] << 0x00000000     8 GOAWAY
2020.04.10 08:24:56 DEBUG ce[][o.i.http2.Http2] >> 0x00000003     4 RST_STREAM

I apologize, you were right. I read inattentively: after the changes to gitlab.rb, I had to run
sudo gitlab-ctl reconfigure
SonarQube generated a Quality gate error, but it did not freeze for a long period, and completed the analysis in 8 seconds. DEBUG Log showed that the URL is really too long. Thanks a lot for the help

1 Like

great! :smiley: