SonarQube Plugins
  1. SonarQube Plugins
  2. SONARPLUGINS-1163

MantisSensor hangs at 'Connected to Mantis(1.2.5)'

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: MANTIS-0.2
    • Fix Version/s: MANTIS-0.3
    • Component/s: Mantis
    • Labels:
      None
    • Environment:
      Jenkins 1.411, Sonar 2.7
    • Number of attachments :
      0

      Description

      The Mantis plugin is unable to retrieve issues for a certain project. The Jenkins log snippet is

      [INFO]  Sensor MantisSensor...
      [WARN]  Unable to find required classes (javax.activation.DataHandler and javax.mail.internet.MimeMultipart). Attachment support is disabled.
      [INFO]  Connected to Mantis(1.2.5)
      

      Given that 192.168.90.72 is the Sonar/Jenkins server and 192.168.90.56 is the Mantis server, I see an established connection :

      netstat -ant | grep 90\.56
      tcp        0      0 192.168.90.72:38741     192.168.90.56:80        ESTABLISHED 
      

      In the Apache access log I see many successfuly requests from the Jenkins IP, all with the same return size, which leads me to believe that the the request is getting retried:

      192.168.90.72 - - [11/May/2011:11:24:08 +0300] "POST /mantis//api/soap/mantisconnect.php HTTP/1.0" 200 562382 "-" "Axis/1.3"
      192.168.90.72 - - [11/May/2011:11:24:13 +0300] "POST /mantis//api/soap/mantisconnect.php HTTP/1.0" 200 562382 "-" "Axis/1.3"
      192.168.90.72 - - [11/May/2011:11:24:16 +0300] "POST /mantis//api/soap/mantisconnect.php HTTP/1.0" 200 562382 "-" "Axis/1.3"
      192.168.90.72 - - [11/May/2011:11:24:20 +0300] "POST /mantis//api/soap/mantisconnect.php HTTP/1.0" 200 562382 "-" "Axis/1.3"
      192.168.90.72 - - [11/May/2011:11:24:23 +0300] "POST /mantis//api/soap/mantisconnect.php HTTP/1.0" 200 562382 "-" "Axis/1.3"
      192.168.90.72 - - [11/May/2011:11:24:27 +0300] "POST /mantis//api/soap/mantisconnect.php HTTP/1.0" 200 562382 "-" "Axis/1.3"
      192.168.90.72 - - [11/May/2011:11:24:30 +0300] "POST /mantis//api/soap/mantisconnect.php HTTP/1.0" 200 562382 "-" "Axis/1.3"
      192.168.90.72 - - [11/May/2011:11:24:33 +0300] "POST /mantis//api/soap/mantisconnect.php HTTP/1.0" 200 562382 "-" "Axis/1.3"
      192.168.90.72 - - [11/May/2011:11:24:36 +0300] "POST /mantis//api/soap/mantisconnect.php HTTP/1.0" 200 562382 "-" "Axis/1.3"
      192.168.90.72 - - [11/May/2011:11:24:40 +0300] "POST /mantis//api/soap/mantisconnect.php HTTP/1.0" 200 562382 "-" "Axis/1.3"
      192.168.90.72 - - [11/May/2011:11:24:44 +0300] "POST /mantis//api/soap/mantisconnect.php HTTP/1.0" 200 562382 "-" "Axis/1.3"
      192.168.90.72 - - [11/May/2011:11:24:47 +0300] "POST /mantis//api/soap/mantisconnect.php HTTP/1.0" 200 562382 "-" "Axis/1.3"
      

      A random thread dump from the sonar run is

      2011-05-11 11:31:07
      Full thread dump Java HotSpot(TM) Client VM (19.0-b09 mixed mode, sharing):
      
      "resolver-4" daemon prio=10 tid=0x09100c00 nid=0xf99 waiting on condition [0xb41ec000]
         java.lang.Thread.State: WAITING (parking)
      	at sun.misc.Unsafe.park(Native Method)
      	- parking to wait for  <0x5839d088> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
      	at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
      	at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1987)
      	at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:399)
      	at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
      	at java.lang.Thread.run(Thread.java:662)
      
      "resolver-3" daemon prio=10 tid=0x09100400 nid=0xf98 waiting on condition [0xb3e0e000]
         java.lang.Thread.State: WAITING (parking)
      	at sun.misc.Unsafe.park(Native Method)
      	- parking to wait for  <0x5839d088> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
      	at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
      	at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1987)
      	at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:399)
      	at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
      	at java.lang.Thread.run(Thread.java:662)
      
      "resolver-2" daemon prio=10 tid=0x090ffc00 nid=0xf97 waiting on condition [0xb3e5f000]
         java.lang.Thread.State: WAITING (parking)
      	at sun.misc.Unsafe.park(Native Method)
      	- parking to wait for  <0x5839d088> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
      	at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
      	at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1987)
      	at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:399)
      	at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
      	at java.lang.Thread.run(Thread.java:662)
      
      "resolver-1" daemon prio=10 tid=0x0910e400 nid=0xf96 waiting on condition [0xb3dbd000]
         java.lang.Thread.State: WAITING (parking)
      	at sun.misc.Unsafe.park(Native Method)
      	- parking to wait for  <0x5839d088> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
      	at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
      	at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1987)
      	at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:399)
      	at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
      	at java.lang.Thread.run(Thread.java:662)
      
      "Low Memory Detector" daemon prio=10 tid=0x08091c00 nid=0xf60 runnable [0x00000000]
         java.lang.Thread.State: RUNNABLE
      
      "CompilerThread0" daemon prio=10 tid=0x08090000 nid=0xf5e waiting on condition [0x00000000]
         java.lang.Thread.State: RUNNABLE
      
      "Signal Dispatcher" daemon prio=10 tid=0x0808e400 nid=0xf5d waiting on condition [0x00000000]
         java.lang.Thread.State: RUNNABLE
      
      "Finalizer" daemon prio=10 tid=0x0807e800 nid=0xf5c in Object.wait() [0xb4612000]
         java.lang.Thread.State: WAITING (on object monitor)
      	at java.lang.Object.wait(Native Method)
      	- waiting on <0x582d0258> (a java.lang.ref.ReferenceQueue$Lock)
      	at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:118)
      	- locked <0x582d0258> (a java.lang.ref.ReferenceQueue$Lock)
      	at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:134)
      	at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)
      
      "Reference Handler" daemon prio=10 tid=0x0807d000 nid=0xf5b in Object.wait() [0xb4663000]
         java.lang.Thread.State: WAITING (on object monitor)
      	at java.lang.Object.wait(Native Method)
      	- waiting on <0x582d02e8> (a java.lang.ref.Reference$Lock)
      	at java.lang.Object.wait(Object.java:485)
      	at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:116)
      	- locked <0x582d02e8> (a java.lang.ref.Reference$Lock)
      
      "main" prio=10 tid=0x08058400 nid=0xf59 runnable [0xb6ca8000]
         java.lang.Thread.State: RUNNABLE
      	at java.net.SocketInputStream.socketRead0(Native Method)
      	at java.net.SocketInputStream.read(SocketInputStream.java:129)
      	at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
      	at java.io.BufferedInputStream.read(BufferedInputStream.java:237)
      	- locked <0x494ce818> (a java.io.BufferedInputStream)
      	at org.apache.axis.transport.http.HTTPSender.readHeadersFromSocket(HTTPSender.java:583)
      	at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:143)
      	at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
      	at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
      	at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
      	at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
      	at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
      	at org.apache.axis.client.Call.invoke(Call.java:2767)
      	at org.apache.axis.client.Call.invoke(Call.java:2443)
      	at org.apache.axis.client.Call.invoke(Call.java:2366)
      	at org.apache.axis.client.Call.invoke(Call.java:1812)
      	at biz.futureware.mantis.rpc.soap.client.MantisConnectBindingStub.mc_filter_get_issues(MantisConnectBindingStub.java:2914)
      	at org.sonar.plugins.mantis.soap.MantisSoapService.getIssues(MantisSoapService.java:94)
      	at org.sonar.plugins.mantis.MantisSensor.analyze(MantisSensor.java:128)
      	at org.sonar.plugins.mantis.MantisSensor.analyse(MantisSensor.java:94)
      	at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:59)
      	at org.sonar.batch.phases.Phases.execute(Phases.java:75)
      	at org.sonar.batch.ProjectBatch.execute(ProjectBatch.java:55)
      	at org.sonar.batch.Batch.analyzeModule(Batch.java:158)
      	at org.sonar.batch.Batch.analyzeModules(Batch.java:76)
      	at org.sonar.batch.Batch.execute(Batch.java:62)
      	at org.sonar.maven3.SonarMojo.executeBatch(SonarMojo.java:144)
      	at org.sonar.maven3.SonarMojo.execute(SonarMojo.java:135)
      	at org.codehaus.mojo.sonar.Bootstraper.executeMojo(Bootstraper.java:113)
      	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:107)
      	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
      	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:534)
      	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)
      

        Activity

        Hide
        Robert Munteanu added a comment -

        The Mantis filter return 400 tasks, if that makes any difference.

        Show
        Robert Munteanu added a comment - The Mantis filter return 400 tasks, if that makes any difference.
        Hide
        Robert Munteanu added a comment -

        By digging into the debug logs it seems that it never exists the mc_filter_get_issues loop. As I've mentioned, there are 400 issues in this filter, but it seems to have already arrived at page #25, which is more than the total number of issues in the Mantis instance. It's either an error in the SOAP API, or in the paged retrieval code.

        Show
        Robert Munteanu added a comment - By digging into the debug logs it seems that it never exists the mc_filter_get_issues loop. As I've mentioned, there are 400 issues in this filter, but it seems to have already arrived at page #25, which is more than the total number of issues in the Mantis instance. It's either an error in the SOAP API, or in the paged retrieval code.
        Hide
        Robert Munteanu added a comment -

        (Sorry for the spam)

        The error in the MantisBT filter code, which assumes that if the requested page number is larger than the last page number, the request page number becomes the last page number. This means that if I request page 4 for a filter which has 2 pages, I will get the second page.

        In my specific, unfortunate, case the filter will always return the fourth page. Unfortunately this is not easily fixable in the MantisBT SOAP API or core, although I will open a bug ticket for this.

        Might I suggest a workaround? Perhaps recall last received issue ids and if there is a perfect overlaps between the current issue ids and the previous ones, consider that the bug is hit and do break the invocation cycle.

        Show
        Robert Munteanu added a comment - (Sorry for the spam) The error in the MantisBT filter code, which assumes that if the requested page number is larger than the last page number, the request page number becomes the last page number. This means that if I request page 4 for a filter which has 2 pages, I will get the second page. In my specific, unfortunate, case the filter will always return the fourth page. Unfortunately this is not easily fixable in the MantisBT SOAP API or core, although I will open a bug ticket for this. Might I suggest a workaround? Perhaps recall last received issue ids and if there is a perfect overlaps between the current issue ids and the previous ones, consider that the bug is hit and do break the invocation cycle.
        Hide
        Robert Munteanu added a comment -

        This is tracked upstream at

        12991: mc_filter_get_issues returns incorrect results for page_number > page_count
        http://www.mantisbt.org/bugs/view.php?id=12991

        Show
        Robert Munteanu added a comment - This is tracked upstream at 12991: mc_filter_get_issues returns incorrect results for page_number > page_count http://www.mantisbt.org/bugs/view.php?id=12991
        Hide
        Jérémie Lagarde added a comment -

        I can do a temporary quick hack in the plugin for this MantisBT bug.

        Show
        Jérémie Lagarde added a comment - I can do a temporary quick hack in the plugin for this MantisBT bug.
        Show
        Jérémie Lagarde added a comment - Snapshot available http://snapshots.repository.codehaus.org/org/codehaus/sonar-plugins/sonar-mantis-plugin/0.3-SNAPSHOT/
        Hide
        Robert Munteanu added a comment -

        Thanks for the quick turnaround! I've tested the snapshot plugin and now the projects show up with 0 issues on the dashboard. Any idea why?

        Show
        Robert Munteanu added a comment - Thanks for the quick turnaround! I've tested the snapshot plugin and now the projects show up with 0 issues on the dashboard. Any idea why?
        Hide
        Robert Munteanu added a comment -

        I have tried to reproduce this with a local build of the project but was unsuccessful. The retrieved number appears correctly.

        Show
        Robert Munteanu added a comment - I have tried to reproduce this with a local build of the project but was unsuccessful. The retrieved number appears correctly.

          People

          • Assignee:
            Jérémie Lagarde
            Reporter:
            Robert Munteanu
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: