Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-96038

contentTemplateService#find method throws StackOverflowError

      Issue Summary

      We observe a StackOverflowError when calling contentTemplateService.find() method.

      Steps to Reproduce

      1. Create a space template
        1. Open a space, then Space Tools >> Content Tools >> Templates >> hit "Create New Template" button
        2. Fill the page with some content and save it.
      2. Obtain an ID of the created space template
        1. In the space you created the space template, go to Space Tools >> Content Tools >> Templates
        2. Click on the space template you just created, under User Created Templates section
        3. 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
          1. https://<base_URL>/confluence/pages/templates2/viewpagetemplate.action?entityId=1179649&key=FIR 
      3. 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

            [CONFSERVER-96038] contentTemplateService#find method throws StackOverflowError

            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.

            Jordan Anslow added a comment - 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.

            Steve Shaw added a comment -

            Hello,

            This issue has been both reported and confirmed on a recent version of Confluence and therefore has been subsequently re-opened. It will be monitored for further activity and continue to be reviewed in accordance to our Bugfix Policy

            Cheers,

            Steve

            Steve Shaw added a comment - Hello, This issue has been both reported and confirmed on a recent version of Confluence and therefore has been subsequently re-opened. It will be monitored for further activity and continue to be reviewed in accordance to our Bugfix Policy .  Cheers, Steve

            Hi there,

            We came across this bug again, but this time it occurred with Confluence 9.0.1.
            Could you please introduce the same fix for Confluence 9?

            Alexander Ovsyannikov added a comment - Hi there, We came across this bug again, but this time it occurred with Confluence 9.0.1. Could you please introduce the same fix for Confluence 9?

            A fix for this issue is available in Confluence Server and Data Center 8.9.5.
            Upgrade now or check out the Release Notes to see what other issues are resolved.

            Akshay Rai added a comment - A fix for this issue is available in Confluence Server and Data Center 8.9.5. Upgrade now or check out the Release Notes to see what other issues are resolved.

              5339cdd01cf4 Jeffery Xie
              d863d84a35c4 Gustavo Serrano (Inactive)
              Affected customers:
              10 This affects my team
              Watchers:
              9 Start watching this issue

                Created:
                Updated:
                Resolved: