我最近开始使用MSBUILD从Jenkins运行Sonarqube 7.0。
几次运行成功,但间歇性(现在反复)我发现执行失败。
以下是verbose=true
设置的最终失败。
有没有人有类似的经历,另外,有没有人找到解决方案?
12:05:33 12:05:33.540 INFO: ------------------------------------------------------------------------
12:05:33 12:05:33.540 INFO: EXECUTION FAILURE
12:05:33 12:05:33.540 INFO: ------------------------------------------------------------------------
12:05:33 12:05:33.540 INFO: Total time: 1:25.012s
12:05:33 12:05:33.618 INFO: Final Memory: 50M/99M
12:05:33 12:05:33.618 INFO: ------------------------------------------------------------------------
12:05:33 12:05:33.618 ERROR: Error during SonarQube Scanner execution
12:05:33 java.lang.IllegalStateException: Unable to load component class org.sonar.scanner.report.MetadataPublisher
12:05:33 at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:64)
12:05:33 at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:621)
12:05:33 at org.picocontainer.parameters.CollectionComponentParameter.getArrayInstance(CollectionComponentParameter.java:334)
12:05:33 at org.picocontainer.parameters.CollectionComponentParameter.access$100(CollectionComponentParameter.java:49)
12:05:33 at org.picocontainer.parameters.CollectionComponentParameter$1.resolveInstance(CollectionComponentParameter.java:139)
12:05:33 at org.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:141)
12:05:33 at org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78)
12:05:33 at org.picocontainer.injectors.ConstructorInjector$CtorAndAdapters.getParameterArguments(ConstructorInjector.java:309)
12:05:33 at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:335)
12:05:33 at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
12:05:33 at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)
12:05:33 at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)
12:05:33 at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)
12:05:33 at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)
12:05:33 at org.picocontainer.DefaultPicoContainer.instantiateComponentAsIsStartable(DefaultPicoContainer.java:1034)
12:05:33 at org.picocontainer.DefaultPicoContainer.addAdapterIfStartable(DefaultPicoContainer.java:1026)
12:05:33 at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1003)
12:05:33 at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:767)
12:05:33 at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:134)
12:05:33 at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:121)
12:05:33 at org.sonar.scanner.task.ScanTask.execute(ScanTask.java:48)
12:05:33 at org.sonar.scanner.task.TaskContainer.doAfterStart(TaskContainer.java:84)
12:05:33 at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
12:05:33 at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:121)
12:05:33 at org.sonar.scanner.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:121)
12:05:33 at org.sonar.batch.bootstrapper.Batch.doExecuteTask(Batch.java:116)
12:05:33 at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:111)
12:05:33 at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:63)
12:05:33 at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
12:05:33 at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
12:05:33 at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
12:05:33 at java.base/java.lang.reflect.Method.invoke(Method.java:564)
12:05:33 at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
12:05:33 at com.sun.proxy.$Proxy0.execute(Unknown Source)
12:05:33 at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:233)
12:05:33 at org.sonarsource.scanner.api.EmbeddedScanner.runAnalysis(EmbeddedScanner.java:151)
12:05:33 at org.sonarsource.scanner.cli.Main.runAnalysis(Main.java:123)
12:05:33 at org.sonarsource.scanner.cli.Main.execute(Main.java:77)
12:05:33 at org.sonarsource.scanner.cli.Main.main(Main.java:61)
12:05:33 Caused by: java.lang.IllegalStateException: Unable to load component class org.sonar.scanner.rule.ModuleQProfiles
12:05:33 at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:64)
12:05:33 at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:632)
12:05:33 at org.picocontainer.parameters.BasicComponentParameter$1.resolveInstance(BasicComponentParameter.java:118)
12:05:33 at org.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:136)
12:05:33 at org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78)
12:05:33 at org.picocontainer.injectors.ConstructorInjector$CtorAndAdapters.getParameterArguments(ConstructorInjector.java:309)
12:05:33 at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:335)
12:05:33 at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
12:05:33 at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)
12:05:33 at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)
12:05:33 at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)
12:05:33 at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)
12:05:33 at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699)
12:05:33 at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647)
12:05:33 at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:62)
12:05:33 ... 38 more
12:05:33 Caused by: java.lang.IllegalStateException: Fail to request http://sonarqube:9000/api/qualityprofiles/search.protobuf?projectKey=CCGeneral
12:05:33 at org.sonarqube.ws.client.HttpConnector.doCall(HttpConnector.java:190)
12:05:33 at org.sonarqube.ws.client.HttpConnector.get(HttpConnector.java:124)
12:05:33 at org.sonarqube.ws.client.HttpConnector.call(HttpConnector.java:111)
12:05:33 at org.sonar.scanner.bootstrap.ScannerWsClient.call(ScannerWsClient.java:73)
12:05:33 at org.sonar.scanner.repository.DefaultQualityProfileLoader.call(DefaultQualityProfileLoader.java:90)
12:05:33 at org.sonar.scanner.repository.DefaultQualityProfileLoader.loadAndOverrideIfNeeded(DefaultQualityProfileLoader.java:69)
12:05:33 at org.sonar.scanner.repository.DefaultQualityProfileLoader.load(DefaultQualityProfileLoader.java:64)
12:05:33 at org.sonar.scanner.repository.QualityProfileProvider.provide(QualityProfileProvider.java:45)
12:05:33 at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
12:05:33 at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
12:05:33 at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
12:05:33 at java.base/java.lang.reflect.Method.invoke(Method.java:564)
12:05:33 at org.picocontainer.injectors.MethodInjector.invokeMethod(MethodInjector.java:129)
12:05:33 at org.picocontainer.injectors.MethodInjector.access$000(MethodInjector.java:39)
12:05:33 at org.picocontainer.injectors.MethodInjector$2.run(MethodInjector.java:113)
12:05:33 at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
12:05:33 at org.picocontainer.injectors.MethodInjector.decorateComponentInstance(MethodInjector.java:120)
12:05:33 at org.picocontainer.injectors.CompositeInjector.decorateComponentInstance(CompositeInjector.java:58)
12:05:33 at org.picocontainer.injectors.Reinjector.reinject(Reinjector.java:142)
12:05:33 at org.picocontainer.injectors.ProviderAdapter.getComponentInstance(ProviderAdapter.java:96)
12:05:33 at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699)
12:05:33 at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647)
12:05:33 at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:62)
12:05:33 12:05:33.649 DEBUG: Execution getVersion
12:05:33 12:05:33.649 DEBUG: Execution stop
12:05:33 ... 52 more
12:05:33 Caused by: java.net.SocketTimeoutException: timeout
12:05:33 at okio.Okio$4.newTimeoutException(Okio.java:227)
12:05:33 at okio.AsyncTimeout.exit(AsyncTimeout.java:284)
12:05:33 at okio.AsyncTimeout$2.read(AsyncTimeout.java:240)
12:05:33 at okio.RealBufferedSource.indexOf(RealBufferedSource.java:344)
12:05:33 at okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:216)
12:05:33 at okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:210)
12:05:33 at okhttp3.internal.http1.Http1Codec.readResponseHeaders(Http1Codec.java:189)
12:05:33 at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.java:75)
12:05:33 at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
12:05:33 at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
12:05:33 at org.sonarqube.ws.client.OkHttpClientBuilder.addHeaders(OkHttpClientBuilder.java:207)
12:05:33 at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
12:05:33 at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:45)
12:05:33 at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
12:05:33 at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
12:05:33 at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)
12:05:33 at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
12:05:33 at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
12:05:33 at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
12:05:33 at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
12:05:33 at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:120)
12:05:33 at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
12:05:33 at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
12:05:33 at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:185)
12:05:33 at okhttp3.RealCall.execute(RealCall.java:69)
12:05:33 at org.sonarqube.ws.client.HttpConnector.doCall(HttpConnector.java:188)
12:05:33 ... 74 more
12:05:33 Caused by: java.net.SocketTimeoutException: Read timed out
12:05:33 at java.base/java.net.SocketInputStream.socketRead0(Native Method)
12:05:33 at java.base/java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
12:05:33 at java.base/java.net.SocketInputStream.read(SocketInputStream.java:171)
12:05:33 at java.base/java.net.SocketInputStream.read(SocketInputStream.java:141)
12:05:33 at okio.Okio$2.read(Okio.java:138)
12:05:33 at okio.AsyncTimeout$2.read(AsyncTimeout.java:236)
12:05:33 ... 97 more
12:05:33 12:05:33.649 ERROR:
12:05:33 12:05:33.649 ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
12:05:34 Process returned exit code 1
12:05:34 The SonarQube Scanner did not complete successfully
12:05:34 12:05:34.402 Creating a summary markdown file...
12:05:34 12:05:34.402 Post-processing failed. Exit code: 1
12:05:34 ERROR: Execution of SonarQube Scanner for MSBuild failed (exit code 1)
12:05:34 Finished: FAILURE
答案 0 :(得分:0)
似乎我的问题似乎源于Jenkins服务器上缺少磁盘空间。我通过清除一些旧的/未使用的工作空间释放了一些磁盘,并且该作业自那以后成功运行了几次。