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

Overriding cache-control header for Jira causes smart commits (and other remote events) to stop working

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Medium
    • None
    • None
    • None

    Description

      Issue Summary

      Overriding the default cache-control header (Cache-Control: no-transform, max-age=600, stale-if-error=86400, stale-while-revalidate=86400 ) and if max-age, stale-if-error, stale-while-revalidate are not set for Jira, then it causes the smart commits to stop working.

      This issue is noticed in environment where Jira is running behind IIS where ASP.NET is registered with IIS and the application pool doesn't have the "No Managed code" selected. But this is not limited to IIS , if the proxy overrides the cache-control as mentioned above, this issue may occur.

      Note: This will affect all remote events that Bitbucket publishes if the consumer that subscribes to those events is behind a proxy that is overriding the Cache-Control header in the response. It is not specific to just Jira and Smart commits but all Bitbucket events Jira is interested in and even Bamboo events such as branch created, branch changed, pull request events etc.
       

      Environment

      Bitbucket Server has an application link with a Jira instance which is running behind proxy and proxy is overriding Cache-control header.

      Steps to Reproduce

      Example with IIS

      • Configure IIS in front of Jira
      • Register ASP.NET for IIS with a command as below
        cd C:\Windows\Microsoft.NET\Framework64\v4.0.30319
         C:\Windows\Microsoft.NET\Framework64\v4.0.30319>dism /online /enable-feature /all /featurename:IIS-ASPNET45 
        
      • Find the Application pool that site is using and change the .NET CLR Version to .NET CLR Version 4.x.x.x
      • Create application Link with Bitbucket
      • Restart Bitbucket to make sure cache is cleared
      • Test smart commit
      • To check the cache-control run curl with verbose and verify the header
        curl -v http://<JIRA-URL>/rest/remote-event-consumer/1/capabilities
        

      Expected Results

      Smart commit will work as expected.

      Actual Results

      Smart commits stop working and following appear in log. As you can see consumable by is empty

      2019-05-07 11:31:42,217 DEBUG [AtlassianEvent::thread-2]  c.a.e.r.impl.RemoteEventDispatcher RemoteEvent com.atlassian.devstatus.IssueChangedEvent@51802add[issueKeys=[JRA-227],sourceId=<null>,sourceUrl=<null>] consumable by []
      2019-05-07 11:31:42,217 DEBUG [AtlassianEvent::thread-4]  c.a.e.r.impl.RemoteEventDispatcher RemoteEvent 
      

      Workaround

      • Bypass a reverse proxy and recreate the application link.
      • Change the cache-control setting in proxy to not override it.
      • For IIS, make sure the application for the site is using "No Managed code"

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              pthaikkalloor Prasanth
              Votes:
              3 Vote for this issue
              Watchers:
              14 Start watching this issue

              Dates

                Created:
                Updated:

                Backbone Issue Sync