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

Computation fails to clean report queue after SonarQube upgrade

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.1.1
    • Fix Version/s: 5.2
    • Component/s: Compute Engine
    • Labels:
      None

      Description

      After an upgrade, computation start up and report queue cleaning needs to get synchronized to prevent such error:

      2015.08.31 16:46:18 ERROR web[o.s.s.ui.JRubyFacade] Fail to upgrade database
      
      ### Error updating database.  Cause: java.sql.SQLException: Can't execute the given command because you have active locked tables or an active transaction
      ### The error may involve defaultParameterMap
      ### The error occurred while setting parameters
      ### SQL: truncate table analysis_reports
      ### Cause: java.sql.SQLException: Can't execute the given command because you have active locked tables or an active transaction
      	org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:26)
      	org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:154)
      	org.apache.ibatis.session.defaults.DefaultSqlSession.delete(DefaultSqlSession.java:165)
      	org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:57)
      	org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:52)
      	com.sun.proxy.$Proxy100.truncate(Unknown Source)
      	org.sonar.server.computation.db.AnalysisReportDao.truncate(AnalysisReportDao.java:57)
      	org.sonar.server.computation.ReportQueue.clear(ReportQueue.java:148)
      	org.sonar.server.computation.ReportQueueCleaner.start(ReportQueueCleaner.java:48)
      	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      	sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      	java.lang.reflect.Method.invoke(Unknown Source)
      	org.picocontainer.lifecycle.ReflectionLifecycleStrategy.invokeMethod(ReflectionLifecycleStrategy.java:110)
      	org.picocontainer.lifecycle.ReflectionLifecycleStrategy.start(ReflectionLifecycleStrategy.java:89)
      	org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.start(AbstractInjectionFactory.java:84)
      	org.picocontainer.behaviors.AbstractBehavior.start(AbstractBehavior.java:169)
      	org.picocontainer.behaviors.Stored$RealComponentLifecycle.start(Stored.java:132)
      	org.picocontainer.behaviors.Stored.start(Stored.java:110)
      	org.picocontainer.DefaultPicoContainer.potentiallyStartAdapter(DefaultPicoContainer.java:1015)
      	org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1008)
      	org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:766)
      	org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:91)
      	org.sonar.server.platform.ServerComponents$1.doPrivileged(ServerComponents.java:851)
      	org.sonar.server.user.DoPrivileged.execute(DoPrivileged.java:43)
      	org.sonar.server.platform.ServerComponents.executeStartupTasks(ServerComponents.java:847)
      	org.sonar.server.platform.Platform.executeStartupTasks(Platform.java:126)
      	org.sonar.server.platform.Platform.startLevel34Containers(Platform.java:122)
      	org.sonar.server.platform.Platform.doStart(Platform.java:81)
      	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      	sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      	java.lang.reflect.Method.invoke(Unknown Source)
      	org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(JavaMethod.java:440)
      	org.jruby.javasupport.JavaMethod.invokeDirect(JavaMethod.java:304)
      	org.jruby.java.invokers.InstanceMethodInvoker.call(InstanceMethodInvoker.java:52)
      	org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:306)
      	org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:136)
      	org.jruby.ast.CallNoArgNode.interpret(CallNoArgNode.java:60)
      	org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
      	org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
      	org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:74)
      	org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:139)
      	org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:182)
      	org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:306)
      	org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:136)
      	org.jruby.ast.CallNoArgNode.interpret(CallNoArgNode.java:60)
      	org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
      	org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
      	org.jruby.ast.RescueNode.executeBody(RescueNode.java:221)
      	org.jruby.ast.RescueNode.interpret(RescueNode.java:116)
      	org.jruby.ast.BeginNode.interpret(BeginNode.java:83)
      	org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
      	org.jruby.evaluator.ASTInterpreter.INTERPRET_BLOCK(ASTInterpreter.java:112)
      	org.jruby.runtime.InterpretedBlock.evalBlockBody(InterpretedBlock.java:384)
      	org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:336)
      	org.jruby.runtime.BlockBody.call(BlockBody.java:73)
      	org.jruby.runtime.Block.call(Block.java:101)
      	org.jruby.RubyProc.call(RubyProc.java:290)
      	org.jruby.RubyProc.call(RubyProc.java:228)
      	org.jruby.internal.runtime.RubyRunnable.run(RubyRunnable.java:97)
      	java.lang.Thread.run(Unknown Source)
      

        Attachments

          Activity

            People

            • Assignee:
              simon.brandhof Simon Brandhof
              Reporter:
              jean-denis.coffre Jean-Denis Coffre
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: