【问题标题】:Jenkins: org.sonarsource.scanner.api.internal.ScannerException: Unable to execute SonarQube詹金斯:org.sonarsource.scanner.api.internal.ScannerException:无法执行 SonarQube
【发布时间】:2019-11-24 02:14:46
【问题描述】:

虽然Get bootstrap completed 步骤之前成功运行,但使用声纳扫描仪失败并出现错误。看到了

org.sonarsource.scanner.api.internal.ScannerException:无法执行 SonarQube

更多细节:

/opt/sonar-scanner/bin/sonar-scanner -X -Djavax.net.debug="ssl,handshake" -Dsonar.projectKey=project-header-forwarding -Dsonar.projectName=project-header-forwarding -Dsonar.projectVersion=0.0.80 -Dsonar.sourceEncoding=UTF-8 -Dsonar.host.url=http://my-sonarsystem:9000 -Dsonar.projectBaseDir=/home/jenkins-master/workspace/project-header-forwarding_master
11:55:59.205 INFO: Scanner configuration file: /opt/sonar-scanner/conf/sonar-scanner.properties
11:55:59.221 INFO: Project root configuration file: NONE
11:55:59.270 INFO: SonarQube Scanner 2.8
11:55:59.270 INFO: Java 1.8.0_212 Oracle Corporation (64-bit)
11:55:59.270 INFO: Linux 3.10.0-957.12.2.el7.x86_64 amd64
11:55:59.560 DEBUG: keyStore is :
11:55:59.561 DEBUG: keyStore type is : jks
11:55:59.561 DEBUG: keyStore provider is :
11:55:59.561 DEBUG: init keystore
11:55:59.562 DEBUG: init keymanager of type SunX509
11:55:59.665 INFO: User cache: /home/wpci/.sonar/cache
11:55:59.665 DEBUG: Extract sonar-scanner-api-batch in temp...
11:55:59.680 DEBUG: Get bootstrap index...
11:55:59.680 DEBUG: Download: http://my-sonarsystem:9000/batch_bootstrap/index
11:55:59.962 DEBUG: Get bootstrap completed
11:55:59.969 INFO: ------------------------------------------------------------------------
11:55:59.970 INFO: EXECUTION FAILURE
11:55:59.970 INFO: ------------------------------------------------------------------------
11:55:59.971 INFO: Total time: 0.832s
11:56:00.014 INFO: Final Memory: 4M/178M
11:56:00.014 INFO: ------------------------------------------------------------------------
11:56:00.014 ERROR: Error during SonarQube Scanner execution
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:72)
at org.sonarsource.scanner.cli.Main.main(Main.java:61)
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: java.lang.ArrayIndexOutOfBoundsException: 1
at org.sonarsource.scanner.api.internal.Jars.downloadFiles(Jars.java:87)
... 11 more

【问题讨论】:

    标签: sonarqube sonar-runner


    【解决方案1】:

    您运行的 Sonar Scanner 版本与您的 SonarQube 版本不兼容。

    更具体地说,您正在使用的 Sonar Scanner 版本尝试通过从 SonarQube 服务器的 batch_bootstrap/index 端点获取列表来下载相关的扫描仪 Jars,但这已被弃用,然后在更新的 SonarQube 版本中被删除,在赞成bootstrap/index,所以扫描器正试图解析一个空的罐子列表。

    根据您运行的 SonarQube 版本,更新到 Sonar Scanner 4 应该可以解决这个问题。

    【讨论】:

      猜你喜欢
      • 2016-12-24
      • 1970-01-01
      • 1970-01-01
      • 2017-11-02
      • 2016-12-15
      • 2020-12-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多