SonarQube"意想不到的结束"

时间:2017-01-10 21:34:22

标签: java maven sonarqube

这个问题已经持续了一段时间。它过去常常间歇性但现在却一直都在失败。扫描因此失败。

org.sonarsource.scanner.maven:sonar-maven-plugin:3.1.1:声纳插件失败并显示错误

[DEBUG] GET 200 http://sonarqubehost/deploy/plugins/findbugs/sonar-findbugs-plugin-3.4.3.jar | time=137ms

        [ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.1.1:sonar (default-cli) on project cm-ui-frontend: Fail to download sonar-findbugs-plugin-3.4.3.jar to /root/.sonar/cache/_tmp/fileCache7348481126430635122.tmp: unexpected end of stream -> [Help 1]
        org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.1.1:sonar (default-cli) on project cm-ui-frontend: Fail to download sonar-findbugs-plugin-3.4.3.jar to /root/.sonar/cache/_tmp/fileCache7348481126430635122.tmp
            at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
            at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
            at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
            at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
            at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
            at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
            at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
            at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
            at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
            at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
            at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
            at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
            at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:498)
            at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
            at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
            at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
            at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
        Caused by: org.apache.maven.plugin.MojoExecutionException: Fail to download sonar-findbugs-plugin-3.4.3.jar to /root/.sonar/cache/_tmp/fileCache7348481126430635122.tmp
            at org.sonarsource.scanner.maven.bootstrap.ExceptionHandling.handle(ExceptionHandling.java:36)
            at org.sonarsource.scanner.maven.bootstrap.ScannerBootstrapper.execute(ScannerBootstrapper.java:81)
            at org.sonarsource.scanner.maven.SonarQubeMojo.execute(SonarQubeMojo.java:117)
            at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
            at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
            ... 20 more
        Caused by: java.lang.IllegalStateException: Fail to download sonar-findbugs-plugin-3.4.3.jar to /root/.sonar/cache/_tmp/fileCache7348481126430635122.tmp
            at org.sonar.home.cache.FileCache.download(FileCache.java:98)
            at org.sonar.home.cache.FileCache.get(FileCache.java:82)
            at org.sonar.batch.bootstrap.BatchPluginInstaller.download(BatchPluginInstaller.java:103)
            at org.sonar.batch.bootstrap.BatchPluginInstaller.loadPlugins(BatchPluginInstaller.java:80)
            at org.sonar.batch.bootstrap.BatchPluginInstaller.installRemotes(BatchPluginInstaller.java:70)
            at org.sonar.batch.bootstrap.BatchPluginRepository.start(BatchPluginRepository.java:53)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:498)
            at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.invokeMethod(ReflectionLifecycleStrategy.java:110)
            at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.start(ReflectionLifecycleStrategy.java:89)
            at org.sonar.core.platform.ComponentContainer$1.start(ComponentContainer.java:320)
            at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.start(AbstractInjectionFactory.java:84)
            at org.picocontainer.behaviors.AbstractBehavior.start(AbstractBehavior.java:169)
            at org.picocontainer.behaviors.Stored$RealComponentLifecycle.start(Stored.java:132)
            at org.picocontainer.behaviors.Stored.start(Stored.java:110)
            at org.picocontainer.DefaultPicoContainer.potentiallyStartAdapter(DefaultPicoContainer.java:1016)
            at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1009)
            at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:767)
            at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:141)
            at org.sonar.batch.bootstrapper.Batch.start(Batch.java:103)
            at org.sonar.batch.bootstrapper.Batch.start(Batch.java:92)
            at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.start(BatchIsolatedLauncher.java:52)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:498)
            at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
            at com.sun.proxy.$Proxy23.start(Unknown Source)
            at org.sonarsource.scanner.api.EmbeddedScanner.doStart(EmbeddedScanner.java:223)
            at org.sonarsource.scanner.api.EmbeddedScanner.start(EmbeddedScanner.java:159)
            at org.sonarsource.scanner.maven.bootstrap.ScannerBootstrapper.execute(ScannerBootstrapper.java:60)
            ... 23 more
        Caused by: java.net.ProtocolException: unexpected end of stream
            at com.squareup.okhttp.internal.http.HttpConnection$ChunkedSource.read(HttpConnection.java:467)
            at okio.RealBufferedSource.read(RealBufferedSource.java:50)
            at okio.RealBufferedSource.exhausted(RealBufferedSource.java:60)
            at okio.InflaterSource.refill(InflaterSource.java:101)
            at okio.InflaterSource.read(InflaterSource.java:62)
            at okio.GzipSource.read(GzipSource.java:80)
            at okio.RealBufferedSource$1.read(RealBufferedSource.java:371)
            at java.io.InputStream.read(InputStream.java:101)
            at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1792)
            at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1769)
            at org.apache.commons.io.IOUtils.copy(IOUtils.java:1744)
            at org.apache.commons.io.FileUtils.copyInputStreamToFile(FileUtils.java:1512)
            at org.sonar.batch.bootstrap.BatchPluginInstaller$FileDownloader.download(BatchPluginInstaller.java:160)
            at org.sonar.home.cache.FileCache.download(FileCache.java:96)
            ... 55 more

其他信息

sonarqube服务器版本:5.6

声纳maven插件:3.1.1

它在Gitlab CI运行器(docker中的docker)上运行

有些时候,我得到类似

等其他罐子的类似错误
Fail to download sonar-scanner-engine-shaded-5.6.jar

这似乎工作正常

curl -v -o a.jar http://sonarqubehost/deploy/plugins/findbugs/sonar-findbugs-plugin-3.4.3.jar

关于可能导致这种情况的任何想法?

2 个答案:

答案 0 :(得分:0)

  

引起:java.lang.IllegalStateException:无法将sonar-findbugs-plugin-3.4.3.jar下载到/root/.sonar/cache/_tmp/fileCache7348481126430635122.tmp

在分析过程中,插件会从SonarQube服务器拉到分析机器。您的分析机器正在越来越难以完成这项工作。检查两台机器之间的网络。

答案 1 :(得分:0)

我遇到了同样的问题,我多次运行声纳maven命令,问题得到了解决。