Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-56088

JIRA Charts are not available for your version of JIRA. Upgrade to JIRA 6.1.1 or later to use this macro.

XMLWordPrintable

      Summary

      The error message "JIRA Charts are not available for your version of JIRA. Upgrade to JIRA 6.1.1 or later to use this macro" can be presented to users already running versions of Jira higher than 6.1.1.

      There appear to be multiple causes for this issue, but any connection failure to Jira appears to result in a value of -1 being stored in cache for the remote Jira version number.

      This causes the version check above to fail as -1 is explicitly listed as an unsupported build version.

      DefaultJiraConnectionManager.getServerBuildNumber
      private long getServerBuildNumber(final ReadOnlyApplicationLink appLink) {
          try {
              ApplicationLinkRequest request = JiraConnectorUtils.getApplicationLinkRequest(appLink, com.atlassian.sal.api.net.Request.MethodType.GET, REST_URL_SERVER_INFO);
              request.addHeader("Content-Type", MediaType.APPLICATION_JSON);
              String responseString = request.execute();
              ObjectMapper mapper = new ObjectMapper();
              JsonNode rootNode = mapper.readTree(responseString);
              return rootNode.path(JSON_PATH_BUILD_NUMBER).getLongValue();
          } catch (ResponseStatusException e) // We could connect to Jira Server but the REST URL provided is version 4.x
          {
              return NOT_SUPPORTED_BUILD_NUMBER;
          } catch (Exception e) // In other cases we assume that it is supported version
          {
              return Long.MAX_VALUE;
          }
      }
      

      Additionally, the cache holds this value for 4 hours, so any subsequent requests for the next 4 hours will also fail with this error.

      Environment

      • Confluence 6.3.2
      • Jira 7.3.9

      Steps to Reproduce

      1. Create an AppLink between Confluence and Jira, both behind a Reverse Proxy
      2. Create a Jira Charts macro (JCM) in Confluence
      3. Shutdown Jira
      4. Restart Confluence (with Jira still down)
      5. Load the page with the JCM
      6. The Jira macro will fail to Preview
      7. Start Jira - other JIM macros will work except the Jira Chart will still fail

      Expected Results

      The JCM should be displayed

      Actual Results

      The below exception is thrown in the atlassian-confluence.log file:

      Log Output
      2018-06-26 10:22:18,062 WARN [http-nio2-8009-exec-83] [internal.integration.jira.DefaultJiraService] handle Could not parse JIRA server's information: No content to map to Object due to end of input
       -- referer: -SNIP- | url: /rest/highlighting/1.0/panel-items | traceId: ac4298b9d4878381 | userName: -SNIP-
      2018-06-26 10:22:18,062 WARN [http-nio2-8009-exec-83] [internal.integration.jira.DefaultJiraService] handle Could not parse JIRA server's information: No content to map to Object due to end of input
       -- referer: -SNIP- | url: /rest/highlighting/1.0/panel-items | traceId: ac4298b9d4878381 | userName: -SNIP-
      2018-06-26 11:43:47,764 ERROR [http-nio2-8009-exec-73] [confluence.plugins.jiracharts.JiraChartMacro] getImagePlaceholder error get image place holder
       -- referer: -SNIP- | url: /rest/tinymce/1/content/196968597.json | traceId: 9da19db95d13b833 | userName: -SNIP-
      com.atlassian.confluence.macro.MacroExecutionException: JIRA Charts are not available for your version of JIRA. Upgrade to JIRA 6.1.1 or later to use this macro.
      	at com.atlassian.confluence.plugins.jiracharts.DefaultJQLValidator.validateJiraSupportedVersion(DefaultJQLValidator.java:99)
      	at com.atlassian.confluence.plugins.jiracharts.DefaultJQLValidator.doValidate(DefaultJQLValidator.java:56)
      	at com.atlassian.confluence.plugins.jiracharts.JiraChartMacro.getImagePlaceholder(JiraChartMacro.java:127)
      	...
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      	at java.lang.Thread.run(Thread.java:748)
      

      Validation

      To inspect the Jira build number that Confluence has in it's cache, open up this URL to the Confluence Server:

      • http://<confluence-base-url>/rest/jiraanywhere/1.0/servers

      The JSON that returns will show the buildNumber for each of the Jira application link and the failing one should show -1 as the stored buildNumber. e.g.

      [{"id":"983172d9-18a4-3abf-acc9-0397663852e2","name":"Your Company JIRA","selected":true,"url":"https://myjirasite1.com.au:7443/j723","buildNumber":72005},
      { "id":"380add4d-626e-369e-9b89-c2f07f7aad53","name":"Your Company JIRA - 2","selected":false,"url":"https://myjirasite2.com.au:8443/j772","buildNumber":-1}]"
      

      Notes

      This issue often presents as a single occurrence that is resolved when the cache is cleared 4 hours later. In some cases, it can be persistent.

      Workaround

      Re-indexing appears to correct this issue as in the process, the relevant cache is cleared in the process.

      This may not be an acceptable workaround as if connectivity issues persist, the incorrect value will be stored in cache on the next version request.

      Additionally, reindexing can be a time and resource expensive process that may rule this out as a fix in production.

              dluong Duy Truong Luong
              jponting James Ponting
              Votes:
              16 Vote for this issue
              Watchers:
              21 Start watching this issue

                Created:
                Updated:
                Resolved: