Confluence search fail with HTTP 500 error

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.


When performing a search within Confluence while using the search box located on the top right of the screen, a spinning wheel appear and a result isn't returned.


Checking the browser logs (for example: in Chrome, F12 or View > Developer > Developer Tools > Network tab), it's possible to see a HTTP 500 Error:

If you cross-check this error with the atlassian-confluence.logs, it's possible to see the following error:

2020-07-17 16:37:45,210 ERROR [ajp-nio-] [[Standalone].[localhost].[/].[file-server]] log Servlet.service() for servlet [file-server] threw exception
 -- referer: https://XXXXXXXX | url: /s/XXXXXXXX-CDN/XX/XXX/XXXXX/XXXXXXX/_/download/contextbatch/js/confluence-search-ui-plugin-main,-_super/batch.js | traceId: XXXXXX | userName: XXXXX

	at java.util.regex.Pattern$Branch.match(
	at java.util.regex.Pattern$GroupHead.match(
	at java.util.regex.Pattern$Branch.match(
	at java.util.regex.Pattern$GroupHead.match(
	at java.util.regex.Pattern$Loop.match(
	at java.util.regex.Pattern$GroupTail.match(
	at java.util.regex.Pattern$BranchConn.match(
	at java.util.regex.Pattern$BmpCharProperty.match(

The lines related to java.util.regex.Pattern repeat for hundreds of lines.


Every thread in a Java application has a stack that's used to save the return address between method calls and method call arguments amongst other things.  In scenarios where a thread is processing a large data structure, it's possible that the system can run out of memory for the stack.  In this case, where the Confluence site contained a high volume of content, Confluence fails to complete the search.


Increase the Java parameter -Xss to a higher value. The default value for a Linux 64 bit system is 1024K.  Increasing this to 2MB should be enough to allow the search to complete: -Xss2m.  To take effect, Confluence will need to be restarted.

Memory consumption

If the issue continue to happens, it's possible to increase it even further. However, this will increase the memory consumption by the JVM since each Thread will be able to use more memory. Therefore, an increase in the Java Heap may also be necessary. 

Since the default Xss value can differ between operating systems and Java versions, please run the following command to determine its current value:

java -XX:+PrintFlagsFinal -version | grep ThreadStackSize

Last modified on Oct 20, 2020

Was this helpful?

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