Issue Summary

      This is reproducible on Data Center: (yes)

      Confluence returns HTTP 500 while calling the below REST API endpoint if the instance has more than 1 space.

      <Confluence Base URL>/rest/api/search?cql=type=space&expand=space.metadata.labels,space.homepage
      

      Steps to Reproduce

      1. Create a Confluence 8.5.12 version
      2. Create 2 spaces on Confluence
      3. Send a GET request to the below URL;
        <Confluence Base URL>/rest/api/search?cql=type=space&expand=space.metadata.labels,space.homepage
        
      4. Getting HTTP 500 message and in the application logs there is below stack trace;
        2024-07-18 07:12:19,393 ERROR [http-nio-8090-exec-3 url: /confluence/rest/api/search; user: admin] [rest.api.model.ExceptionConverter] convertServiceException No status code found for exception, converting to internal server error :
         -- url: /confluence/rest/api/search | userName: admin | traceId: cf5bbc493df02390
        com.atlassian.confluence.api.impl.pagination.BatchExecutionException: Error during batch execution with session management
        	at com.atlassian.confluence.api.impl.pagination.PaginationServiceImpl.executeBatchWithSessionManagement(PaginationServiceImpl.java:281)
        	at com.atlassian.confluence.api.impl.pagination.PaginationServiceImpl.lambda$doRequestInTransaction$1(PaginationServiceImpl.java:263)
        	at com.atlassian.confluence.api.impl.ReadOnlyAndReadWriteTransactionConversionTemplate.executeInReadOnly(ReadOnlyAndReadWriteTransactionConversionTemplate.java:38)
        	at com.atlassian.confluence.api.impl.pagination.PaginationServiceImpl.doRequestInTransaction(PaginationServiceImpl.java:261)
        . . .
        Caused by: org.hibernate.HibernateException: Unable to resolve owner of loading collection [[com.atlassian.confluence.core.ContentEntityObject.contentProperties#394111]] for second level caching
        	at org.hibernate.engine.loading.internal.CollectionLoadContext.addCollectionToCache(CollectionLoadContext.java:360)
        	at org.hibernate.engine.loading.internal.CollectionLoadContext.endLoadingCollection(CollectionLoadContext.java:299)
        	at org.hibernate.engine.loading.internal.CollectionLoadContext.endLoadingCollections(CollectionLoadContext.java:224)
        	at org.hibernate.engine.loading.internal.CollectionLoadContext.endLoadingCollections(CollectionLoadContext.java:198)
        	at org.hibernate.loader.Loader.endCollectionLoad(Loader.java:1257)
        	at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:1214)
        

      The issue is only reproducible while using space.metadata.labels and space.homepage expand parameters at the same time. Confluence responds without any problem while using these parameters independently.

      Expected Results

      The space information should be listed after calling the URL.

      Actual Results

      Getting HTTP 500 after calling the Rest API endpoint.

      Workaround

      Option 1: Using space.metadata.labels and space.homepage parameters independently like below;

      <Confluence Base URL>/rest/api/search?cql=type=space&expand=space.homepage
      <Confluence Base URL>/rest/api/search?cql=type=space&expand=space.metadata.labels
      

      Option 2: Using limit and start parameters to get only 1 space data from Rest API;

      <Confluence Base URL>/rest/api/search?cql=type=space&expand=space.metadata.labels,space.homepage&limit=1&start=0
      

            [CONFSERVER-96157] Getting HTTP 500 after calling Rest API for Space data

            Docker images for 8.5.14 have now been published. apologies for the delay. https://hub.docker.com/r/atlassian/confluence/tags?page=&page_size=&ordering=&name=8.5.14

            James Whitehead added a comment - Docker images for 8.5.14 have now been published. apologies for the delay. https://hub.docker.com/r/atlassian/confluence/tags?page=&page_size=&ordering=&name=8.5.14

            Also asking when the docker for 8.5.14 is available.

            Rebecca Häußler added a comment - Also asking when the docker for 8.5.14 is available.

            Jeany added a comment -

            When will the docker images for Confluence 8.5.14 be available?

            Jeany added a comment - When will the docker images for Confluence 8.5.14 be available?

            A fix for this issue is available in Confluence Server and Data Center 8.5.14
            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.5.14 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 7.19.26.
            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 7.19.26. Upgrade now or check out the Release Notes to see what other issues are resolved.

            Can you please answer the question about the LTS release date? Or just release it if that is faster than answering us? 

            We need to know if the LTS (7.19.x, 8.5.x) releases are imminent (hours away) or if they are coming later (days or weeks away) because our strategy for working through this for the LTS versions is going to be based on what Atlassian's release schedule is.

            By the way, an RCA should probably be done on how this got past QA. How do you not use your own space REST APIs all over the place like in CI test setup/teardown? That this got past QA is revealing and could be a worthwhile study, imo.

            Thanks!

            Ture Hoefner {Appfire} added a comment - Can you please answer the question about the LTS release date? Or just release it if that is faster than answering us?  We need to know if the LTS (7.19.x, 8.5.x) releases are imminent (hours away) or if they are coming later (days or weeks away) because our strategy for working through this for the LTS versions is going to be based on what Atlassian's release schedule is. By the way, an RCA should probably be done on how this got past QA. How do you not use your own space REST APIs all over the place like in CI test setup/teardown? That this got past QA is revealing and could be a worthwhile study, imo. Thanks!

            Hey, 
            is there a date yet for the LTS release? 

            Rebecca Häußler added a comment - Hey,  is there a date yet for the LTS release? 

            Great news! Thanks for releasing this important fix!

            Yavor Christov added a comment - Great news! Thanks for releasing this important fix!

            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.

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

            James Whitehead added a comment - A fix for this issue is available in Confluence Data Center 9.0.1. Upgrade now or check out the Release Notes to see what other issues are resolved.

              854eef6f5746 Kusal Kithul-Godage
              ae95049760ab Kaan Çalışkan
              Affected customers:
              54 This affects my team
              Watchers:
              70 Start watching this issue

                Created:
                Updated:
                Resolved: