Confluence page gadget does not load in Jira
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
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
Problem
When making the following actions...
Loading a Confluence gadget on JIRA Dashboard times out with the log below
The following appears in the atlassian-jira.log
2019-01-30 00:10:10,393 https-jsse-nio-443-exec-9 url:/plugins/servlet/gadgets/makeRequest DEBUG 10x184935x1 12n43wr 10.99.36.147 /plugins/servlet/gadgets/makeRequest [c.a.g.r.internal.http.HttpClientFetcher] Timeout performing a request to: https://confluence_url/rest/gadget/1.0/pagegadget/getrenderedpage.json?pageId=704163192&cacheBuster=1548832205112\\java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
at java.net.SocketInputStream.read(SocketInputStream.java:171)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at sun.security.ssl.InputRecord.readFully(InputRecord.java:465)
at sun.security.ssl.InputRecord.read(InputRecord.java:503)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:975)
at sun.security.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:933)
at sun.security.ssl.AppInputStream.read(AppInputStream.java:105)
Diagnosis
Environment
A gadget is added in Jira, which times out on request to external system
Diagnostic Steps
If the response from external system serving gadget content is longer than 5000 ms, the gadget will time out
The default is coded in com/atlassian/gadgets/util/HttpTimeoutsProvider.java
Cause
The default HttpTimeout in threads making request from gadgets is 5000 milliseconds and the Confluence page is too large or is loading external elements and can't be pulled by Jira within 5 seconds.
For example, the Confluence page may have a long-running Jira filter.
Workaround
Increase the HttpTimeout as needed (10s for instance) by adding -Dhttp.connection.timeout=10000
to JVM_SUPPORT_RECOMMENDED_ARGS
in setenv.sh.
Notes
Please be cautious when using this parameter as it will extend the life of internal threads making external requests. The hardcoded value of 5000 milliseconds is designed to prevent long-running threads. We would advise against changing it unless the change is tracked and documented, as it may impact performance of the Jira instance.