Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-77692

Apps using REST endpoints return HTTP 404

    XMLWordPrintable

Details

    Description

      Issue Summary

      This is reproducible on Data Center: (yes)

      This a follow on from

      • JRASERVER-77643: Jira crashes with 'Multiple fields representing property "link"' when using REST module

      Apps that provide REST endpoints for use, for example when using React, will not initialise the endpoints and return HTTP 404. There are endpoints with the pattern like

      • /rest/<appKey>/(latest|[0-9]+)/<endpoint>

      This seems to be caused by the use of atlassian-pocketknife-dynamic-modules.

      More specifically, CombinedModuleDescriptorFactoryProvider#getChainedModuleDescriptorFactory from pocketnife-dynamic-modules loads ModuleDescriptorFactories. Two RestModuleDescriptors (legacy one and V2) are loaded in random order into factories array to be served by ChainModuleDescriptorFactory from atlassian-plugins-core. Both RestModuleDescriptors have the same type/key "rest" and ChainModuleDescriptorFactory is serving always first in array. If V2 version sits first in array the rest endpoint is not available because servlet filter chain is updated appropriately. If legacy RestModuleDescriptor is loaded first into the array, all works fine.

      As this issue is caused by OSGi loading it is non-deterministic, and may take a few restarts or disable/enable of the app to reproduce.

      Steps to Reproduce

      1. Install an app that uses pocketknife, examples include ScriptRunner or Rich Filters for Jira Dashboards
      2. Go to a page in the app that makes requests to the REST endpoints

      Expected Results

      The app works as expected.

      Actual Results

      Endpoints that the app provides all return HTTP 404.

      Workaround

      NOTE: this is a temporary workaround and may cause issues with other apps that have started using the V2 REST endpoints. Please ensure you test this fully in a staging environment.

      1. Stop Jira
      2. Move atlassian-jira/WEB-INF/atlassian-bundled-plugins/atlassian-rest-v2-plugin-7.2.15.jar to a safe location.
      3. Restart Jira

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jrichards@atlassian.com James Richards
              Votes:
              4 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: