Trying to run sonar scan using sonar scanner msbuild part of the docker build alongside Application build using sonarscanner begin and end commands. The Sonarscanner end is failing with unable to connect(connect timeout) when configured to connect via corporate proxy.
I’ve added Proxy env variables that are required for dotnet scanner and also added SONAR_SCANNER_OPTS = “-Dhttp.proxyHost=yourProxyHost -Dhttp.proxyPort=yourProxyPort” as environment variables(this is just an example but I’ve replaced with actual values).
Still no luck and seeing the can’t connect and connection timed out error
here are the logs from our CI/CD pipeline:
#35 31.59 at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
#35 31.59 at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
#35 31.59 at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:88)
#35 31.59 at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
#35 31.59 at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
#35 31.59 at org.sonarsource.scanner.api.internal.shaded.okhttp.RealCall.getResponseWithInterceptorChain(RealCall.java:221)
#35 31.59 at org.sonarsource.scanner.api.internal.shaded.okhttp.RealCall.execute(RealCall.java:81)
#35 31.59 at org.sonarsource.scanner.api.internal.ServerConnection.callUrl(ServerConnection.java:115)
#35 31.59 at org.sonarsource.scanner.api.internal.ServerConnection.downloadString(ServerConnection.java:99)
#35 31.59 at org.sonarsource.scanner.api.internal.BootstrapIndexDownloader.getIndex(BootstrapIndexDownloader.java:39)
#35 31.59 … 10 more
#35 31.59 ERROR:
#35 31.60 The SonarScanner did not complete successfully
#35 31.60 03:00:54.148 Post-processing failed. Exit code: 1
#35 ERROR: process “/bin/sh -c dotnet sonarscanner end /d:sonar.token="${SONAR_TOKEN}"” did not complete successfully: exit code: 1