Uploaded image for project: 'Bamboo'
  1. Bamboo
  2. BAM-17579

Remote events fail silently if Base URL does not match Application Link URL

    XMLWordPrintable

Details

    Description

      If a remote event consumer (JIRA, Bamboo, FeCru, etc) has a Base URL which does not match the URL used by AppLinks then all remote events are dropped silently (i.e. a mismatch in JIRA will cause Stash not to send remote events to Bamboo, for example).

      Consumers publish via REST the event capabilities they can handle with their corresponding URL. Said URL is created using the application's Base URL. When that URL does not match the AppLinks URL the event cannot be sent.

      Error from Bitbucket Server side:

      2016-06-28 19:38:27,726 ERROR [events.remote.ratelimit.threads:thread-1] kahloun.foong @IAA69Lx1178x15x0 0:0:0:0:0:0:0:1 "POST /scm/tst/stash.git/git-receive-pack HTTP/1.1" c.a.e.r.impl.RemoteEventDispatcher Error dispatching Set(com.atlassian.stash.plugin.remote.event.StashBranchChangedRemoteEvent@e2ab958[branchName=master,repositoryProject=TST,repositorySlug=stash,committer=kahloun.foong,sourceId=<null>,sourceUrl=<null>]) to Atlassian Bamboo (4d84b08d-478f-303e-8dc0-b3190ae85ef7) http://localhost:8085 bamboo
      java.lang.IllegalArgumentException: Request url 'http://10.60.2.227:8085/rest/remote-event-consumer/latest/events/stash-branch-changed-remote-event' doesn't match rpc url 'http://localhost:8085'
      	at com.google.common.base.Preconditions.checkArgument(Preconditions.java:145) ~[guava-18.0.jar:na]
      	at com.atlassian.applinks.core.auth.ApplicationLinkRequestFactoryFactoryImpl$AbsoluteURLRequestFactory.createRequest(ApplicationLinkRequestFactoryFactoryImpl.java:199) ~[na:na]
      	at com.atlassian.event.remote.impl.RemoteEventDispatcher$$anonfun$com$atlassian$event$remote$impl$RemoteEventDispatcher$$createRequest$1.apply(RemoteEventDispatcher.scala:83) ~[atlassian-remote-event-producer-plugin-1.0.9-D20151109T070900.jar:na]
      	at com.atlassian.event.remote.impl.RemoteEventDispatcher$$anonfun$com$atlassian$event$remote$impl$RemoteEventDispatcher$$createRequest$1.apply(RemoteEventDispatcher.scala:83) ~[atlassian-remote-event-producer-plugin-1.0.9-D20151109T070900.jar:na]
      	at scala.util.control.Exception$Catch$$anonfun$either$1.apply(Exception.scala:124) ~[scala-2.10-provider-plugin-0.9.jar:na]
      	at scala.util.control.Exception$Catch$$anonfun$either$1.apply(Exception.scala:124) ~[scala-2.10-provider-plugin-0.9.jar:na]
      	at scala.util.control.Exception$Catch.apply(Exception.scala:102) ~[scala-2.10-provider-plugin-0.9.jar:na]
      	at scala.util.control.Exception$Catch.either(Exception.scala:124) ~[scala-2.10-provider-plugin-0.9.jar:na]
      	at com.atlassian.event.remote.impl.RemoteEventDispatcher.com$atlassian$event$remote$impl$RemoteEventDispatcher$$createRequest(RemoteEventDispatcher.scala:82) [atlassian-remote-event-producer-plugin-1.0.9-D20151109T070900.jar:na]
      	at com.atlassian.event.remote.impl.RemoteEventDispatcher$$anonfun$com$atlassian$event$remote$impl$RemoteEventDispatcher$$dispatchToAppLink$2.apply(RemoteEventDispatcher.scala:105) ~[atlassian-remote-event-producer-plugin-1.0.9-D20151109T070900.jar:na]
      

      Workaround

      1. Stop Bamboo
      2. Locate the following files inside $BAMBOO_INSTALL/atlassian-bamboo/WEB-INF/atlassian-bundled-plugins, and move them to a backup location. Please do not delete them but note that they must be removed from your Bamboo installation.
        • atlassian-remote-event-common-plugin-1.0.6-D20150716T084030.jar
        • atlassian-remote-event-producer-plugin-1.0.6-D20150716T084030.jar
        • atlassian-remote-event-consumer-plugin-1.0.6-D20150716T084030.jar
      3. Updated versions of these plugins are attached to this issue. Save the attached JAR files to $BAMBOO_INSTALL/atlassian-bamboo/WEB-INF/atlassian-bundled-plugins and ensure the permissions are correct (e.g. chown -R bamboo_user: $BAMBOO_INSTALL/atlassian-bamboo/WEB-INF/atlassian-bundled-plugins, where bamboo_user is your local OS user that runs Bamboo)
      4. Start Bamboo

      Attachments

        Issue Links

          Activity

            People

              kbrazulewicz Krystian Brazulewicz
              jpalacios Juan Palacios (Inactive)
              Votes:
              2 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: