SonarQube analysis with C++

SonarQube version: 8.0-developer-beta (using Docker)
SonarScanner version: (with openjdk-11-jdk installed).
SonarCFamily Plugin with Wrapper.

Trying to complete analysis of a C++ project and have it uploaded to SonarQube. Managed to use the build-wrapper-linux-x86-64 around the make command and then run the sonar-scanner command in GitLab CI.

We get the following error:

 09:57:44.097 INFO: CPD Executor CPD calculation finished (done) | time=2655ms
10698 09:57:44.382 INFO: SCM writing changed lines
10699 09:57:44.385 DEBUG: SCM reported changed lines for 0 files in the branch
10700 09:57:44.385 INFO: SCM writing changed lines (done) | time=3ms
10701 09:57:44.552 INFO: Analysis report generated in 288ms, dir size=8 MB
10702 09:57:47.889 INFO: Analysis report compressed in 3337ms, zip size=5 MB
10703 09:57:47.889 INFO: Analysis report generated in /builds/<group>/<repo>/.scannerwork/scanner-report
10704 09:57:47.889 DEBUG: Upload report
10705 09:57:48.178 INFO: ------------------------------------------------------------------------
10706 09:57:48.179 INFO: EXECUTION FAILURE
10707 09:57:48.179 INFO: ------------------------------------------------------------------------
10708 09:57:48.179 INFO: Total time: 7:17.807s
10709 09:57:48.257 INFO: Final Memory: 23M/114M
10710 09:57:48.257 INFO: ------------------------------------------------------------------------
10711 09:57:48.257 ERROR: Error during SonarQube Scanner execution
10712 java.lang.IllegalStateException: Fail to request https://sonarqube.<company><projectKey>&characteristic=branch%3Dsonar&characteristic=branchType%3DSHORT
10713 	at
10714 	at
10715 	at
10716 	at
10717 	at
10718 	at
10719 	at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(
10720 	at org.sonar.core.platform.ComponentContainer.startComponents(
10721 	at org.sonar.core.platform.ComponentContainer.execute(
10722 	at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(
10723 	at org.sonar.core.platform.ComponentContainer.startComponents(
10724 	at org.sonar.core.platform.ComponentContainer.execute(
10725 	at org.sonar.batch.bootstrapper.Batch.doExecute(
10726 	at org.sonar.batch.bootstrapper.Batch.execute(
10727 	at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(
10728 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
10729 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
10730 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
10731 	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
10732 	at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(
10733 	at com.sun.proxy.$Proxy0.execute(Unknown Source)
10734 	at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(
10735 	at org.sonarsource.scanner.api.EmbeddedScanner.execute(
10736 	at org.sonarsource.scanner.cli.Main.execute(
10737 	at org.sonarsource.scanner.cli.Main.execute(
10738 	at org.sonarsource.scanner.cli.Main.main(
10739 Caused by: okhttp3.internal.http2.StreamResetException: stream was reset: NO_ERROR
10740 	at okhttp3.internal.http2.Http2Stream.checkOutNotClosed(
10741 	at okhttp3.internal.http2.Http2Stream$FramingSink.emitFrame(
10742 	at okhttp3.internal.http2.Http2Stream$FramingSink.write(
10743 	at okio.ForwardingSink.write(
10744 	at okhttp3.internal.connection.Exchange$RequestBodySink.write(
10745 	at okio.RealBufferedSink.emitCompleteSegments(
10746 	at okio.RealBufferedSink.writeAll(
10747 	at okhttp3.RequestBody$3.writeTo(
10748 	at okhttp3.MultipartBody.writeOrCountBytes(
10749 	at okhttp3.MultipartBody.writeTo(
10750 	at okhttp3.internal.http.CallServerInterceptor.intercept(
10751 	at okhttp3.internal.http.RealInterceptorChain.proceed(
10752 	at okhttp3.internal.http.RealInterceptorChain.proceed(
10753 	at
10754 	at okhttp3.internal.http.RealInterceptorChain.proceed(
10755 	at okhttp3.internal.connection.ConnectInterceptor.intercept(
10756 	at okhttp3.internal.http.RealInterceptorChain.proceed(
10757 	at okhttp3.internal.http.RealInterceptorChain.proceed(
10758 	at okhttp3.internal.cache.CacheInterceptor.intercept(
10759 	at okhttp3.internal.http.RealInterceptorChain.proceed(
10760 	at okhttp3.internal.http.RealInterceptorChain.proceed(
10761 	at okhttp3.internal.http.BridgeInterceptor.intercept(
10762 	at okhttp3.internal.http.RealInterceptorChain.proceed(
10763 	at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(
10764 	at okhttp3.internal.http.RealInterceptorChain.proceed(
10765 	at okhttp3.internal.http.RealInterceptorChain.proceed(
10766 	at okhttp3.RealCall.getResponseWithInterceptorChain(
10767 	at okhttp3.RealCall.execute(
10768 	at
10769 	... 25 more

Have also tried re-running the job in GitLab, and this other error also does pop up, if this is any help with debugging:

3530 Caused by: okhttp3.internal.http2.StreamResetException: stream was reset: NO_ERROR

Please let me know if you need any further information!

Thanks in advance.


You got an error when the analysis report was submitted to the server. This is generally caused by something on the network (firewall? proxy? …) between the analysis machine and the SonarQube server. I would look there first.


1 Like


Thanks for the response!

I changed the log level in SonarQube to Debug and had a look at the sonarqube_ce.log and a bunch of these messages came out:

2019.12.04 11:28:49 INFO  ce[][o.s.s.l.ServerLogging] Level of logs changed to DEBUG
2019.12.04 11:29:39 DEBUG ce[][o.postgresql.Driver] Connecting with URL: jdbc:postgresql://db:5432/sonar
2019.12.04 11:29:39 DEBUG ce[][o.p.c.v.ConnectionFactoryImpl] Trying to establish a protocol version 3 connection to db:5432
2019.12.04 11:29:39 DEBUG ce[][o.p.c.v.ConnectionFactoryImpl] Receive Buffer Size is 186,240
2019.12.04 11:29:39 DEBUG ce[][o.p.c.v.ConnectionFactoryImpl] Send Buffer Size is 43,520

Would this be related?

On another note, I have managed to do successful analysis of other smaller projects…


Those debug messages aren’t related.

Again, this points the finger for me at something on the network between the analysis machine and the SonarQube server.


1 Like


You are completely right - I looked at the nginx logs on the SonarQube server, and found an error looking like: [error] 95#95: *77110 client intended to send too large body: 5454299 bytes

Updating client_max_body_size for nginx resolved the issue.

Thanks again for your assistance!


Hi lawrence,

Please can you describe how is your docker config?
Im having problem cause we have a proxy inside and i have problem when connecting with Gitlab.
Some config files would be helpfully.


It’s basically the SonarQube 8.x first installation in however in a docker-compose file.

And then NGINX and the others are outside the installation.

Yes i did exactly the same. So i used it with docker-compose and i can login everything ok with local account admin but with gitlab accounts i cant because i have problems with proxy.
But how is the nginx configurations.
Can you send me your docker-compose just to understand your config regarding the whole infrastructure.
My gitlab is running in a Windows Server into the same Network.
So im interested to the nginx parts and other configs. Thank you

so @lawrence can you help me with the config files?
It will be really helpfully.


It might be worth posting this on new thread as your question isn’t related to my original question and so that other community members with more knowledge than me can help as I’ve only been doing this recently!

It’ll also be worth posting what you have tried and your configuration files, as I don’t have much idea of what you’ve tried so far either :slight_smile:

1 Like