Users receive a 504 Gateway Time-out error in Jira Data Center when switching the issue type scheme from a project
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
When switching the issue type scheme from a project containing many issues, users can receive a 504 Gateway Time-out error, interrupting the process.
Environment
Jira Data Center with a reverse proxy such as NGINX.
Diagnosis
The following warning can appear in $JIRA_INSTALL/logs/catalina.out, indicating that a request for the /MigrateIssueTypes!chooseContext.jspa endpointis taking a long time to complete:
1
2
3
4
5
6
7
Thread [http-nio-8080-exec-18] (id=[3291103]) has been active for [127,075] milliseconds to serve the same request for [http://localhost:8080/secure/admin/MigrateIssueTypes!chooseContext.jspa] and may be stuck (configured threshold for this StuckThreadDetectionValve is [120] seconds). There is/are [1] thread(s) in total that are monitored by this Valve and may be stuck.
java.lang.Throwable
...
at com.atlassian.jira.issue.customfields.persistence.EagerLoadingOfBizCustomFieldPersister.getValuesForIssueId(EagerLoadingOfBizCustomFieldPersister.java:114)
at com.atlassian.jira.issue.customfields.persistence.EagerLoadingOfBizCustomFieldPersister.getValuesForTypeAndParent(EagerLoadingOfBizCustomFieldPersister.java:98)
at com.atlassian.jira.issue.customfields.persistence.OfBizCustomFieldValuePersister.getValues(OfBizCustomFieldValuePersister.java:80)
at com.atlassian.jira.issue.customfields.persistence.OfBizCustomFieldValuePersister.getValues(OfBizCustomFieldValuePersister.java:71)
In the example above, the thread is executing the com.atlassian.jira.issue.customfields.persistence.EagerLoadingOfBizCustomFieldPersister.getValuesForIssueId method, which matches the following bug report: JRASERVER-70397 - Bulk issue move operations are slow and performance is degraded with small EagerLoadingOfBizCustomFieldPersister cache
Cause
(For Jira 9.2.x and older versions only) The issue type scheme migration can take longer than expected due to the following bug report, which significantly increases the time it takes to complete the migration process: JRASERVER-70397 - Bulk issue move operations are slow and performance is degraded with small EagerLoadingOfBizCustomFieldPersister cache
The Request timeout can be set to a low value in a proxy level (30 seconds, for example), which may not be enough time to handle issue type scheme migrations involving several issues.
Solution
Solution 1 (For Jira 9.2.x and older versions only)
Increase the cache size parameter (jira.customfield.values.cache.max.size) to better handle a higher number of issues (set to 10 by default). This can be done by adding the following JVM startup argument to increase the cache size to 1000:
1
-Djira.customfield.values.cache.max.size=1000
This setting must be added to all nodes on Jira, and it will only take effect after restarting all nodes. The nodes can be restarted one at a time.
Solution 2
Increase the proxy timeout parameter to a higher value (300 seconds, for example) to ensure Jira will have enough time to finish the issue type scheme migration.
Solution 3
Change the issue type scheme from the affected project while bypassing your proxy, ensuring the request will not time out.
Was this helpful?