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

Jira failing to load Confluence page link titles when viewing issues

XMLWordPrintable

      Summary

      Jira Issues could not load added Confluence links to page This is a regression of JRA-60872 introduced in 7.2.4.

      There are 2 steps for issue links:

      1. Adding the link, this could be done in many ways and "mentioned in" is one of them
        • Adding those issue links is outside the scope of current bug.
      2. Show added link
        • Scope of this bug

      Environment

      • JIRA 7.2.6
      • Confluence 5.10+

      Steps to Reproduce

      1. Create link to Confluence page from JIRA issue

      Expected Results

      Link is rendered

      Actual Results

      Link is not rendered

      The below exception is thrown in the jira file:

      2017-01-06 12:18:54,474 ajp-nio-8600-exec-512 ERROR admin 738x5030206x3 1jgcvgx 10.1.1.1 /rest/viewIssue/1/remoteIssueLink/render/35092 [c.a.j.p.v.issuelink.rest.RemoteIssueLinkResource] Error occurred while generating final HTML for remote issue link: java.lang.RuntimeException: java.io.IOException: Failed to load Confluence Page from remote server Caused by: java.io.IOException: Failed to load Confluence Page from remote server Caused by: com.atlassian.sal.api.net.ResponseException: Status Code: 200, Status Text: OK, Errors: {}, Error Messages: [java.lang.Exception: java.lang.ClassCastException]
      

      Notes

      Happy flow:

      1. JIRA fires the XML-RPC call: response = getBlogPost(applicationLink, pageId);
      2. Confluence sends back some reply: Blog content or Error
      3. JIRA checks the result and checks if this is known error, it expects this:
        <Fault 0: 'java.lang.Exception: java.lang.ClassCastException: com.atlassian.confluence.pages.Page cannot be cast to com.atlassian.confluence.pages.BlogPost'>
        
      4. If this is expected error, JIRA fires another the XML-RPC call: response = getGenericPage(applicationLink, pageId);

      Due to JIT optimisation, Confluence replies with:

      <?xml version="1.0"?><methodResponse><fault><value><struct><member><name>faultString</name><value>java.lang.Exception: java.lang.ClassCastException</value></member><member><name>faultCode</name><value><int>0</int></value></member></struct></value></fault></methodResponse>
      

      Note the difference:

      • java.lang.Exception: java.lang.ClassCastException
      • java.lang.Exception: java.lang.ClassCastException: com.atlassian.confluence.pages.Page cannot be cast to com.atlassian.confluence.pages.BlogPost

      And that causes link failed to render.
      Related to CONF-45760

      Workaround

      The problem on the Confluence side is caused due to JVM does JIT optimisation and suppresses stack-trace for frequent errors.

      • Restart of the Confluence temporary solves the problem.
      • Disable JIT optimization in Confluence, add to JVM paramerts:
        -XX:-OmitStackTraceInFastThrow
        

      Update 2017-02-20: A bugfix is being delivered in the next patch versions of JIRA. Until those are released, you can use one of the attached versions of the Confluence Link plugin. Read this comment from the development team for more details.

              cdarroch Daz
              ayakovlev@atlassian.com Andriy Yakovlev [Atlassian]
              Votes:
              90 Vote for this issue
              Watchers:
              130 Start watching this issue

                Created:
                Updated:
                Resolved: