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

Improve log when FILE_SOURCES.BINARY_DATA can't be unserialized

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.1.2
    • Fix Version/s: 5.6
    • Component/s: Compute Engine
    • Labels:

      Description

      I am facing the following issue while upgrading to SonarQube 5.1.2:

      2015.11.04 12:07:20 INFO  web[o.s.s.s.IndexSynchronizer] Index source lines
      2015.11.04 12:08:20 INFO  web[o.s.s.es.BulkIndexer] 247449 requests processed (4124 items/sec)
      2015.11.04 12:09:20 INFO  web[o.s.s.es.BulkIndexer] 534032 requests processed (4776 items/sec)
      2015.11.04 12:10:20 INFO  web[o.s.s.es.BulkIndexer] 838260 requests processed (5070 items/sec)
      2015.11.04 12:11:20 INFO  web[o.s.s.es.BulkIndexer] 1047236 requests processed (3482 items/sec)
      2015.11.04 12:12:20 INFO  web[o.s.s.es.BulkIndexer] 1320034 requests processed (4546 items/sec)
      2015.11.04 12:13:20 INFO  web[o.s.s.es.BulkIndexer] 1427011 requests processed (1782 items/sec)
      2015.11.04 12:14:20 INFO  web[o.s.s.es.BulkIndexer] 1673415 requests processed (4106 items/sec)
      2015.11.04 12:15:20 INFO  web[o.s.s.es.BulkIndexer] 1939061 requests processed (4427 items/sec)
      2015.11.04 12:16:20 INFO  web[o.s.s.es.BulkIndexer] 2215164 requests processed (4601 items/sec)
      2015.11.04 12:17:20 INFO  web[o.s.s.es.BulkIndexer] 2417908 requests processed (3379 items/sec)
      2015.11.04 12:18:20 INFO  web[o.s.s.es.BulkIndexer] 2674606 requests processed (4278 items/sec)
      2015.11.04 12:18:39 ERROR web[o.s.s.ui.JRubyFacade] Fail to upgrade database
      java.util.concurrent.ExecutionException: java.lang.IllegalStateException: Fail to decompress and deserialize source data
      	com.google.common.base.Throwables.propagate(Throwables.java:156)
      	org.sonar.server.es.BaseIndexer.index(BaseIndexer.java:77)
      	org.sonar.server.search.IndexSynchronizer.execute(IndexSynchronizer.java:90)
      	org.sonar.server.platform.ServerComponents$1.doPrivileged(ServerComponents.java:852)
      	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(NativeMethodAccessorImpl.java:62)
      	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	java.lang.reflect.Method.invoke(Method.java:497)
      	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(Thread.java:745)
      

      As the source line index is dropped in 5.2, this exact error won't occur anymore. Nevertheless reading the data from FILE_SOURCES is still used in some other places. If an error occurs again, then the ID/key of the row should be logged to help investigating the incorrect data.
      See https://github.com/SonarSource/sonarqube/blob/master/sonar-db/src/main/java/org/sonar/db/source/FileSourceDto.java#L104-104

        Attachments

          Activity

            People

            Assignee:
            sebastien.lesaint Sebastien Lesaint
            Reporter:
            jean-denis.coffre Jean-Denis Coffre
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Due:
              Created:
              Updated:
              Resolved: