Confluence search fail with HTTP 500 error

Still need help?

The Atlassian Community is here for you.

Ask the community

For Atlassian eyes only

This article is Not Validated and cannot be shared with customers.


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

Problem

Try to do a search on the Confluence using the search box on the top right of the screen, a spinning wheel appear and not result is returned.

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

Diagnosis

The search fails with HTTP 500 error, checking the atlassian-confluence.logs it's possible to see this error:


2020-07-17 16:37:45,210 ERROR [ajp-nio-127.0.0.1-8009-exec-208] [[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

java.lang.StackOverflowError
	at java.util.regex.Pattern$Branch.match(Pattern.java:4618)
	at java.util.regex.Pattern$GroupHead.match(Pattern.java:4672)
	at java.util.regex.Pattern$Branch.match(Pattern.java:4618)
	at java.util.regex.Pattern$GroupHead.match(Pattern.java:4672)
	at java.util.regex.Pattern$Loop.match(Pattern.java:4799)
	at java.util.regex.Pattern$GroupTail.match(Pattern.java:4731)
	at java.util.regex.Pattern$BranchConn.match(Pattern.java:4582)
	at java.util.regex.Pattern$BmpCharProperty.match(Pattern.java:3812)


The lines related to java.util.regex.Pattern go on forever for hundred of lines.

Cause

Every thread in the Java Applications has a stack used to save return addresses. In scenarios where the amount of returned addresses is too big, the system runs out of memory to hold the information and fail to complete the search.

Resolution

Increase the Java parameter -Xss to a higher value. The default value is 1024K. Increasing it to 2MB should be enough: -Xss2m.

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, therefor an increase in the Java Heap can be necessary. 




Last modified on Jul 30, 2020

Was this helpful?

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