How to change the default AJAX timeout in Jira server

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the server and data center platforms.

Problem

Sometimes an underlying performance problem will prevent the AJAX calls that JIRA uses from completing within the normal timeout of 30 seconds.

In some cases, this problem will appear as a timeout error message in the UI. In others, the browser developer tools will show a request that is cancelled or has no HTTP response code.

Temporarily increasing the AJAX timeout used by JIRA can be helpful to reduce the severity of a problem while working on the complete solution.

Diagnosis

If you are not seeing a timeout error message in the UI you can confirm the problem using your browser's developer tools. For this document, we will provide detailed steps for Chrome.

These instructions are adapted from Generating HAR files and Analysing Web Requests.

  1. Open up Chrome and display the Developer Tools.
  2. Select the Network tab.
  3. Load the page with the problem and repeat the steps that trigger the issue.

In the Network tab, look for any requests that do not have an HTTP response code:

If you are reporting this issue to Atlassian Support, right click inside the Network tab area and select Save as HAR with content then attach the HAR file to your support ticket.

Cause

JIRA has a default AJAX timeout period so that requests in the browser do not run for unlimited amounts of time. Normally 30 seconds is plenty of time for a typical data request.

AJAX timeouts can be caused by many different things. Once you know the URL that is timing out this will suggest what types of operations are slow: JQL query, database query, the network itself, etc.

Workaround

Temporarily increase the global AJAX timeout so that users can continue working (albeit more slowly) while you troubleshoot the underlying problem.

(warning) If you are experiencing AJAX timeouts the underlying problem must be addressed as quickly as possible because it could become worse and may indicate that a crash is looming.

  1. Create an Announcement Banner from Administration > System > User Interface > Announcement Banner. This will not be visible, it will be used to add JavaScript to every page in JIRA.
  2. Add this HTML+JavaScript code as the banner contents:

    <script type="module">
    AJS.$.ajaxSetup({
    	timeout: 60000 // Milliseconds, 60 seconds in this example.
    });
    </script>
  3. For "Visiblity Level" select "Private" (logged in users only).
  4. Save the banner.

After you make this change confirm that the timeout no longer occurs. If it is you may need to increase the timeout further. Set it to 0 to wait forever.

Resolution

As mentioned above, resolving the cause of the AJAX timeout will depend on what URL is timing out and what problems are affecting your JIRA installation. Please see Troubleshooting Performance Problems.


Last modified on Oct 18, 2022

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.