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

Analysis fails after performing modification of versions in the project history

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 5.1.2
    • Fix Version/s: 5.2
    • Component/s: Activity
    • Labels:
      None

      Description

      Here is the error:

      10:53:04.717 INFO  - Sensor VersionEventsSensor
      INFO: ------------------------------------------------------------------------
      INFO: EXECUTION FAILURE
      INFO: ------------------------------------------------------------------------
      Total time: 10.159s
      Final Memory: 37M/552M
      INFO: ------------------------------------------------------------------------
      ERROR: Error during Sonar runner execution
      org.sonar.runner.impl.RunnerException: Unable to execute Sonar
      	at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91)
      	at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
      	at java.security.AccessController.doPrivileged(Native Method)
      	at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
      	at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
      	at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)
      	at org.sonar.runner.api.Runner.execute(Runner.java:100)
      	at org.sonar.runner.Main.executeTask(Main.java:70)
      	at org.sonar.runner.Main.execute(Main.java:59)
      	at org.sonar.runner.Main.main(Main.java:53)
      Caused by: java.lang.IllegalArgumentException: Removing a detached instance org.sonar.api.batch.Event#204
      	at org.hibernate.ejb.event.EJB3DeleteEventListener.performDetachedEntityDeletionCheck(EJB3DeleteEventListener.java:45)
      	at org.hibernate.event.def.DefaultDeleteEventListener.onDelete(DefaultDeleteEventListener.java:108)
      	at org.hibernate.event.def.DefaultDeleteEventListener.onDelete(DefaultDeleteEventListener.java:74)
      	at org.hibernate.impl.SessionImpl.fireDelete(SessionImpl.java:794)
      	at org.hibernate.impl.SessionImpl.delete(SessionImpl.java:772)
      	at org.hibernate.ejb.AbstractEntityManagerImpl.remove(AbstractEntityManagerImpl.java:253)
      	at org.sonar.jpa.session.JpaDatabaseSession.removeWithoutFlush(JpaDatabaseSession.java:161)
      	at org.sonar.batch.index.EventPersister.deleteEvent(EventPersister.java:48)
      	at org.sonar.batch.index.DefaultIndex.deleteEvent(DefaultIndex.java:459)
      	at org.sonar.batch.deprecated.DeprecatedSensorContext.deleteEvent(DeprecatedSensorContext.java:264)
      	at org.sonar.batch.scan.sensor.VersionEventsSensor.deleteDeprecatedEvents(VersionEventsSensor.java:61)
      	at org.sonar.batch.scan.sensor.VersionEventsSensor.analyse(VersionEventsSensor.java:51)
      	at org.sonar.batch.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:59)
      	at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:51)
      	at org.sonar.batch.phases.DatabaseModePhaseExecutor.execute(DatabaseModePhaseExecutor.java:120)
      	at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:264)
      	at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
      	at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
      	at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:235)
      	at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:230)
      	at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:220)
      	at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
      	at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
      	at org.sonar.batch.scan.ScanTask.scan(ScanTask.java:57)
      	at org.sonar.batch.scan.ScanTask.execute(ScanTask.java:45)
      	at org.sonar.batch.bootstrap.TaskContainer.doAfterStart(TaskContainer.java:135)
      	at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
      	at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
      	at org.sonar.batch.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:158)
      	at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:95)
      	at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:67)
      	at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:48)
      	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.BatchLauncher$1.delegateExecution(BatchLauncher.java:87)
      	... 9 more
      

      Here are the steps to reproduce:

      • run sonar-runner -Dsonar.projectVersion=1.0
      • run sonar-runner -Dsonar.projectVersion=2.0
      • in project history, delete the SNAPSHOT of the version 1.0
      • in project history, rename version "2.0" into "1.0"
      • run sonar-runner -Dsonar.projectVersion=1.0 -e

        Attachments

          Activity

            People

            • Assignee:
              teryk.bellahsene Teryk Bellahsene (Inactive)
              Reporter:
              jean-denis.coffre Jean-Denis Coffre
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Due:
                Created:
                Updated:
                Resolved: