Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-4057

(patch) URISyntaxException if branch name contains incorrect symbols

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.4.1
    • Fix Version/s: 3.6
    • Component/s: None
    • Labels:

      Description

      Our CI server produces branch name <default> for git master branch. That causes maven plugin to fail with next stack trace

      [ERROR] Failed to execute goal org.codehaus.sonar:sonar-maven3-plugin:3.4.1:sonar (default-cli) on project omnitrack-environment: Execution default-cli of goal org.codehaus.sonar:sonar-maven3-plugin:3.4.1:sonar failed: Illegal character in query at index 99: http://localhost:9000/sonar/batch_bootstrap/properties?project=sev.omnitrack:omnitrack-environment:<default> -> [Help 1]
      org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.sonar:sonar-maven3-plugin:3.4.1:sonar (default-cli) on project omnitrack-environment: Execution default-cli of goal org.codehaus.sonar:sonar-maven3-plugin:3.4.1:sonar failed: Illegal character in query at index 99: http://localhost:9000/sonar/batch_bootstrap/properties?project=sev.omnitrack:omnitrack-environment:<default>
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:225)
      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:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:601)
      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.PluginExecutionException: Execution default-cli of goal org.codehaus.sonar:sonar-maven3-plugin:3.4.1:sonar failed: Illegal character in query at index 99: http://localhost:9000/sonar/batch_bootstrap/properties?project=sev.omnitrack:omnitrack-environment:<default>
      at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:110)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
      ... 19 more
      Caused by: java.lang.IllegalArgumentException: Illegal character in query at index 99: http://localhost:9000/sonar/batch_bootstrap/properties?project=sev.omnitrack:omnitrack-environment:<default>
      at java.net.URI.create(URI.java:859)
      at org.sonar.batch.bootstrap.ServerClient.doRequest(ServerClient.java:81)
      at org.sonar.batch.bootstrap.ServerClient.request(ServerClient.java:68)
      at org.sonar.batch.bootstrap.BatchSettings.downloadSettings(BatchSettings.java:74)
      at org.sonar.batch.bootstrap.BatchSettings.init(BatchSettings.java:64)
      at org.sonar.batch.bootstrap.BatchSettings.<init>(BatchSettings.java:49)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
      at org.picocontainer.injectors.AbstractInjector.newInstance(AbstractInjector.java:147)
      at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:348)
      at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:272)
      at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:370)
      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:692)
      at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:646)
      at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:632)
      at org.picocontainer.parameters.BasicComponentParameter$1.resolveInstance(BasicComponentParameter.java:105)
      at org.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:136)
      at org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:75)
      at org.picocontainer.injectors.ConstructorInjector$CtorAndAdapters.getParameterArguments(ConstructorInjector.java:315)
      at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:341)
      at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:272)
      at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:370)
      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.instantiateComponentAsIsStartable(DefaultPicoContainer.java:1027)
      at org.picocontainer.DefaultPicoContainer.addAdapterIfStartable(DefaultPicoContainer.java:1019)
      at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:996)
      at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:760)
      at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:72)
      at org.sonar.batch.bootstrap.Module.start(Module.java:67)
      at org.sonar.batch.bootstrapper.Batch.startBatch(Batch.java:75)
      at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:60)
      at org.sonar.maven3.SonarMojo.execute(SonarMojo.java:142)
      at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
      ... 20 more
      Caused by: java.net.URISyntaxException: Illegal character in query at index 99: http://localhost:9000/sonar/batch_bootstrap/properties?project=sev.omnitrack:omnitrack-environment:<default>
      at java.net.URI$Parser.fail(URI.java:2829)
      at java.net.URI$Parser.checkChars(URI.java:3002)
      at java.net.URI$Parser.parseHierarchical(URI.java:3092)
      at java.net.URI$Parser.parse(URI.java:3034)
      at java.net.URI.<init>(URI.java:595)
      at java.net.URI.create(URI.java:857)
      ... 59 more

      Quick and dirty BatchSettings patch attached.

      Seems there is more accurate ServerClient methods modification needed to eliminate such problems.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              freddy.mallet Freddy Mallet (Inactive)
              Reporter:
              ketoth.xupack Ketoth Xupack
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: