Uploaded image for project: 'Bitbucket Data Center'
  1. Bitbucket Data Center
  2. BSERV-5154

Stash - ClassCastException in newly introducted analytics

    XMLWordPrintable

Details

    Description

      Hi,
      I do not know if it is ok to directly create a bug report - so I'm writing my findings here:

      We are using an SSH Request Handler Plugin (that uses the command "pull-request") to create Pull-Requests via SSH. As far as I see it, your newly introduced analytics part which collects information assumes that pull-requests are created by HttpServlets and hence tries to cast an SshScmRequestCommandAdapter into a HttpServletRequest.

      Here a snippet from the access log:

      10.17.74.124 | ssh | i@1T83OM1x541x250245x2 | horst.wanek | 2014-08-18 09:01:34,483 | SSH - pull-request | - | - | - | 18tjj35 |
      10.17.74.124 | ssh | o@1T83OM1x541x250245x2 | horst.wanek | 2014-08-18 09:01:35,364 | SSH - pull-request | - | ssh:id:331, ssh:label:'horstw@socbl215' | 880 | 18tjj35 |
      

      Here the error / stacktrace from the log:

      2014-08-18 09:01:35,257 ERROR [ssh-scm-request-handler] horst.wanek @1T83OM1x541x250245x2 18tjj35 10.17.74.124 SSH - pull-request c.a.a.c.l.ProductEventListener Failed to send analytics event com.atlassian.stash.event.pull.PullRequestOpenRequestedEvent[source=com.atlassian.stash.internal.pull.PullRequestServiceImpl@39da6d42]
      java.lang.ClassCastException: com.atlassian.stash.internal.ssh.server.SshScmRequestCommandAdapter cannot be cast to javax.servlet.http.HttpServletRequest
      at com.atlassian.analytics.client.request.StashHttpRequestProvider.getRequest(StashHttpRequestProvider.java:22) ~[analytics-client-3.35_1406678900000.jar:na]
      at com.atlassian.analytics.client.serialize.EventSerializer.getHttpRequest(EventSerializer.java:91) ~[analytics-client-3.35_1406678900000.jar:na]
      at com.atlassian.analytics.client.serialize.EventSerializer.toMessage(EventSerializer.java:60) ~[analytics-client-3.35_1406678900000.jar:na]
      at com.atlassian.analytics.client.listener.ProductEventListener.processEventWithTiming(ProductEventListener.java:78) [analytics-client-3.35_1406678900000.jar:na]
      at com.atlassian.analytics.client.listener.ProductEventListener.processEvent(ProductEventListener.java:69) [analytics-client-3.35_1406678900000.jar:na]
      at com.atlassian.analytics.client.listener.ProductEventListener.processEvent(ProductEventListener.java:61) [analytics-client-3.35_1406678900000.jar:na]
      at com.atlassian.analytics.client.listener.StashEventListener.onEvent(StashEventListener.java:60) [analytics-client-3.35_1406678900000.jar:na]
      at com.atlassian.event.internal.SingleParameterMethodListenerInvoker.invoke(SingleParameterMethodListenerInvoker.java:36) [atlassian-event-2.3.5.jar:na]
      at com.atlassian.event.internal.AsynchronousAbleEventDispatcher$1$1.run(AsynchronousAbleEventDispatcher.java:48) [atlassian-event-2.3.5.jar:na]
      at com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:253) [guava-11.0.2-atlassian-01.jar:na]
      at com.atlassian.event.internal.AsynchronousAbleEventDispatcher.dispatch(AsynchronousAbleEventDispatcher.java:107) [atlassian-event-2.3.5.jar:na]
      at com.atlassian.stash.internal.event.LockFreeEventPublisher$Publisher.dispatch(LockFreeEventPublisher.java:202) [stash-platform-3.2.2.jar:na]
      at com.atlassian.stash.internal.event.LockFreeEventPublisher.publish(LockFreeEventPublisher.java:75) [stash-platform-3.2.2.jar:na]
      at com.atlassian.stash.internal.event.TransactionAwareEventPublisher.publish(TransactionAwareEventPublisher.java:84) [stash-platform-3.2.2.jar:na]
      at com.atlassian.stash.internal.pull.PullRequestServiceImpl.fireOpenRequested(PullRequestServiceImpl.java:1152) [stash-service-impl-3.2.2.jar:na]
      at com.atlassian.stash.internal.pull.PullRequestServiceImpl.create(PullRequestServiceImpl.java:376) [stash-service-impl-3.2.2.jar:na]
      at com.atlassian.stash.internal.pull.PullRequestServiceImpl.create(PullRequestServiceImpl.java:71) [stash-service-impl-3.2.2.jar:na]
      at de.aeffle.stash.plugins.ssh.requestHandler.CreatePullRequestHandler.createPullRequestInStash(CreatePullRequestHandler.java:83) [plugin.5695302897666225133.create-pull-request-via-ssh-2.2_1400414625000.jar:na]
      at de.aeffle.stash.plugins.ssh.requestHandler.CreatePullRequestHandler.tryPullRequestCreation(CreatePullRequestHandler.java:73) [plugin.5695302897666225133.create-pull-request-via-ssh-2.2_1400414625000.jar:na]
      at de.aeffle.stash.plugins.ssh.requestHandler.CreatePullRequestHandler.handleRequest(CreatePullRequestHandler.java:38) [plugin.5695302897666225133.create-pull-request-via-ssh-2.2_1400414625000.jar:na]
      at com.atlassian.stash.internal.ssh.server.SshScmRequestCommandAdapter$ScmRequestRunnable$1.withRequest(SshScmRequestCommandAdapter.java:289) [stash-ssh-3.2.2_1407984114000.jar:na]
      at com.atlassian.stash.internal.ssh.server.SshScmRequestCommandAdapter$ScmRequestRunnable$1.withRequest(SshScmRequestCommandAdapter.java:277) [stash-ssh-3.2.2_1407984114000.jar:na]
      at com.atlassian.stash.internal.request.DefaultRequestManager.doAsRequest(DefaultRequestManager.java:84) [stash-service-impl-3.2.2.jar:na]
      at com.atlassian.stash.internal.ssh.server.SshScmRequestCommandAdapter$ScmRequestRunnable.run(SshScmRequestCommandAdapter.java:277) [stash-ssh-3.2.2_1407984114000.jar:na]
      at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64) [stash-ssh-3.2.2_1407984114000.jar:na]
      at com.atlassian.stash.internal.concurrent.StateTransferringExecutor$StateTransferringRunnable.run(StateTransferringExecutor.java:69) [stash-platform-3.2.2.jar:na]
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [na:1.7.0_51]
      at java.util.concurrent.FutureTask.run(FutureTask.java:262) [na:1.7.0_51]
      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178) [na:1.7.0_51]
      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292) [na:1.7.0_51]
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_51]
      at java.lang.Thread.run(Thread.java:744) [na:1.7.0_51]
      ... 66 frames trimmed
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            dlee@atlassian.com Deric Lee (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: