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

Can't link JIRA issue to Confluence page by using tiny URL when Confluence uses a Context Path

    XMLWordPrintable

Details

    Description

      Summary

      If Confluence uses a context path in its URL, JIRA is unable to find a page using its tiny link when linking a JIRA issue to a Confluence page.

      Steps to reproduce

      1. Configure JIRA to run on http://localhost:8730/jira
      2. Configure Confluence to run on http://localhost:6001/cfl
      3. Link them together using applinks
      4. Open a Confluence page and get its tiny link
      5. Open a JIRA issue -> More -> Link -> Confluence Page -> paste the tiny link -> Link

      Expected behavior

      The link is added successfully.

      Actual behavior

      JIRA cannot find the link and throws a 404 error in the log:

      2017-02-14 23:13:40,939 http-nio-8730-exec-2 ERROR admin 1393x1101x1 ki7q6c 0:0:0:0:0:0:0:1 /secure/LinkConfluencePage.jspa [c.a.j.p.link.confluence.LinkConfluencePage] Invalid response from getting the pageId: 404: Not Found
      

      Notes / Workarounds

      • By default, Confluence will resolve the tiny link to a relative URL when used with HTTP/1.1, which fails when a context path is used for Confluence.
      • The standard (non-tiny) link of the same Confluence page can be linked successfully
      • If Confluence has no context path e.g. http://localhost:6001, tiny links can be linked successfully
      • If using a context path, two possible workarounds would be to either:
        • append the system property org.apache.catalina.STRICT_SERVLET_COMPLIANCE=true to Confluence's catalina.properties file and restart Confluence, or
        • modify the context element in Confluence's context.xml file to disallow relative redirects, e.g.:
          <Context useRelativeRedirects="false">
          and restart Confluence.

      Be sure to thoroughly test either of the above two workarounds in a test environment before implementing in production to ensure no functionality is impacted.

      Attachments

        1. tiny.png
          24 kB
          Andy Nguyen

        Issue Links

          Activity

            People

              Unassigned Unassigned
              vdung Andy Nguyen (Inactive)
              Votes:
              17 Vote for this issue
              Watchers:
              17 Start watching this issue

              Dates

                Created:
                Updated: