-
Bug
-
Resolution: Fixed
-
High
-
8.8.0, 8.9.0, 8.8.1, 8.9.1, 9.1.0, 9.0.1, 9.0.2
-
1
-
Severity 2 - Major
-
12
-
Issue Summary
We observe a StackOverflowError when calling contentTemplateService.find() method.
Steps to Reproduce
- Create a space template
- Open a space, then Space Tools >> Content Tools >> Templates >> hit "Create New Template" button
- Fill the page with some content and save it.
- Obtain an ID of the created space template
- In the space you created the space template, go to Space Tools >> Content Tools >> Templates
- Click on the space template you just created, under User Created Templates section
- Get the space template id from the URL of the opened page. That's the number you see attributed to the entityId - on the example below, the space template id would be 1179649
https://<base_URL>/confluence/pages/templates2/viewpagetemplate.action?entityId=1179649&key=FIR
- Try to find the template by its ID via com.atlassian.confluence.api.service.content.template.ContentTemplateService#find
contentTemplateService.find() .withId(ContentTemplateId.fromLong(contentId)) .fetchOrNull()
Expected Results
The find method returns the template object found.
Actual Results
The below StackOverflowError exception is thrown in the atlassian-confluence.log file:
2024-06-27 20:37:53,587 ERROR [http-nio-8090-exec-23 url: /confluence/rest/tinymce/1/macro/preview; user: admin] [xhtml.view.macro.ViewMacroMarshaller] handleMacroExecutionException Error rendering macro: ConnieMacroRestApi2 -- url: /confluence/rest/tinymce/1/macro/preview | userName: admin | referer: https://confluence.mycompany.com/confluence/pages/resumedraft.action?draftId=131145&draftShareId=0eee8b0b-8942-4bde-9005-5d07c084afec& | traceId: afbd28189f64a4fc java.lang.StackOverflowError at com.atlassian.confluence.api.service.finder.SingleFetcher.fetchOneOrNull(SingleFetcher.java:32) at com.atlassian.confluence.plugins.createcontent.factory.TemplateFinderFactory$TransactionWrappingContentFinder.fetchOrNull(TemplateFinderFactory.java:124) at com.atlassian.confluence.plugins.createcontent.factory.TemplateFinderFactory$TransactionWrappingContentFinder.fetchOrNull(TemplateFinderFactory.java:96) at com.atlassian.confluence.api.service.finder.SingleFetcher.fetchOneOrNull(SingleFetcher.java:32) at com.atlassian.confluence.plugins.createcontent.factory.TemplateFinderFactory$TransactionWrappingContentFinder.fetchOrNull(TemplateFinderFactory.java:124) at com.atlassian.confluence.plugins.createcontent.factory.TemplateFinderFactory$TransactionWrappingContentFinder.fetchOrNull(TemplateFinderFactory.java:96) at com.atlassian.confluence.api.service.finder.SingleFetcher.fetchOneOrNull(SingleFetcher.java:32) at com.atlassian.confluence.plugins.createcontent.factory.TemplateFinderFactory$TransactionWrappingContentFinder.fetchOrNull(TemplateFinderFactory.java:124) at com.atlassian.confluence.plugins.createcontent.factory.TemplateFinderFactory$TransactionWrappingContentFinder.fetchOrNull(TemplateFinderFactory.java:96) at com.atlassian.confluence.api.service.finder.SingleFetcher.fetchOneOrNull(SingleFetcher.java:32) at com.atlassian.confluence.plugins.createcontent.factory.TemplateFinderFactory$TransactionWrappingContentFinder.fetchOrNull(TemplateFinderFactory.java:124)
Workaround
Currently there is no known workaround for this behavior. A workaround will be added here when available
A fix for this issue is available in Confluence Server and Data Center 9.0.3.
Upgrade now or check out the Release Notes to see what other issues are resolved.