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

The Jira Chart Macro fails to be displayed in Confluence pages when using Jira Data Center on at least 2 nodes

    XMLWordPrintable

Details

    Description

      Summary

      The Jira Chart Macro fails to be displayed in Confluence pages, when using Jira Data Center on at least 2 nodes.

      Environment

      Confluence Server on any 7.x version.
      Jira Data Center on 8.16.1 or any version above, and using at least 2 nodes.

      Also replicable in the Jira 8.20.0 EAP Version downloadable here

      Steps to replicate

      These steps have been written while using Confluence Server 7.2.0 and Jira DC 8.18.2 with 2 nodes:

      • Install a Confluence Server instance
      • Install a Jira Data Center instance using 2 nodes
      • Create an application link between Confluence and Jira
      • In Confluence:
        • create a new page
        • add to this page a Jira Charts macro by going to Insert more content > Other Macros > Development > Jira Charts
        • save the page

      Expected results

      The Jira Charts macro is showing in the Confluence page at all times:

      The sub-folder /caches/charts exists in the shared home folder, and contains files with name using the format jfreechart-onetime-XXXXXXXXX.png

      Actual results

      The Jira Charts macro is not showing in the Confluence page. Instead, the following error is displayed in the UI:

      com.atlassian.sal.api.net.ResponseException: Can not retrieve jira chart image
      

      In the Jira application logs, the following warnings are thrown:

      2021-10-07 12:08:11,705+0200 http-nio-1132-exec-12 WARN anonymous 728x403x1 - 127.0.0.1,127.0.0.1 /charts [c.a.j.charts.jfreechart.DisplayChartServlet] File not found, returning 404 (filename='jfreechart-onetime-5406716692030141860.png').
      2021-10-07 12:08:11,707+0200 http-nio-1132-exec-12 WARN   -   [c.a.j.w.action.util.Error404] Detected anonymous access to page <JIRABASE_URL/charts> redirecting to login page
      

      When checking the node local home folder and shared home folder, the following can be observed:

      • files with name using the format jfreechart-onetime-XXXXXXXXX.png keep being added to each local node local home folder in the sub folder /caches/charts:

      • the sub-folder /caches/charts does not exist in the shared home folder

      This is actually what is causing the bug: normally, the files jfreechart-onetime-XXXXXXXXX.png should be created in <Jira_shared_home>/caches/charts instead of the node local home folders. However, due to the bug, these files are created instead in the node local home folders.

      Notes

      Note 1

      When refreshing the Confluence page a high number of times, the Jira Charts macro might rarely show:

      Note 2

      The error "com.atlassian.sal.api.net.ResponseException: Can not retrieve jira chart image" might also be seen in the pop-up window, when trying to insert the Jira Chart (and by either selecting the "Pie Chart" or the "Created vs Resolved" option:

      Workaround

      Note that the workaround below can only be used when Jira is installed on a Linux environment

      The workaround consists in creating a symlink pointing from the /caches/charts folder of each node to the shared home counterpart. Make sure you have a backup of your instance and files.

      • Bring one node down
      • Remove <Jira Local Home>/caches/charts (replace Jira Local Home with the actual path of the node home folder)
        • cd <Jira Local Home>/caches
        • rmdir charts
      • Create a symbolic link to <Jira Shared Home>/caches/charts directory (replace Jira Local Home with the actual path of the node home folder)
        • cd <Jira Local Home>/caches
        • ln -s <Jira Shared Home>/caches/charts charts
      • Restart the node.
      • Repeat on the other nodes, one by one.

      Attachments

        Issue Links

          Activity

            People

              agniadzik Artur Gniadzik
              jrey Julien Rey
              Votes:
              8 Vote for this issue
              Watchers:
              19 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: