MSBuild.SonarQube.Runner.exe无法访问https://sonarqube.com

时间:2016-10-25 21:23:10

标签: sonarqube

我正在尝试使用msbuild扫描程序在本地运行SonarQube Analysis。

我可以毫无问题地致电MSBuild.SonarQube.Runner.exe begin /key:"CanoePoloLeagueOrganiser" /name:"CanoePoloLeagueOrganiser" /version:"1.0.0"

我也可以毫无问题地运行msbuild步骤("C:/Program Files (x86)/MSBuild/14.0/Bin/MSBuild.exe" "C:\Users\ceddl\Documen ts\GITHub\CanoePoloLeagueOrganiser\CanoePoloLeagueOrganiser.sln")。

但是当我打电话给MSBuild.SonarQube.Runner.exe end时,它失败了。

我启用了完整的调试日志输出并完成了大量的Google搜索并查看生成的文件,但它看起来应该对我有用。我已经在xml文件中生成了一个令牌,我可以curlhttps://sonarqube.com没问题,所以我不认为它是防火墙问题。

这是我得到的输出

SonarQube Scanner for MSBuild 2.1
Default properties file was found at C:\Users\ceddl\Documents\GITHub\CanoePoloLeagueOrganiser\tools\sonar\SonarQube.Analysis.xml
Loading analysis properties from C:\Users\ceddl\Documents\GITHub\CanoePoloLeagueOrganiser\tools\sonar\SonarQube.Analysis.xml
sonar.verbose=true was specified - setting the log verbosity to 'Debug'
Post-processing started.
Using environment variables to determine the download directory...
Executing file C:\Users\ceddl\Documents\GITHub\CanoePoloLeagueOrganiser\.sonarqube\bin\MSBuild.SonarQube.Internal.PostProcess.exe
  Args:
  Working directory: C:\Users\ceddl\Documents\GITHub\CanoePoloLeagueOrganiser\.sonarqube
  Timeout (ms):-1
  Process id: 8236
SonarQube Scanner for MSBuild End Step 2.1
22:01:54.73  sonar.verbose=true was specified - setting the log verbosity to 'Debug'
22:01:54.734  Loading the SonarQube analysis config from C:\Users\ceddl\Documents\GITHub\CanoePoloLeagueOrganiser\.sonarqube\conf\SonarQubeAnalysisConfig.xml
22:01:54.734  Not running under TeamBuild
22:01:54.734  Analysis base directory: C:\Users\ceddl\Documents\GITHub\CanoePoloLeagueOrganiser\.sonarqube
Build directory:
Bin directory: C:\Users\ceddl\Documents\GITHub\CanoePoloLeagueOrganiser\.sonarqube\bin
Config directory: C:\Users\ceddl\Documents\GITHub\CanoePoloLeagueOrganiser\.sonarqube\conf
Output directory: C:\Users\ceddl\Documents\GITHub\CanoePoloLeagueOrganiser\.sonarqube\out
Config file: C:\Users\ceddl\Documents\GITHub\CanoePoloLeagueOrganiser\.sonarqube\out
Generating SonarQube project properties file to C:\Users\ceddl\Documents\GITHub\CanoePoloLeagueOrganiser\.sonarqube\out\sonar-project.properties
The supplied Code Analysis ErrorLog file is a valid json file and does not need to be fixed: C:\Users\ceddl\Documents\GITHub\CanoePoloLeagueOrganiser\CanoePoloLeagueOrganiserXamarin\bin\Debug\CanoePoloLeagueOrganiserXamarin.dll.RoslynCA.json
The supplied Code Analysis ErrorLog file is a valid json file and does not need to be fixed: C:\Users\ceddl\Documents\GITHub\CanoePoloLeagueOrganiser\CanoePoloLeagueOrganiser\bin\Debug\CanoePoloLeagueOrganiser.dll.RoslynCA.json
The supplied Code Analysis ErrorLog file is a valid json file and does not need to be fixed: C:\Users\ceddl\Documents\GITHub\CanoePoloLeagueOrganiser\XamarinFormsPortable\XamarinFormsPortable.Droid\bin\Debug\XamarinFormsPortable.Droid.dll.RoslynCA.json
The supplied Code Analysis ErrorLog file is a valid json file and does not need to be fixed: C:\Users\ceddl\Documents\GITHub\CanoePoloLeagueOrganiser\XamarinFormsPortable\XamarinFormsPortable\bin\Debug\XamarinFormsPortable.dll.RoslynCA.json

WARNING: File is not under the project directory and cannot currently be analysed by SonarQube. File: C:\Users\ceddl\AppData\Local\Temp\.NETFramework,Version=v4.6.1.AssemblyAttributes.cs, project: C:\Users\ceddl\Documents\GITHub\CanoePoloLeagueOrganiser\CanoePoloLeagueOrganiserTests\CanoePoloLeagueOrganiserTests.csproj

WARNING: File is not under the project directory and cannot currently be analysed by SonarQube. File: C:\Users\ceddl\Documents\GITHub\CanoePoloLeagueOrganiser\packages\xunit.runner.visualstudio.2.1.0\build\_common\xunit.runner.visualstudio.testadapter.dll, project: C:\Users\ceddl\Documents\GITHub\CanoePoloLeagueOrganiser\CanoePoloLeagueOrganiserTests\CanoePoloLeagueOrganiserTests.csproj
WARNING: File is not under the project directory and cannot currently be analysed by SonarQube. File: C:\Users\ceddl\Documents\GITHub\CanoePoloLeagueOrganiser\packages\xunit.runner.visualstudio.2.1.0\build\_common\xunit.runner.utility.desktop.dll, project: C:\Users\ceddl\Documents\GITHub\CanoePoloLeagueOrganiser\CanoePoloLeagueOrganiserTests\CanoePoloLeagueOrganiserTests.csproj
WARNING: File is not under the project directory and cannot currently be analysed by SonarQube. File: C:\Users\ceddl\Documents\GITHub\CanoePoloLeagueOrganiser\packages\xunit.runner.visualstudio.2.1.0\build\_common\xunit.abstractions.dll, project: C:\Users\ceddl\Documents\GITHub\CanoePoloLeagueOrganiser\CanoePoloLeagueOrganiserTests\CanoePoloLeagueOrganiserTests.csproj
WARNING: File is not under the project directory and cannot currently be analysed by SonarQube. File: C:\Users\ceddl\AppData\Local\Temp\MonoAndroid,Version=v6.0.AssemblyAttributes.cs, project: C:\Users\ceddl\Documents\GITHub\CanoePoloLeagueOrganiser\CanoePoloLeagueOrganiserXamarin\CanoePoloLeagueOrganiserXamarin.csproj

WARNING: File is not under the project directory and cannot currently be analysed by SonarQube. File: C:\Users\ceddl\AppData\Local\Temp\.NETPortable,Version=v4.5,Profile=Profile111.AssemblyAttributes.cs, project: C:\Users\ceddl\Documents\GITHub\CanoePoloLeagueOrganiser\CanoePoloLeagueOrganiser\CanoePoloLeagueOrganiser.csproj
WARNING: File is not under the project directory and cannot currently be analysed by SonarQube. File: C:\Users\ceddl\AppData\Local\Temp\MonoAndroid,Version=v6.0.AssemblyAttributes.cs, project: C:\Users\ceddl\Documents\GITHub\CanoePoloLeagueOrganiser\XamarinFormsPortable\XamarinFormsPortable.Droid\XamarinFormsPortable.Droid.csproj
WARNING: File is not under the project directory and cannot currently be analysed by SonarQube. File: C:\Users\ceddl\AppData\Local\Temp\.NETPortable,Version=v4.5,Profile=Profile111.AssemblyAttributes.cs, project: C:\Users\ceddl\Documents\GITHub\CanoePoloLeagueOrganiser\XamarinFormsPortable\XamarinFormsPortable\XamarinFormsPortable.csproj
Setting analysis property: sonar.visualstudio.enable=false
Writing processing summary to C:\Users\ceddl\Documents\GITHub\CanoePoloLeagueOrganiser\.sonarqube\out\ProjectInfo.log
Removing the existing directory: C:\Users\ceddl\Documents\GITHub\CanoePoloLeagueOrganiser\.sonarqube\bin\sonar-scanner
Creating directory: C:\Users\ceddl\Documents\GITHub\CanoePoloLeagueOrganiser\.sonarqube\bin\sonar-scanner
SONAR_SCANNER_OPTS is not configured. Setting it to the default value of -Xmx1024m
Calling the SonarQube Scanner...
Setting environment variable 'SONAR_SCANNER_OPTS'. Value: -Xmx1024m
Executing file C:\Users\ceddl\Documents\GITHub\CanoePoloLeagueOrganiser\.sonarqube\bin\sonar-scanner\bin\sonar-scanner.bat
  Args: -Dproject.settings=C:\Users\ceddl\Documents\GITHub\CanoePoloLeagueOrganiser\.sonarqube\out\sonar-project.properties -e <sensitive data removed>
  Working directory: C:\Users\ceddl\Documents\GITHub\CanoePoloLeagueOrganiser
  Timeout (ms):-1
  Process id: 3228
C:\Users\ceddl\Documents\GITHub\CanoePoloLeagueOrganiser\.sonarqube\bin\sonar-scanner\bin\..
INFO: Scanner configuration file: C:\Users\ceddl\Documents\GITHub\CanoePoloLeagueOrganiser\.sonarqube\bin\sonar-scanner\bin\..\conf\sonar-scanner.properties
INFO: Project root configuration file: C:\Users\ceddl\Documents\GITHub\CanoePoloLeagueOrganiser\.sonarqube\out\sonar-project.properties
INFO: SonarQube Scanner 2.6
INFO: Java 1.7.0_71 Oracle Corporation (32-bit)
INFO: Windows 8.1 6.3 x86
INFO: SONAR_SCANNER_OPTS=-Xmx1024m
INFO: Error stacktraces are turned on.
INFO: User cache: C:\Users\ceddl\.sonar\cache
DEBUG: Extract sonar-scanner-api-batch in temp...
DEBUG: Get bootstrap index...
DEBUG: Download: https://sonarqube.com/batch_bootstrap/index
INFO: ------------------------------------------------------------------------
ERROR: SonarQube server [https://sonarqube.com] can not be reached
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 0.797s
INFO: Final Memory: 3M/15M
ERROR: Error during SonarQube Scanner execution
INFO: ------------------------------------------------------------------------
org.sonarsource.scanner.api.internal.ScannerException: Unable to execute SonarQube
        at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory$1.run(IsolatedLauncherFactory.java:84)
        at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory$1.run(IsolatedLauncherFactory.java:71)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.createLauncher(IsolatedLauncherFactory.java:71)
        at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.createLauncher(IsolatedLauncherFactory.java:67)
        at org.sonarsource.scanner.api.EmbeddedScanner.doStart(EmbeddedScanner.java:218)
        at org.sonarsource.scanner.api.EmbeddedScanner.start(EmbeddedScanner.java:156)
        at org.sonarsource.scanner.cli.Main.execute(Main.java:70)
        at org.sonarsource.scanner.cli.Main.main(Main.java:60)
Caused by: java.lang.IllegalStateException: Fail to download libraries from server
        at org.sonarsource.scanner.api.internal.Jars.downloadFiles(Jars.java:93)

        at org.sonarsource.scanner.api.internal.Jars.download(Jars.java:70)
        at org.sonarsource.scanner.api.internal.JarDownloader.download(JarDownloader.java:39)
        at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory$1.run(IsolatedLauncherFactory.java:75)
        ... 8 more
Caused by: javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
        at sun.security.ssl.Alerts.getSSLException(Unknown Source)
        at sun.security.ssl.Alerts.getSSLException(Unknown Source)
        at sun.security.ssl.SSLSocketImpl.recvAlert(Unknown Source)
        at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
        at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
        at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
        at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
        at org.sonarsource.scanner.api.internal.shaded.okhttp.Connection.connectTls(Connection.java:239)
        at org.sonarsource.scanner.api.internal.shaded.okhttp.Connection.connectSocket(Connection.java:201)
        at org.sonarsource.scanner.api.internal.shaded.okhttp.Connection.connect(Connection.java:172)
        at org.sonarsource.scanner.api.internal.shaded.okhttp.Connection.connectAndSetOwner(Connection.java:358)
        at org.sonarsource.scanner.api.internal.shaded.okhttp.OkHttpClient$1.connectAndSetOwner(OkHttpClient.java:117)
        at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:329)
        at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:246)
        at org.sonarsource.scanner.api.internal.shaded.okhttp.Call.getResponse(Call.java:276)
        at org.sonarsource.scanner.api.internal.shaded.okhttp.Call$ApplicationInterceptorChain.proceed(Call.java:234)
        at org.sonarsource.scanner.api.internal.shaded.okhttp.Call.getResponseWithInterceptorChain(Call.java:196)
        at org.sonarsource.scanner.api.internal.shaded.okhttp.Call.execute(Call.java:79)
        at org.sonarsource.scanner.api.internal.ServerConnection.callUrl(ServerConnection.java:114)
        at org.sonarsource.scanner.api.internal.ServerConnection.downloadString(ServerConnection.java:99)
        at org.sonarsource.scanner.api.internal.Jars.downloadFiles(Jars.java:78)

        ... 11 more
ERROR:
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
Process returned exit code 1
The SonarQube Scanner did not complete successfully
22:01:55.932  Creating a summary markdown file...
Process returned exit code 1
Post-processing failed. Exit code: 1

由于

CEDD

1 个答案:

答案 0 :(得分:1)

这是一个SSL问题:javax.net.ssl.SSLHandshakeException。最可能的原因:您的(旧)Java 7 JVM不会说TLS v1.2。

无需修复Java 7 JVM设置:SonarQube无论如何都不支持Java 7(参见requirements)。

底线:

  • 确保使用Java 8
  • 如果您仍然获得与SSL相关的异常,则使用-Djavax.net.debug=all(在SONAR_SCANNER_OPTS环境变量中)启用Java-SSL调试日志以了解根本原因