Users encountering intermittent issues with Jira macros
Platform Notice: Data Center - This article applies to Atlassian products on the Data Center platform.
Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles 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
Users may encounter the error "Error rendering macro 'jira'" when trying to display Jira macros within Confluence pages. These errors are often transient, resolving themselves after a few minutes or hours.
Environment
Confluence Data Center 7.x,
Confluence Data Center 8.x
Diagnosis
When the issue arises, you may notice an error message in the atlassian-confluence.log file. The error typically indicates issues related to pool size, active threads, and queued tasks. An example log entry is as follows:
2024-08-25 22:34:07,855 ERROR [http-nio-8080-exec-740] [xhtml.view.macro.ViewMacroMarshaller] handleMacroExecutionException Error rendering macro: jira
-- url: /confluence/pages/viewpage.action | traceId: 6c5728dda552200f | userName: <username> | action: viewpage | page: <pageid>
java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.FutureTask@a616946 rejected from java.util.concurrent.ThreadPoolExecutor@3e4f88f6[Running, pool size = 5, , active threads = 5, queued tasks = 1000, completed tasks = 1585899]
Error seen on Confluence UI.
.
Cause
The error is primarily related to a performance bottleneck, not an integration issue between Jira and Confluence. Specifically, it pertains to the thread pool responsible for fetching data from Jira to render the Jira Issues macro. The error arises when there's an overwhelming number of requests within a short time frame.
Technical Explanation:
- Confluence uses a separate thread pool, known as the JIM Marshaller thread pool, to handle requests for rendering Jira Issues macros.
- In the given error, the line `pool size = 5, active threads = 5` indicates that all 5 threads are currently busy, while `queued tasks = 1000` shows that the queue is at its maximum capacity.
- Since the queue can hold up to 1000 tasks, any additional request gets rejected, leading to the error message.
Solution
To resolve this issue, consider the following steps:
1. Identify Potential Causes:
- Check if there are any scripts or automated processes running on this Confluence instance that pull data from Jira.
- Check any pages that might have more than 1000 Jira issues configured, which could be overwhelming the system.
2. Increase Thread Pool and Queue Size:
- If identifying the source of the high demand is not feasible, you can increase the thread pool size from 5 to 10 and the queue size from 1000 to 2000. This change will allow the system to handle more concurrent requests and queued tasks.
- To implement this solution, incorporate the following JVM startup parameters into the setenv.sh file and then restart the Confluence:
CATALINA_OPTS="-Dconfluence.jira.issues.executor.poolsize=10 ${CATALINA_OPTS}"
CATALINA_OPTS="-Dconfluence.jira.issues.executor.queuesize=2000 ${CATALINA_OPTS}"