本文主要是介绍ERROR: SonarQube server [xxxx:9000] can not be reached,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
一、问题描述
jenkins集成sonarqube时,出现以下错误:
INFO: Scanner configuration file: /usr/local/software/sonar-scanner/conf/sonar-scanner.properties
INFO: Project root configuration file: NONE
INFO: SonarScanner 4.8.0.2856
INFO: Java 11.0.17 Eclipse Adoptium (64-bit)
INFO: Linux 3.10.0-1160.88.1.el7.x86_64 amd64
INFO: User cache: /var/lib/jenkins/.sonar/cache
ERROR: SonarQube server [192.168.56.101:9000] can not be reached
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 0.210s
INFO: Final Memory: 3M/17M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarScanner execution
org.sonarsource.scanner.api.internal.ScannerException: Unable to execute SonarScanner analysisat org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.lambda$createLauncher$0(IsolatedLauncherFactory.java:85)at java.base/java.security.AccessController.doPrivileged(Native Method)at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.createLauncher(IsolatedLauncherFactory.java:74)at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.createLauncher(IsolatedLauncherFactory.java:70)at org.sonarsource.scanner.api.EmbeddedScanner.doStart(EmbeddedScanner.java:185)at org.sonarsource.scanner.api.EmbeddedScanner.start(EmbeddedScanner.java:123)at org.sonarsource.scanner.cli.Main.execute(Main.java:74)at org.sonarsource.scanner.cli.Main.main(Main.java:62)
Caused by: java.lang.IllegalStateException: Fail to get bootstrap index from serverat org.sonarsource.scanner.api.internal.BootstrapIndexDownloader.getIndex(BootstrapIndexDownloader.java:42)at org.sonarsource.scanner.api.internal.JarDownloader.getScannerEngineFiles(JarDownloader.java:58)at org.sonarsource.scanner.api.internal.JarDownloader.download(JarDownloader.java:53)at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.lambda$createLauncher$0(IsolatedLauncherFactory.java:76)... 7 more
Caused by: java.lang.IllegalArgumentException: Expected URL scheme 'http' or 'https' but no colon was foundat org.sonarsource.scanner.api.internal.shaded.okhttp.HttpUrl$Builder.parse(HttpUrl.java:1332)at org.sonarsource.scanner.api.internal.shaded.okhttp.HttpUrl.get(HttpUrl.java:917)at org.sonarsource.scanner.api.internal.shaded.okhttp.Request$Builder.url(Request.java:165)at org.sonarsource.scanner.api.internal.ServerConnection.callUrl(ServerConnection.java:111)at org.sonarsource.scanner.api.internal.ServerConnection.downloadString(ServerConnection.java:99)at org.sonarsource.scanner.api.internal.BootstrapIndexDownloader.getIndex(BootstrapIndexDownloader.java:39)... 10 more
ERROR:
ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.
ERROR: SonarQube scanner exited with non-zero code: 1
SSH: Current build result is [FAILURE], not going to run.
Finished: FAILURE
二、解决方法
日志提到:ERROR: SonarQube server [192.168.56.101:9000] can not be reached
,故检查jenkins中配置的sonarqube地址信息是否有问题,发现sonarqube的服务地址填写错误,如下图所示,少了前缀http://,应改为http://192.168.156.101:9000
三、参考
- https://www.reddit.com/r/devops/comments/rn2s4k/jenkins_server_unable_to_connect_to_sonarqube/
这篇关于ERROR: SonarQube server [xxxx:9000] can not be reached的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!