Jira Chart Macro not able to display image and getting 401 error
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
Jira Chart Macro cannot display images as it is failing to download the chart files from Jira Server.
Environment
Confluence version 7.3.3
Custom SSO is being used for authentication.
Diagnosis
The HTTP request from Jira Chart macro returns 401 error like the following:
1
2
3
4
5
6
2020-09-26 16:44:28,838 ERROR [http-nio-8090-exec-16] [confluence.plugins.jiracharts.JiraChartMacro] getCustomPlaceholder Error getting Jira Chart Macro image placeholder
-- referer: https://confluence.test.com/display/TS/test | url: /plugins/viewsource/viewpagesrc.action | traceId: xxxx | userName: xxx | action: viewpagesrc
com.atlassian.confluence.macro.MacroExecutionException: com.atlassian.sal.api.net.ResponseException: Can not retrieve jira chart image
...
Caused by: java.io.IOException: Server returned HTTP response code: 401 for URL: https://jira.test.com/charts?filename=jfreechart-onetime-xxxx.png
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
Cause
The Jira chart is created on the Jira server on the fly and Confluence downloads the chart file with an HTTP request. With the custom SSO, the HTTP request redirects to SSO and fails with a 401 (Unauthorized) error. The same error did not happen on the Crowd SSO(SAML), so the issue could be specific to the custom SSO being used.
Solution
The custom SSO configuration need to be reviewed and reconfigured in a way that HTTP request from the Jira chart macro file can be downloaded without authentication for the SSO.
Was this helpful?