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

If a characteristic has been removed, server fails to start

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 4.1
    • Fix Version/s: 4.3
    • Component/s: None
    • Labels:
      None

      Description

      To reproduce:

      • install the SQALE plugin and remove the "Readability" characteristic
      • restart the server, you get:
      2014.03.13 15:01:20 INFO  [o.s.s.s.RegisterTechnicalDebtModel]  Register Technical Debt Model...
      2014.03.13 15:01:21 ERROR [o.s.s.p.PlatformLifecycleListener]  Fail to start server
      java.util.NoSuchElementException: null
      	at com.google.common.collect.AbstractIterator.next(AbstractIterator.java:152) ~[guava-10.0.1.jar:na]
      	at com.google.common.collect.Iterators.find(Iterators.java:715) ~[guava-10.0.1.jar:na]
      	at com.google.common.collect.Iterables.find(Iterables.java:638) ~[guava-10.0.1.jar:na]
      	at org.sonar.core.technicaldebt.TechnicalDebtModelSynchronizer.findCharacteristic(TechnicalDebtModelSynchronizer.java:173) ~[sonar-core-4.1.2.jar:na]
      	at org.sonar.core.technicaldebt.TechnicalDebtModelSynchronizer.mergePlugin(TechnicalDebtModelSynchronizer.java:126) ~[sonar-core-4.1.2.jar:na]
      	at org.sonar.core.technicaldebt.TechnicalDebtModelSynchronizer.mergePlugins(TechnicalDebtModelSynchronizer.java:116) ~[sonar-core-4.1.2.jar:na]
      	at org.sonar.core.technicaldebt.TechnicalDebtModelSynchronizer.synchronize(TechnicalDebtModelSynchronizer.java:78) ~[sonar-core-4.1.2.jar:na]
      	at org.sonar.core.technicaldebt.TechnicalDebtModelSynchronizer.synchronize(TechnicalDebtModelSynchronizer.java:66) ~[sonar-core-4.1.2.jar:na]
      	at org.sonar.server.startup.RegisterTechnicalDebtModel.start(RegisterTechnicalDebtModel.java:48) ~[RegisterTechnicalDebtModel.class:na]
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_51]
      	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.7.0_51]
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.7.0_51]
      	at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.7.0_51]
      	at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.invokeMethod(ReflectionLifecycleStrategy.java:110) ~[picocontainer-2.14.3.jar:na]
      	at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.start(ReflectionLifecycleStrategy.java:89) ~[picocontainer-2.14.3.jar:na]
      	at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.start(AbstractInjectionFactory.java:84) ~[picocontainer-2.14.3.jar:na]
      	at org.picocontainer.behaviors.AbstractBehavior.start(AbstractBehavior.java:169) ~[picocontainer-2.14.3.jar:na]
      	at org.picocontainer.behaviors.Stored$RealComponentLifecycle.start(Stored.java:132) ~[picocontainer-2.14.3.jar:na]
      	at org.picocontainer.behaviors.Stored.start(Stored.java:110) ~[picocontainer-2.14.3.jar:na]
      	at org.picocontainer.DefaultPicoContainer.potentiallyStartAdapter(DefaultPicoContainer.java:1015) ~[picocontainer-2.14.3.jar:na]
      	at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1008) ~[picocontainer-2.14.3.jar:na]
      	at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:766) ~[picocontainer-2.14.3.jar:na]
      	at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:91) ~[sonar-plugin-api-4.1.2.jar:na]
      	at org.sonar.server.platform.Platform.executeStartupTasks(Platform.java:373) ~[Platform.class:na]
      	at org.sonar.server.platform.Platform.start(Platform.java:163) ~[Platform.class:na]
      	at org.sonar.server.platform.PlatformLifecycleListener.contextInitialized(PlatformLifecycleListener.java:54) ~[PlatformLifecycleListener.class:na]
      	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4939) [tomcat-embed-core-7.0.42.jar:7.0.42]
      	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5434) [tomcat-embed-core-7.0.42.jar:7.0.42]
      	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [tomcat-embed-core-7.0.42.jar:7.0.42]
      	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559) [tomcat-embed-core-7.0.42.jar:7.0.42]
      	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549) [tomcat-embed-core-7.0.42.jar:7.0.42]
      	at java.util.concurrent.FutureTask.run(Unknown Source) [na:1.7.0_51]
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.7.0_51]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.7.0_51]
      	at java.lang.Thread.run(Unknown Source) [na:1.7.0_51]
      

      The fix should make sure that:

      • the startup does not fail if a characteristic or sub-characteristic referenced by a rule has been removed
      • after such a removal, analyses must complete. Currently, you get:
      10:04:55 [INFO] [10:04:55.548] Loading technical debt model...
      10:04:55 [INFO] [10:04:55.570] Loading technical debt model done: 22 ms
      10:04:55 [INFO] [10:04:55.571] Loading rules...
      10:04:56 [ERROR] Characteristic id '13' on rule 'common-java:InsufficientCommentDensity' has not been found
      ...
      

        Attachments

          Activity

            People

            Assignee:
            julien.lancelot Julien Lancelot
            Reporter:
            fabemn OLD - Fabrice Bellingard
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Due:
              Created:
              Updated:
              Resolved: