搭建slave ios平台爆出 org.sonarsource.scanner.api.internal.ScannerException: Unable to execute SonarQube
来源:互联网 发布:mac如何装win10 编辑:程序博客网 时间:2024/05/17 21:46
INFO: SonarQube Scanner 2.6.1
INFO: Java 1.8.0_91 Oracle Corporation (32-bit)
INFO: Windows 7 6.1 x86
INFO: User cache: C:\Users\Administrator\.sonar\cache
ERROR: SonarQube server [http://localhost:9000] can not be reached
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 5.414s
INFO: Final Memory: 2M/15M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarQube Scanner execution
ERROR: Unable to execute SonarQube
ERROR: Caused by: Fail to download libraries from server
ERROR: Caused by: Connection refused: connect
ERROR:
ERROR: To see the full stack trace of the errors, re-run SonarQube Scanner with
the -e switch.
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging。
问题:sonar 插件不能获取。
--------------------------------------------------------------------------------------------------------------------------------------------
官方地址:https://docs.sonarqube.org/display/SCAN/Analyzing+Source+Code
First, you should install the plugin(s) for the language(s) of the project to be analyzed, either by a direct download or through the Marketplace.
Then, you need to choose an analysis method. The following are available:
- SonarQube Scanner for MSBuild: Launch analysis of .Net projects
- SonarQube Scanner for Maven: Launch analysis from Maven with minimal configuration
- SonarQube Scanner for Gradle: Launch Gradle analysis
- SonarQube Scanner for Ant: Launch analysis from Ant
- SonarQube Scanner For Jenkins: Launch analysis from Jenkins
- SonarQube Scanner: Launch analysis from the command line when none of the other analyzers is appropriate
Note that we do not recommend running an antivirus scanner on the machine where a SonarQube analysis runs, it could result in unpredictable behavior.
可见sonar-scanner 可以是ant,msbuild,maven,gradle,jenkins拉起来;以及自己单独拉起来。------------------------------------------------------------------------------------------------------------------------------------------
IOS 系统是基于Unix 内核的,所以可以通过ssh连接,通过shell 单独运行 sonar-scanner sh启动文件,查看报错:
bogon:bin suning$ sh sonar-runnerWARN: sonar-runner script is deprecated. Please use sonar-scanner instead.Unable to find a $JAVA_HOME at "/usr", continuing with system-provided Java...INFO: Scanner configuration file: /Users/suning/jenkinssonar/sonar-scanner-2.9.0.670/conf/sonar-scanner.propertiesINFO: Project root configuration file: NONEINFO: SonarQube Scanner 2.9.0.670INFO: Java 1.8.0_74 Oracle Corporation (64-bit)INFO: Mac OS X 10.12 x86_64INFO: User cache: /Users/suning/.sonar/cacheERROR: SonarQube server [http://localhost:9000] can not be reachedINFO: ------------------------------------------------------------------------INFO: EXECUTION FAILUREINFO: ------------------------------------------------------------------------INFO: Total time: 0.275sINFO: Final Memory: 3M/123MINFO: ------------------------------------------------------------------------ERROR: Error during SonarQube Scanner executionorg.sonarsource.scanner.api.internal.ScannerException: Unable to execute SonarQubeat 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:74)at org.sonarsource.scanner.cli.Main.main(Main.java:61)Caused by: java.lang.IllegalStateException: Fail to get bootstrap index from serverat org.sonarsource.scanner.api.internal.Jars.getBootstrapIndex(Jars.java:100)at org.sonarsource.scanner.api.internal.Jars.getScannerEngineFiles(Jars.java:76)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 moreCaused by: java.net.ConnectException: Failed to connect to localhost/0:0:0:0:0:0:0:1:9000at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.connection.RealConnection.connectSocket(RealConnection.java:222)at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.connection.RealConnection.connect(RealConnection.java:146)at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:186)at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:121)at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.connection.StreamAllocation.newStream(StreamAllocation.java:100)at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42)at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:120)at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)at org.sonarsource.scanner.api.internal.shaded.okhttp.RealCall.getResponseWithInterceptorChain(RealCall.java:179)at org.sonarsource.scanner.api.internal.shaded.okhttp.RealCall.execute(RealCall.java:63)at org.sonarsource.scanner.api.internal.ServerConnection.callUrl(ServerConnection.java:113)at org.sonarsource.scanner.api.internal.ServerConnection.downloadString(ServerConnection.java:98)at org.sonarsource.scanner.api.internal.Jars.getBootstrapIndex(Jars.java:96)... 12 moreCaused by: java.net.ConnectException: Connection refusedat java.net.PlainSocketImpl.socketConnect(Native Method)at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)at java.net.Socket.connect(Socket.java:589)at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.platform.Platform.connectSocket(Platform.java:124)at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.connection.RealConnection.connectSocket(RealConnection.java:220)... 32 moreERROR: ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
报错信息和jenkins上报错信息一致!!!
使用debug 调试:
bogon:bin suning$ sh sonar-runner -X
但是 默认地址是localhost
所以在sonar-scanner.properties 中配置地址和属性 如下:
#Configure here general information about the environment, such as SonarQube DB details for example#No information about specific project should appear here#----- Default SonarQube serversonar.host.url=http://10.27.199.187:9000/sonarsonar.jdbc.url=jdbc:mysql://10.37.87.250:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformancesonar.jdbc.username=fabusonar.jdbc.password=SuningRds@123#----- Default source code encodingsonar.sourceEncoding=UTF-8sonar.login=adminsonar.password=admin调试日志:
bogon:bin suning$ sh sonar-runner -XWARN: sonar-runner script is deprecated. Please use sonar-scanner instead.Unable to find a $JAVA_HOME at "/usr", continuing with system-provided Java...21:23:30.526 INFO: Scanner configuration file: /Users/suning/jenkinssonar/sonar-scanner-2.9.0.670/conf/sonar-scanner.properties21:23:30.528 INFO: Project root configuration file: NONE21:23:30.548 INFO: SonarQube Scanner 2.9.0.67021:23:30.548 INFO: Java 1.8.0_74 Oracle Corporation (64-bit)21:23:30.549 INFO: Mac OS X 10.12 x86_6421:23:30.722 DEBUG: keyStore is : 21:23:30.722 DEBUG: keyStore type is : jks21:23:30.722 DEBUG: keyStore provider is : 21:23:30.722 DEBUG: init keystore21:23:30.723 DEBUG: init keymanager of type SunX50921:23:30.758 INFO: User cache: /Users/suning/.sonar/cache21:23:30.758 DEBUG: Extract sonar-scanner-api-batch in temp...21:23:30.767 DEBUG: Get bootstrap index...21:23:30.768 DEBUG: Download: http://10.27.199.187:9000/sonar/batch/index21:23:35.832 ERROR: SonarQube server [http://10.27.199.187:9000/sonar] can not be reached21:23:35.832 INFO: ------------------------------------------------------------------------21:23:35.832 INFO: EXECUTION FAILURE21:23:35.832 INFO: ------------------------------------------------------------------------21:23:35.833 INFO: Total time: 5.327s21:23:35.852 INFO: Final Memory: 3M/123M21:23:35.853 INFO: ------------------------------------------------------------------------21:23:35.853 ERROR: Error during SonarQube Scanner executionorg.sonarsource.scanner.api.internal.ScannerException: Unable to execute SonarQubeat 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:74)at org.sonarsource.scanner.cli.Main.main(Main.java:61)Caused by: java.lang.IllegalStateException: Fail to get bootstrap index from serverat org.sonarsource.scanner.api.internal.Jars.getBootstrapIndex(Jars.java:100)at org.sonarsource.scanner.api.internal.Jars.getScannerEngineFiles(Jars.java:76)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 moreCaused by: java.net.SocketTimeoutException: connect timed outat java.net.PlainSocketImpl.socketConnect(Native Method)at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)at java.net.Socket.connect(Socket.java:589)at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.platform.Platform.connectSocket(Platform.java:124)at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.connection.RealConnection.connectSocket(RealConnection.java:220)at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.connection.RealConnection.connect(RealConnection.java:146)at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:186)at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:121)at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.connection.StreamAllocation.newStream(StreamAllocation.java:100)at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42)at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:120)at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)at org.sonarsource.scanner.api.internal.shaded.okhttp.RealCall.getResponseWithInterceptorChain(RealCall.java:179)at org.sonarsource.scanner.api.internal.shaded.okhttp.RealCall.execute(RealCall.java:63)at org.sonarsource.scanner.api.internal.ServerConnection.callUrl(ServerConnection.java:113)at org.sonarsource.scanner.api.internal.ServerConnection.downloadString(ServerConnection.java:98)at org.sonarsource.scanner.api.internal.Jars.getBootstrapIndex(Jars.java:96)... 12 more
在windos 机器上调试:(sonar-scanner 支持Linux、Unix、window(ios内核是Unix),因为启动文件有bat和sh脚本文件)
2017-12-02 15:36:41D:\sonar-scanner-2.9.0.670\bin>sonar-scanner.bat -XD:\sonar-scanner-2.9.0.670\bin\..21:44:22.317 INFO: Scanner configuration file: D:\sonar-scanner-2.9.0.670\bin\..\conf\sonar-scanner.properties21:44:22.358 INFO: Project root configuration file: NONE21:44:22.490 INFO: SonarQube Scanner 2.9.0.67021:44:22.492 INFO: Java 1.8.0_101 Oracle Corporation (64-bit)21:44:22.494 INFO: Windows 7 6.1 amd6421:44:23.082 DEBUG: keyStore is :21:44:23.084 DEBUG: keyStore type is : jks21:44:23.086 DEBUG: keyStore provider is :21:44:23.087 DEBUG: init keystore21:44:23.090 DEBUG: init keymanager of type SunX50921:44:23.514 INFO: User cache: C:\Users\10111065\.sonar\cache21:44:23.518 DEBUG: Extract sonar-scanner-api-batch in temp...21:44:23.540 DEBUG: Get bootstrap index...21:44:23.541 DEBUG: Download: http://10.27.199.187:9000/sonar/batch/index21:44:23.728 ERROR: SonarQube server [http://10.27.199.187:9000/sonar] can not be reached21:44:23.732 INFO: ------------------------------------------------------------------------21:44:23.734 INFO: EXECUTION FAILURE21:44:23.736 INFO: ------------------------------------------------------------------------21:44:23.740 INFO: Total time: 1.657s21:44:23.784 INFO: Final Memory: 4M/61M21:44:23.787 INFO: ------------------------------------------------------------------------21:44:23.789 ERROR: Error during SonarQube Scanner executionorg.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:74) at org.sonarsource.scanner.cli.Main.main(Main.java:61)Caused by: java.lang.IllegalStateException: Fail to get bootstrap index from server at org.sonarsource.scanner.api.internal.Jars.getBootstrapIndex(Jars.java:100) at org.sonarsource.scanner.api.internal.Jars.getScannerEngineFiles(Jars.java:76) 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 moreCaused by: java.lang.IllegalStateException: Status returned by url [http://10.27.199.187:9000/sonar/batch/index] is not valid: [404] at org.sonarsource.scanner.api.internal.ServerConnection.callUrl(ServerConnection.java:115) at org.sonarsource.scanner.api.internal.ServerConnection.downloadString(ServerConnection.java:98) at org.sonarsource.scanner.api.internal.Jars.getBootstrapIndex(Jars.java:96) ... 12 more所以单独运行sonar-scanner 文件都是这样的调试结果,所以ios运行报错,和sonar-scanner 请求batch/index 异常无关。
#################################################################################
上面报错是使用sonar-scanner2.9.0.670版本,然后换成sonar-scanner2.8 版本就可以了;所以ios平台 : MAC OS X 10.12
INFO: Java 1.8.0_74 Oracle Corporation (64-bit)INFO: Mac OS X 10.12 x86_64只支持sonar-scanner 2.8 !!!
- 搭建slave ios平台爆出 org.sonarsource.scanner.api.internal.ScannerException: Unable to execute SonarQube
- Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.2:sonar (default-cli) on p
- Unable to load class 'org.gradle.api.internal.component.Usage'
- Unable to load class 'org.gradle.api.internal.component.Usage'
- Unable to find method 'org.gradle.api.internal.file.DefaultSourceDirectorySet
- sonarQube之平台搭建及sonar-scanner扫描
- [Sonar][WARNING] Error injecting: org.sonarsource.scanner.maven.SonarQubeMojo
- Error:Unable to load class ‘org.gradle.api.publication.maven.internal.DefaultMavenFactory’
- 解决Error:Unable to find method 'org.gradle.api.internal.project.ProjectInternal
- 解决Error:Unable to find method 'org.gradle.api.internal.project.ProjectInternal……
- 解决Error:Unable to find method 'org.gradle.api.internal.project.ProjectInternal.
- Error:Unable to load class 'org.gradle.api.internal.component.Usage'.
- Android Studio 3.0升级--Unable to load class ‘org.gradle.api.internal.component.Usage’.
- 关于Android导入开源项目:Error:Unable to load class 'org.gradle.api.publication.maven.internal.DefaultMavenFa
- 我的Android进阶之旅------>解决Error:Unable to find method 'org.gradle.api.internal.project.ProjectInternal.g
- Android进阶之旅------>解决Error:Unable to find method 'org.gradle.api.internal.project.ProjectInternal.g
- Caused by: org.yaml.snakeyaml.scanner.ScannerException: while scanning for the next token found char
- Unable to execute dex
- pycham import random
- MYSQL中常用的字符串函数
- SDUT-2143
- 20171125-1126:java一些基础的学习,没啥说的
- OOP思想和范式编程
- 搭建slave ios平台爆出 org.sonarsource.scanner.api.internal.ScannerException: Unable to execute SonarQube
- mybatis注解使用
- 【MySql】Sql优化(三)——性能优化
- Python编码错误的解决办法SyntaxError: Non-ASCII character '\xe5' in file
- 源代码寻找分享
- BZOJ3156: 防御准备
- 2017.11.30 刘明春第8天总结
- MyBatis Generator
- PersonalRank:一种基于图的推荐算法