Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to execute goal... code=500

I have upgraded to SonarQube 5.2 and when I try to run the analysis, I get the error below. If I try to browse to the URL in the error message I get a page with {"errors":[{"msg":""}]}. I am using sonar-maven-plugin 2.7.1 (from org.codehaus.mojo). On another thread, it was suggested to check on Sonar if the project was actually a project and not a module. I have checked that. Sonar's log shows:

127.0.0.1 - - [12/Nov/2015:12:07:56 +0000] "GET /batch_bootstrap/index HTTP/1.1" 400 49 "-" "Maven/3.0.5"

I am running on MS SQL Server 2008 R2.

NOTE: When I switch to the built in Db (h2), empty, I don't get the error (but I haven't actually tried an empty MS SQL Server). Any idea of what may be wrong? Thanks.

[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.7.1:sonar (default-cli) on project infra: Fail to execute request [cod
e=500, url=<...>/batch/project.protobuf?key=com.<XXXXXXX>.SOMETHING%3ASOMETHING]: Fail to download [<...>/batch/project.protobuf?key=<XXXXXXX>.SOMETHING%3ASOMETHING]. 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 infra: Fail to execute request [code=500, url=<...>/batch/project.protobuf?key=<XXXXXXX>.SOMETHING%3ASOMETHING]
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
        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:84)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
        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:483)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoExecutionException: Fail to execute request [code=500, url=...]
        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:101)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
        ... 19 more
Caused by: java.lang.IllegalStateException: Fail to execute request [code=500, url=...]
        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:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:483)
        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:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:483)
        at org.sonar.runner.impl.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:61)
        at com.sun.proxy.$Proxy16.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)
        ... 22 more
Caused by: org.sonar.api.utils.HttpDownloader$HttpException: Fail to download [...]. 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:115)
        ... 75 more
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] h t t p : //cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
C:\Users\mmilone\source\integration\infra>
like image 679
mmilone Avatar asked Nov 09 '22 01:11

mmilone


1 Answers

I found two working solutions to this problem and another potential future solution

  1. Analyse as a new project by either

    • Changing the project key like so
      -Dsonar.projectKey=com.<XXXXXXX>.SOMETHINGSOMETHING
    • or removing the existing project, effectively losing your existing SonarQube history :-(
  2. If you upgraded from SonarQube version 3.x via 4.5.2 LTS to 5.2 and still have a backup from 3 or 4, you might revert to your old version and make sure to run an analyses on each of your projects on version 4 LTS before continuing the upgrade path to version 5.2.

  3. As this seems to be a bug in SonarQube 5.2 fixed in version 5.3 - just wait for the release of SonarQube 5.3 scheduled to be released in January 2016.

like image 149
schnatterer Avatar answered Jan 04 '23 03:01

schnatterer