SonarQube Plugins
  1. SonarQube Plugins
  2. SONARPLUGINS-1308

SCM Activity Plugin doesn't work after having changed our SCM

    Details

    • Number of attachments :
      0

      Description

      Hi,

      We are migrating several of our projects from SVN to GIT.
      We moved our source code, updated our Maven SCM details and reconfigured our CI server, everything is fine, .... except for Sonar.
      Jobs are broken after this error :

      [INFO]  Sensor ScmActivitySensor...
      [INFO]  Check for local modifications...
      [INFO]  	Executing: /bin/sh -c cd /home/swfhudson/data/jobs/cloud-management-develop-sonar/workspace/sources/cloud-services-common/src/main/java && git status
      [INFO]  	Working directory: /home/swfhudson/data/jobs/cloud-management-develop-sonar/workspace/sources/cloud-services-common/src/main/java
      [INFO]  	Executing: /bin/sh -c cd /home/swfhudson/data/jobs/cloud-management-develop-sonar/workspace/sources/cloud-services-common/src/test/java && git status
      [INFO]  	Working directory: /home/swfhudson/data/jobs/cloud-management-develop-sonar/workspace/sources/cloud-services-common/src/test/java
      [INFO]  Check for local modifications done: 2521 ms
      [INFO]  Retrieve changelog from revision 35243...
      [INFO]  	Executing: /bin/sh -c cd /home/swfhudson/data/jobs/cloud-management-develop-sonar/workspace/sources/cloud-services-common && git whatchanged --date=iso 35243.. -- /home/swfhudson/data/jobs/cloud-management-develop-sonar/workspace/sources/cloud-services-common
      [ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.0-beta-2:sonar (default-cli) on project cloud-management-parent: Can not execute Sonar: Unable to retrieve changelog: fatal: bad revision '35243..' -> [Help 1]
      org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.0-beta-2:sonar (default-cli) on project cloud-management-parent: Can not execute Sonar
      	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:319)
      	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:39)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:597)
      	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: Can not execute Sonar
      	at org.codehaus.mojo.sonar.Bootstraper.executeMojo(Bootstraper.java:118)
      	at org.codehaus.mojo.sonar.Bootstraper.start(Bootstraper.java:65)
      	at org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:90)
      	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: org.sonar.api.utils.SonarException: Unable to retrieve changelog: fatal: bad revision '35243..'
      
      	at org.sonar.plugins.scmactivity.Changelog.retrieveChangeSets(Changelog.java:105)
      	at org.sonar.plugins.scmactivity.Changelog.load(Changelog.java:55)
      	at org.sonar.plugins.scmactivity.ScmActivitySensor.analyse(ScmActivitySensor.java:83)
      	at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:63)
      	at org.sonar.batch.phases.Phases.execute(Phases.java:93)
      	at org.sonar.batch.bootstrap.ProjectModule.doStart(ProjectModule.java:145)
      	at org.sonar.batch.bootstrap.Module.start(Module.java:89)
      	at org.sonar.batch.bootstrap.BatchModule.analyze(BatchModule.java:106)
      	at org.sonar.batch.bootstrap.BatchModule.analyze(BatchModule.java:101)
      	at org.sonar.batch.bootstrap.BatchModule.doStart(BatchModule.java:96)
      	at org.sonar.batch.bootstrap.Module.start(Module.java:89)
      	at org.sonar.batch.bootstrap.BootstrapModule.doStart(BootstrapModule.java:96)
      	at org.sonar.batch.bootstrap.Module.start(Module.java:89)
      	at org.sonar.batch.Batch.execute(Batch.java:74)
      	at org.sonar.maven3.SonarMojo.executeBatch(SonarMojo.java:147)
      	at org.sonar.maven3.SonarMojo.execute(SonarMojo.java:136)
      	at org.codehaus.mojo.sonar.Bootstraper.executeMojo(Bootstraper.java:113)
      	... 23 more
      

      It seems that the ScmActivitySensor tries to check what changed between its current git local copy and the latest SVN revision it stored somewhere.
      I don't know which behavior it should take. Perhaps it should operate like if we just activated the plugin for a first time on the project. But in all case it should break the build.

      Thx.

        Activity

        Hide
        Arnaud Heritier added a comment -

        I suppose that a workaround is to deactivate the plugin .... But if you have better to propose before I do it ...

        Show
        Arnaud Heritier added a comment - I suppose that a workaround is to deactivate the plugin .... But if you have better to propose before I do it ...
        Hide
        Olivier Gaudin added a comment -

        If you deactivate, run an analysis and reactivate it should work with the new SCM

        Show
        Olivier Gaudin added a comment - If you deactivate, run an analysis and reactivate it should work with the new SCM
        Hide
        Arnaud Heritier added a comment -

        I forgot to confirm that the proposed workaround is working.

        Show
        Arnaud Heritier added a comment - I forgot to confirm that the proposed workaround is working.
        Hide
        Evgeny Mandrikov added a comment -

        Thanks for info - glad to know that proposed workaround works fine! However indeed - this case should be handled by plugin automatically.

        Show
        Evgeny Mandrikov added a comment - Thanks for info - glad to know that proposed workaround works fine! However indeed - this case should be handled by plugin automatically.
        Hide
        Freddy Mallet added a comment -

        David, if my understanding is correct this bug/limitation doesn't exist anymore due to SONARPLUGINS-1871.

        Show
        Freddy Mallet added a comment - David, if my understanding is correct this bug/limitation doesn't exist anymore due to SONARPLUGINS-1871 .
        Hide
        David Gageot added a comment -

        Yes Freddy

        Show
        David Gageot added a comment - Yes Freddy

          People

          • Assignee:
            David Gageot
            Reporter:
            Arnaud Heritier
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: