command line
dotnet build --no-incremental
dotnet-coverage collect "dotnet test -c Release " -f xml -o “coverage.xml”
with parameter
/k:sonarKeyProjectName
/n:sonarKeyProjectName
/d:sonar.qualitygate.wait=true
/d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml
I create none WebHook into Sonar
I create a test project to run sonar scanner
I launched several times the analysis without any problem, the project was created into SonarQube with the projectName, projectKey
I could view the code, the qualitygate, all was good
After a migration of Sonar during the weekend, I would try to reset all the results into Sonar, then I remove the project into Sonar and run the job jenkins
The job thrown an exception
ERROR: Error during SonarScanner execution
java.lang.IllegalStateException: Failed to upload report: Fail to request url: https://sonarqube.xxxxxx/api/ce/submit?projectKey=MYPROJECTNAME&projectName=MYPROJECTNAME&characteristic=branch%3Dmaster&characteristic=branchType%3DBRANCH
at org.sonar.scanner.report.ReportPublisher.upload(ReportPublisher.java:226)
at org.sonar.scanner.report.ReportPublisher.execute(ReportPublisher.java:154)
When I click on the link, the error message is
{"errors":[{"msg":"HTTP method POST is required"}]}
It looks like your SonarQube server is being served over HTTPS, which means something in the middle ( a reverse proxy, for example) could be rejecting the call.
Hi Thanks for your helping
‘’‘’
INFO: ------------- Run sensors on project
INFO: Sensor C# [csharp]
INFO: Importing results from 6 proto files in ‘D:_Apps\xxxx.sonarqube\out\1\output-cs’
INFO: Importing results from 6 proto files in ‘D:_Apps\xxxx.sonarqube\out\10\output-cs’
INFO: Importing results from 6 proto files in ‘D:_Apps\xxxx.sonarqube\out\4\output-cs’
INFO: Importing results from 6 proto files in ‘D:_Apps\xxxx.sonarqube\out\12\output-cs’
INFO: Importing results from 6 proto files in ‘D:_Apps\xxxx.sonarqube\out\5\output-cs’
INFO: Importing results from 6 proto files in ‘D:_Apps\xxxx.sonarqube\out\13\output-cs’
INFO: Importing results from 6 proto files in ‘D:_Apps\xxxx.sonarqube\out\3\output-cs’
INFO: Importing results from 6 proto files in ‘D:_Apps\xxxx.sonarqube\out\11\output-cs’
INFO: Importing results from 6 proto files in ‘D:_Apps\xxxx.sonarqube\out\6\output-cs’
INFO: Importing results from 6 proto files in ‘D:_Apps\xxxx.sonarqube\out\14\output-cs’
INFO: Importing results from 6 proto files in ‘D:_Apps\xxxx.sonarqube\out\2\output-cs’
INFO: Importing results from 6 proto files in ‘D:_Apps\xxxx.sonarqube\out\9\output-cs’
INFO: Importing results from 6 proto files in ‘D:_Apps\xxxx.sonarqube\out\0\output-cs’
INFO: Importing results from 6 proto files in ‘D:_Apps\xxxx.sonarqube\out\8\output-cs’
INFO: Importing results from 6 proto files in ‘D:_Apps\xxxx.sonarqube\out\7\output-cs’
INFO: Importing results from 6 proto files in ‘D:_Apps\xxxx.sonarqube\out\15\output-cs’
INFO: Importing 16 Roslyn reports
INFO: Found 8 MSBuild C# projects: 4 MAIN projects. 4 TEST projects.
INFO: Sensor C# [csharp] (done) | time=2407ms
INFO: Sensor Analysis Warnings import [csharp]
INFO: Sensor Analysis Warnings import [csharp] (done) | time=11ms
INFO: Sensor C# File Caching Sensor [csharp]
INFO: Sensor C# File Caching Sensor [csharp] (done) | time=47ms
INFO: Sensor C# Tests Coverage Report Import [csharp]
INFO: Parsing the Visual Studio coverage XML report D:_Apps\xxxx\coverage.xml
INFO: Adding this code coverage report to the cache for later reuse: D:_Apps\xxxx\coverage.xml
INFO: Coverage Report Statistics: 68 files, 45 main files, 45 main files with coverage, 23 test files, 0 project excluded files, 0 other language files.
INFO: Sensor C# Tests Coverage Report Import [csharp] (done) | time=725ms
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=3ms
INFO: SCM Publisher SCM provider for this project is: git
INFO: SCM Publisher 80 source files to be analyzed
INFO: SCM Publisher 80/80 source files have been analyzed (done) | time=8188ms
INFO: CPD Executor 17 files had no CPD blocks
INFO: CPD Executor Calculating CPD for 40 files
INFO: CPD Executor CPD calculation finished (done) | time=72ms
INFO: Analysis report generated in 443ms, dir size=556.5 kB
INFO: Analysis report compressed in 552ms, zip size=227.7 kB
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 1:34.990s
INFO: Final Memory: 39M/134M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarScanner execution
java.lang.IllegalStateException: Failed to upload report: Fail to request url: https://sonarqube.xxxx
at org.sonar.scanner.report.ReportPublisher.upload(ReportPublisher.java:226)
at org.sonar.scanner.report.ReportPublisher.execute(ReportPublisher.java:154)
at org.sonar.scanner.scan.SpringProjectScanContainer.doAfterStart(SpringProjectScanContainer.java:376)
at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188)
at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167)
at org.sonar.scanner.bootstrap.SpringGlobalContainer.doAfterStart(SpringGlobalContainer.java:137)
at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188)
at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167)
at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:72)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:66)
at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
at java.base/java.lang.reflect.Method.invoke(Method.java:578)
at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
at jdk.proxy1/jdk.proxy1.$Proxy0.execute(Unknown Source)
at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189)
at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
at org.sonarsource.scanner.cli.Main.execute(Main.java:126)
at org.sonarsource.scanner.cli.Main.execute(Main.java:81)
at org.sonarsource.scanner.cli.Main.main(Main.java:62)
Caused by: java.lang.IllegalStateException: Fail to request url: https://sonarqube.xxxx
at org.sonarqube.ws.client.HttpConnector.doCall(HttpConnector.java:208)
at org.sonarqube.ws.client.HttpConnector.post(HttpConnector.java:158)
at org.sonarqube.ws.client.HttpConnector.call(HttpConnector.java:115)
at org.sonar.scanner.bootstrap.DefaultScannerWsClient.call(DefaultScannerWsClient.java:87)
at org.sonar.scanner.report.ReportPublisher.upload(ReportPublisher.java:224)
… 19 more
Caused by: java.net.SocketTimeoutException: Read timed out
at java.base/sun.nio.ch.NioSocketImpl.timedRead(NioSocketImpl.java:273)
at java.base/sun.nio.ch.NioSocketImpl.implRead(NioSocketImpl.java:299)
at java.base/sun.nio.ch.NioSocketImpl.read(NioSocketImpl.java:340)
at java.base/sun.nio.ch.NioSocketImpl$1.read(NioSocketImpl.java:789)
at java.base/java.net.Socket$SocketInputStream.read(Socket.java:1025)
at java.base/sun.security.ssl.SSLSocketInputRecord.read(SSLSocketInputRecord.java:477)
at java.base/sun.security.ssl.SSLSocketInputRecord.readHeader(SSLSocketInputRecord.java:471)
at java.base/sun.security.ssl.SSLSocketInputRecord.bytesInCompletePacket(SSLSocketInputRecord.java:70)
at java.base/sun.security.ssl.SSLSocketImpl.readApplicationRecord(SSLSocketImpl.java:1465)
at java.base/sun.security.ssl.SSLSocketImpl$AppInputStream.read(SSLSocketImpl.java:1069)
at okio.InputStreamSource.read(JvmOkio.kt:94)
at okio.AsyncTimeout$source$1.read(AsyncTimeout.kt:125)
at okio.RealBufferedSource.indexOf(RealBufferedSource.kt:427)
at okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.kt:320)
at okhttp3.internal.http1.HeadersReader.readLine(HeadersReader.kt:29)
at okhttp3.internal.http1.Http1ExchangeCodec.readResponseHeaders(Http1ExchangeCodec.kt:178)
at okhttp3.internal.connection.Exchange.readResponseHeaders(Exchange.kt:106)
at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.kt:79)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
at org.sonarqube.ws.client.OkHttpClientBuilder.addHeaders(OkHttpClientBuilder.java:222)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.kt:34)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.kt:95)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:83)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:76)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:201)
at okhttp3.internal.connection.RealCall.execute(RealCall.kt:154)
at org.sonarqube.ws.client.HttpConnector.doCall(HttpConnector.java:206)
… 23 more
ERROR:
The SonarScanner did not complete successfully
10:36:25.115 Post-processing failed. Exit code: 1
‘’‘’’