I recently upgraded to 5.2 Some of my jenkins process can not run SonarQube analysis (may be it failed with previous versions ?)
After running with debug mode, the stack trace is the following :
[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.7.1:sonar (default-cli) on project myclient-extractor:
Fail to execute request [code=500,url=http:// www.dev.jouvinio.net/sonar/batch/project.protobuf?key=net.jouvinio.myclient%3Amyclient-extractor]:
Fail to download [http:// www.dev.jouvinio.net/sonar/batch/project.protobuf?key=net.jouvinio.myclient%3Amyclient-extractor].
Response code: 500 - [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.7.1:sonar (default-cli) on project myclient-extractor:
Fail to execute request [code=500, url=http:// www.dev.jouvinio.net/sonar/batch/project.protobuf?key=net.jouvinio.myclient%3Amyclient-extractor]
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
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:862)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
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 execute request [code=500,url=http:// www.dev.jouvinio.net/sonar/batch/project.protobuf?key=net.jouvinio.myclient%3Amyclient-extractor]
at org.codehaus.mojo.sonar.bootstrap.ExceptionHandling.handle(ExceptionHandling.java:41)
at org.codehaus.mojo.sonar.bootstrap.RunnerBootstrapper.execute(RunnerBootstrapper.java:104)
at org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:135)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 20 more Caused by: java.lang.IllegalStateException:
Fail to execute request [code=500,url=http:// www.dev.jouvinio.net/sonar/batch/project.protobuf?key=net.jouvinio.myclient%3Amyclient-extractor]
at org.sonar.batch.bootstrap.ServerClient.handleHttpException(ServerClient.java:138)
at org.sonar.batch.bootstrap.ServerClient.load(ServerClient.java:121)
at org.sonar.batch.cache.WSLoader$3.load(WSLoader.java:86)
at org.sonar.batch.cache.WSLoader$3.load(WSLoader.java:83)
at org.sonar.batch.cache.WSLoader.loadFromServer(WSLoader.java:233)
at org.sonar.batch.cache.WSLoader.loadFromServerFirst(WSLoader.java:194)
at org.sonar.batch.cache.WSLoader.load(WSLoader.java:154)
at org.sonar.batch.cache.WSLoader.loadStream(WSLoader.java:130)
at org.sonar.batch.repository.DefaultProjectRepositoriesLoader.load(DefaultProjectRepositoriesLoader.java:57)
at org.sonar.batch.repository.ProjectRepositoriesProvider.provide(ProjectRepositoriesProvider.java:47)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.picocontainer.injectors.MethodInjector.invokeMethod(MethodInjector.java:129)
at org.picocontainer.injectors.MethodInjector.access$000(MethodInjector.java:39)
at org.picocontainer.injectors.MethodInjector$2.run(MethodInjector.java:113)
at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
at org.picocontainer.injectors.MethodInjector.decorateComponentInstance(MethodInjector.java:120)
at org.picocontainer.injectors.CompositeInjector.decorateComponentInstance(CompositeInjector.java:58)
at org.picocontainer.injectors.Reinjector.reinject(Reinjector.java:142)
at org.picocontainer.injectors.ProviderAdapter.getComponentInstance(ProviderAdapter.java:96)
at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699)
at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647)
at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:632)
at org.picocontainer.parameters.BasicComponentParameter$1.resolveInstance(BasicComponentParameter.java:118)
at org.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:136)
at org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78)
at org.picocontainer.injectors.ConstructorInjector$CtorAndAdapters.getParameterArguments(ConstructorInjector.java:309)
at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:335)
at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)
at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)
at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)
at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)
at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699)
at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647)
at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:678)
at org.sonar.core.platform.ComponentContainer.getComponentByType(ComponentContainer.java:230)
at org.sonar.batch.scan.ProjectScanContainer.doBeforeStart(ProjectScanContainer.java:120)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:98)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:85)
at org.sonar.batch.bootstrap.GlobalContainer.executeAnalysis(GlobalContainer.java:153)
at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:110)
at org.sonar.runner.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:55)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.sonar.runner.impl.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:61)
at com.sun.proxy.$Proxy23.execute(Unknown Source)
at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:275)
at org.sonar.runner.api.EmbeddedRunner.runAnalysis(EmbeddedRunner.java:166)
at org.sonar.runner.api.EmbeddedRunner.runAnalysis(EmbeddedRunner.java:153)
at org.codehaus.mojo.sonar.bootstrap.RunnerBootstrapper.execute(RunnerBootstrapper.java:99)
... 23 more Caused by: org.sonar.api.utils.HttpDownloader$HttpException:
Fail to download [http:// www.dev.jouvinio.net/sonar/batch/project.protobuf?key=net.jouvinio.myclient%3Amyclient-extractor].
Response code: 500
at org.sonar.core.util.DefaultHttpDownloader$BaseHttpDownloader$HttpInputSupplier.getInput(DefaultHttpDownloader.java:343)
at org.sonar.core.util.DefaultHttpDownloader$BaseHttpDownloader$HttpInputSupplier.getInput(DefaultHttpDownloader.java:288)
at org.sonar.batch.bootstrap.ServerClient.load(ServerClient.java:117)
... 76 more
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http:// cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Build step 'Invoquer les cibles Maven de haut niveau' marked build as
failure Started calculate disk usage of build Finished Calculation of
disk usage of build in 0 seconds Started calculate disk usage of
workspace Finished Calculation of disk usage of workspace in 0 seconds
Finished: FAILURE
The SonarQube trace is the following
2015.11.16 00:21:29 INFO web[o.s.s.c.t.CeWorkerRunnableImpl] Execute task | project=com.socgen.scad:batches | id=AVENdAv0hAxh5yDyBUwV
2015.11.16 00:22:08 WARN es[o.e.monitor.jvm] [sonar-1447592960153] [gc][young][36740][10] duration [1.9s], collections [1]/[2s],
total [1.9s]/[4.9s], memory [168.8mb]->[36.4mb]/[1007.3mb], all_pools {[young] [132.1mb]->[555kb]/[133.1mb]}
{[survivor] [6mb]->[4.3mb]/[16.6mb]}{[old] [30.7mb]->[31.5mb]/[857.6mb]}
2015.11.16 00:22:12 INFO web[o.s.s.c.t.CeWorkerRunnableImpl] Executed task | project=com.socgen.scad:batches | id=AVENdAv0hAxh5yDyBUwV | time=42346ms
2015.11.16 00:25:33 INFO web[o.s.s.c.t.CeWorkerRunnableImpl] Execute task | project=com.socgen.scad:batches | id=AVENd8hmhAxh5yDyBU9w
2015.11.16 00:25:43 INFO web[o.s.s.c.t.CeWorkerRunnableImpl] Executed task | project=com.socgen.scad:batches | id=AVENd8hmhAxh5yDyBU9w | time=9854ms
2015.11.16 00:46:35 INFO es[o.e.monitor.jvm] [sonar-1447592960153] [gc][young][38206][11] duration [921ms], collections [1]/[1.1s],
total [921ms]/[5.8s], memory [168.7mb]->[38.4mb]/[1007.3mb], all_pools {[young] [132.8mb]->[421.7kb]/[133.1mb]}
{[survivor][4.3mb]->[6.5mb]/[16.6mb]}{[old] [31.5mb]->[31.5mb]/[857.6mb]}
2015.11.16 00:47:40 INFO web[o.s.s.c.t.CeWorkerRunnableImpl] Execute task | project=com.socgen.scad:batches | id=AVENjAIghAxh5yDyBU90
2015.11.16 00:47:57 INFO web[o.s.s.c.t.CeWorkerRunnableImpl] Executed task | project=com.socgen.scad:batches | id=AVENjAIghAxh5yDyBU90 | time=17409ms
2015.11.16 01:14:57 ERROR web[o.s.s.w.WebServiceEngine] Fail to process request
http://www.dev.jouvinio.net/sonar/batch/project.protobuf?key=net.jouvinio.myclient%3Amyclient-extractor
java.lang.NullPointerException: null at com.google.protobuf.Utf8.encodedLength(Utf8.java:378)
~[protobuf-java-3.0.0-beta-1.jar:na] at com.google.protobuf.CodedOutputStream.computeStringSizeNoTag(CodedOutputStream.java:911)
~[protobuf-java-3.0.0-beta-1.jar:na] at com.google.protobuf.FieldSet.computeElementSizeNoTag(FieldSet.java:834)
~[protobuf-java-3.0.0-beta-1.jar:na] at com.google.protobuf.MapEntryLite.getFieldSize(MapEntryLite.java:143)
~[protobuf-java-3.0.0-beta-1.jar:na] at com.google.protobuf.MapEntryLite.getSerializedSize(MapEntryLite.java:135)
~[protobuf-java-3.0.0-beta-1.jar:na] at com.google.protobuf.MapEntry.getSerializedSize(MapEntry.java:120)
~[protobuf-java-3.0.0-beta-1.jar:na] at com.google.protobuf.CodedOutputStream.computeMessageSizeNoTag(CodedOutputStream.java:947)
~[protobuf-java-3.0.0-beta-1.jar:na] at com.google.protobuf.CodedOutputStream.computeMessageSize(CodedOutputStream.java:707)
~[protobuf-java-3.0.0-beta-1.jar:na] at org.sonarqube.ws.WsBatch$WsProjectResponse$FileDataByPath.getSerializedSize(WsBatch.java:783)
Other projets can be analyzed. The only thing I can see, is the fact that the artifact name contains the caracter minus, and the project key is something like this : net.jouvinio.myclient:myclient-extractor
It also appends on multi module project, and when a sub module contains this caracter.
EDIT on 19th november : Problem seems to not be link to project name with - I deleted one project in SonarQube and reload analysis. It works fine. Invest in progress.
You are probably experiencing this bug: https://jira.sonarsource.com/browse/SONAR-7008
For the time being I would recommend try changing the project key.
来源:https://stackoverflow.com/questions/33727042/failed-to-run-analysis-sonarqube-5-2-from-jenkins-with-specific-artifact-name