Issue Summary
This is reproducible on Data Center: (yes)
Customers can't move a page under another page with more than 300 child pages by using the move function under the page.
Steps to Reproduce
- Create a fresh instance
- Create test space
- Populate test space with 300 pages
- Attempt to move one of the pages to test space that has 300 child pages
- Move fails immediately
Expected Results
Moving the page to the destination and navigate to there.
Actual Results
Page move fails with the following error message;
In the logs, it can be observed multiple error messages. Not all of them happen simultaneously, but in most of them you can observe the method com.atlassian.confluence.pages.Page.hasChildren and the class MovePageCommandImpl as part of the error stack trace involved.
See below some examples:
- ConcurrentModificationException
2023-04-06 09:07:06,270 INFO [http-nio-8090-exec-8] [atlassian.xwork.interceptors.TransactionalInvocation] handleInvocationException Invoking rollback for transaction on action '/pages/movepage.action (MovePageAction.execute())' due to throwable: java.util.ConcurrentModificationException -- referer: <ConfluenceBaseURL>/confluence/pages/viewpage.action?pageId=1114118&moved=true | url: /confluence/pages/movepage.action | traceId: 8e2dde3660ef6b84 | userName: admin java.util.ConcurrentModificationException at java.base/java.util.LinkedHashMap$LinkedHashIterator.nextNode(LinkedHashMap.java:719) at java.base/java.util.LinkedHashMap$LinkedEntryIterator.next(LinkedHashMap.java:751) at java.base/java.util.LinkedHashMap$LinkedEntryIterator.next(LinkedHashMap.java:749) at org.hibernate.internal.util.collections.IdentityMap.entryArray(IdentityMap.java:145) at org.hibernate.internal.util.collections.IdentityMap.concurrentEntries(IdentityMap.java:57) ... ...
- IllegalStateException: Session/EntityManager is closed
2023-04-06 08:50:48,314 ERROR [Long running task: Move Page] [core.task.longrunning.AbstractLongRunningTask] runInternal move page failed. -- url: /confluence/pages/movepage.action | referer: <ConfluenceBaseURL>/confluence/pages/viewpage.action?pageId=1212418&moved=true | traceId: 9c76218dbaa426b2 | userName: admin | action: movepage java.lang.IllegalStateException: Session/EntityManager is closed at org.hibernate.internal.AbstractSharedSessionContract.checkOpen(AbstractSharedSessionContract.java:344) at org.hibernate.engine.spi.SharedSessionContractImplementor.checkOpen(SharedSessionContractImplementor.java:137) at org.hibernate.internal.AbstractSharedSessionContract.checkOpenOrWaitingForAutoClose(AbstractSharedSessionContract.java:350) at org.hibernate.internal.SessionImpl.getPersistenceContext(SessionImpl.java:2315) at org.hibernate.type.CollectionType.getCollection(CollectionType.java:771) ... ... at com.atlassian.confluence.pages.Page.hasChildren(Page.java:121) at com.atlassian.confluence.content.service.page.MovePageCommandImpl.executeInternal(MovePageCommandImpl.java:120) at com.atlassian.confluence.core.service.AbstractServiceCommand$ServiceCommandState$2.execute(AbstractServiceCommand.java:148) at com.atlassian.confluence.core.service.AbstractServiceCommand.execute(AbstractServiceCommand.java:60) at com.atlassian.confluence.content.service.page.LongRunningTaskMovePageCommandDecorator.runInternal(LongRunningTaskMovePageCommandDecorator.java:68) at com.atlassian.confluence.util.longrunning.ConfluenceAbstractLongRunningTask.run(ConfluenceAbstractLongRunningTask.java:26) ... ...
- IllegalStateException: org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl@1cb46a2c is closed
2023-04-06 09:47:47,654 ERROR [Long running task: Move Page] [core.task.longrunning.AbstractLongRunningTask] runInternal move page failed. -- url: /confluence/pages/movepage.action | referer: <ConfluenceBaseURL>/confluence/display/CT/Parent3 | traceId: 38a803e06dbf36cc | userName: admin | action: movepage java.lang.IllegalStateException: org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl@1cb46a2c is closed at org.hibernate.resource.jdbc.internal.AbstractLogicalConnectionImplementor.errorIfClosed(AbstractLogicalConnectionImplementor.java:37) at org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.getPhysicalConnection(LogicalConnectionManagedImpl.java:135) at org.hibernate.engine.jdbc.internal.StatementPreparerImpl.connection(StatementPreparerImpl.java:47) at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$5.doPrepare(StatementPreparerImpl.java:146) at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:172) ... ... at org.hibernate.collection.internal.PersistentBag.size(PersistentBag.java:261) at com.atlassian.confluence.pages.Page.hasChildren(Page.java:121) at com.atlassian.confluence.content.service.page.MovePageCommandImpl.executeInternal(MovePageCommandImpl.java:120) at com.atlassian.confluence.core.service.AbstractServiceCommand$ServiceCommandState$2.execute(AbstractServiceCommand.java:148) at com.atlassian.confluence.core.service.AbstractServiceCommand.execute(AbstractServiceCommand.java:60)
- SQLException: You can't operate on a closed ResultSet!!!
2023-04-06 09:26:43,464 INFO [http-nio-8090-exec-2] [atlassian.xwork.interceptors.TransactionalInvocation] handleInvocationException Invoking rollback for transaction on action '/pages/movepage.action (MovePageAction.execute())' due to throwable: java.lang.IllegalStateException: getOutputStream() has already been called for this response -- referer: <ConfluenceBaseURL>/confluence/display/CT/Parent1 | url: /confluence/pages/movepage.action | traceId: afda340cc6a022e6 | userName: admin java.lang.IllegalStateException: getOutputStream() has already been called for this response at org.apache.catalina.connector.Response.getWriter(Response.java:584) at org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade.java:227) at javax.servlet.ServletResponseWrapper.getWriter(ServletResponseWrapper.java:114) .... Caused by: java.sql.SQLException: You can't operate on a closed ResultSet!!! at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:118) at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:77) at com.mchange.v2.c3p0.impl.NewProxyResultSet.getString(NewProxyResultSet.java:2817) ... Caused by: java.lang.NullPointerException at com.mchange.v2.c3p0.impl.NewProxyResultSet.getString(NewProxyResultSet.java:2811) ... 45 more
- PSQLException: This ResultSet is closed
2023-04-06 09:17:10,335 ERROR [Long running task: Move Page] [core.task.longrunning.AbstractLongRunningTask] runInternal move page failed. -- url: /confluence/pages/movepage.action | referer: <ConfluenceBaseURL>/confluence/display/CT/Parent2 | traceId: 89a1d9e3f7c52a33 | userName: admin | action: movepage org.hibernate.exception.GenericJDBCException: could not initialize a collection: [com.atlassian.confluence.pages.Page.children#1114305] at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:47) at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:111) at org.hibernate.loader.Loader.loadCollection(Loader.java:2411) ... ... Caused by: org.postgresql.util.PSQLException: This ResultSet is closed. at org.postgresql.jdbc.PgResultSet.checkClosed(PgResultSet.java:3115) at org.postgresql.jdbc.PgResultSet.getRawValue(PgResultSet.java:3146) at org.postgresql.jdbc.PgResultSet.getString(PgResultSet.java:2225) at org.postgresql.jdbc.PgResultSet.getTimestamp(PgResultSet.java:629) ... ...
- SQLException: Closed Resultset: findColumn or SQLException: Closed Resultset: next
2023-03-31 08:07:29,236 ERROR [Long running task: Move Page] [confluence.util.longrunning.ConfluenceAbstractLongRunningTask] run Long running task "Move Page" failed to run. -- url: /pages/movepage.action | traceId: f7bfde8cb43092f5 | userName: admin | referer: <ConfluenceBaseURL>/confluence/display/CT/Parent2 | action: movepage org.hibernate.exception.GenericJDBCException: could not initialize a collection: [com.atlassian.confluence.pages.Page.children#1114305] at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:47) at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:111) at org.hibernate.loader.Loader.loadCollection(Loader.java:2411) ... ... Caused by: java.sql.SQLException: Closed Resultset: findColumn at oracle.jdbc.driver.InsensitiveScrollableResultSet.ensureOpen(InsensitiveScrollableResultSet.java:116) at oracle.jdbc.driver.InsensitiveScrollableResultSet.findColumn(InsensitiveScrollableResultSet.java:269) at oracle.jdbc.driver.GeneratedResultSet.getLong(GeneratedResultSet.java:560) at com.zaxxer.hikari.pool.HikariProxyResultSet.getLong(HikariProxyResultSet.java) at org.hibernate.type.descriptor.sql.BigIntTypeDescriptor$2.doExtract(BigIntTypeDescriptor.java:63) ... ...
- NullPointerException
2023-04-04 06:49:57,880 ERROR [Long running task: Move Page] [engine.jdbc.spi.SqlExceptionHelper] logExceptions This ResultSet is closed. -- url: /confluence/pages/movepage.action | userName: admin | action: movepage | referer: <ConfluenceBaseURL>/confluence/pages/viewpage.action?pageId=65544 | traceId: 008d0a29a70ebd13 2023-04-04 06:49:57,880 WARN [http-nio-8090-exec-12] [engine.loading.internal.LoadContexts] cleanup HHH000100: Fail-safe cleanup (collections) : org.hibernate.engine.loading.internal.CollectionLoadContext@6b120837<rs=HikariProxyResultSet@765020789 wrapping org.postgresql.jdbc.PgResultSet@5310d300> -- url: /confluence/pages/movepage.action | referer: <ConfluenceBaseURL>/confluence/pages/viewpage.action?pageId=65544 | traceId: 008d0a29a70ebd13 2023-04-04 06:49:57,882 WARN [http-nio-8090-exec-12] [engine.loading.internal.CollectionLoadContext] cleanup HHH000160: On CollectionLoadContext#cleanup, localLoadingCollectionKeys contained [1] entries -- url: /confluence/pages/movepage.action | referer: <ConfluenceBaseURL>/confluence/pages/viewpage.action?pageId=65544 | traceId: 008d0a29a70ebd132023-04-04 06:49:57,882 ERROR [Long running task: Move Page] [core.task.longrunning.AbstractLongRunningTask] runInternal move page failed. -- url: /confluence/pages/movepage.action | userName: admin | action: movepage | referer: <ConfluenceBaseURL>/confluence/pages/viewpage.action?pageId=65544 | traceId: 008d0a29a70ebd13 java.lang.NullPointerException at org.hibernate.collection.internal.AbstractPersistentCollection.withTemporarySessionIfNeeded(AbstractPersistentCollection.java:284) at org.hibernate.collection.internal.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:162) at org.hibernate.collection.internal.PersistentBag.size(PersistentBag.java:371) at com.atlassian.confluence.pages.Page.hasChildren(Page.java:121) at com.atlassian.confluence.content.service.page.MovePageCommandImpl.executeInternal(MovePageCommandImpl.java:120) at com.atlassian.confluence.core.service.AbstractServiceCommand$ServiceCommandState$2.execute(AbstractServiceCommand.java:148) at com.atlassian.confluence.core.service.AbstractServiceCommand.execute(AbstractServiceCommand.java:60) at com.atlassian.confluence.content.service.page.LongRunningTaskMovePageCommandDecorator.runInternal(LongRunningTaskMovePageCommandDecorator.java:68) at ... .... 2023-04-04 06:49:57,887 ERROR [Long running task: Move Page] [confluence.util.longrunning.ConfluenceAbstractLongRunningTask] run Long running task \"Move Page\" failed to run. -- url: /confluence/pages/movepage.action | userName: admin | action: movepage | referer: <ConfluenceBaseURL>/confluence/pages/viewpage.action?pageId=65544 | traceId: 008d0a29a70ebd13 java.lang.NullPointerException at org.hibernate.collection.internal.AbstractPersistentCollection.withTemporarySessionIfNeeded(AbstractPersistentCollection.java:284) at org.hibernate.collection.internal.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:162) at org.hibernate.collection.internal.PersistentBag.size(PersistentBag.java:371) at com.atlassian.confluence.pages.Page.hasChildren(Page.java:121) at com.atlassian.confluence.content.service.page.MovePageCommandImpl.executeInternal(MovePageCommandImpl.java:120) at com.atlassian.confluence.core.service.AbstractServiceCommand$ServiceCommandState$2.execute(AbstractServiceCommand.java:148) at com.atlassian.confluence.core.service.AbstractServiceCommand.execute(AbstractServiceCommand.java:60) at com.atlassian.confluence.content.service.page.LongRunningTaskMovePageCommandDecorator.runInternal(LongRunningTaskMovePageCommandDecorator.java:68) at com.atlassian.confluence.util.longrunning.ConfluenceAbstractLongRunningTask.run(ConfluenceAbstractLongRunningTask.java:26) ... ...
- Exception related with ThreadSafeCheckingSessionEventListener.checkThread
2023-04-06 08:50:11,825 ERROR [Long running task: Move Page] [atlassian.hibernate.util.ThreadSafeCheckingSessionEventListener] checkThread Session called from wrong thread -- url: /confluence/pages/movepage.action | referer: <ConfluenceBaseURL>/confluence/display/CT/Parent2 | traceId: 6f6bf57d47135c95 | userName: admin | action: movepage java.lang.Exception at com.atlassian.hibernate.util.ThreadSafeCheckingSessionEventListener.checkThread(ThreadSafeCheckingSessionEventListener.java:129) at com.atlassian.hibernate.util.ThreadSafeCheckingSessionEventListener.cacheGetStart(ThreadSafeCheckingSessionEventListener.java:83) at org.hibernate.engine.internal.SessionEventListenerManagerImpl.cacheGetStart(SessionEventListenerManagerImpl.java:181) at org.hibernate.engine.internal.CacheHelper.fromSharedCache(CacheHelper.java:30) at org.hibernate.event.internal.DefaultInitializeCollectionEventListener.initializeCollectionFromCache(DefaultInitializeCollectionEventListener.java:121) ... ... at com.atlassian.confluence.pages.Page.hasChildren(Page.java:121) at com.atlassian.confluence.content.service.page.MovePageCommandImpl.executeInternal(MovePageCommandImpl.java:120) at com.atlassian.confluence.core.service.AbstractServiceCommand$ServiceCommandState$2.execute(AbstractServiceCommand.java:148) at com.atlassian.confluence.core.service.AbstractServiceCommand.execute(AbstractServiceCommand.java:60) at com.atlassian.confluence.content.service.page.LongRunningTaskMovePageCommandDecorator.runInternal(LongRunningTaskMovePageCommandDecorator.java:68) at com.atlassian.confluence.util.longrunning.ConfluenceAbstractLongRunningTask.run(ConfluenceAbstractLongRunningTask.java:26) ... ...
- GenericJDBCException: could not initialize a collection
2023-04-06 09:26:43,501 ERROR [Long running task: Move Page] [core.task.longrunning.AbstractLongRunningTask] runInternal move page failed. -- url: /confluence/pages/movepage.action | referer: <ConfluenceBaseURL>/confluence/display/CT/Parent1 | traceId: afda340cc6a022e6 | userName: admin | action: movepage org.hibernate.exception.GenericJDBCException: could not initialize a collection: [com.atlassian.confluence.pages.Page.children#1212424] at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:47) at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:111) at org.hibernate.loader.Loader.loadCollection(Loader.java:2411) at org.hibernate.loader.collection.plan.LegacyBatchingCollectionInitializerBuilder$LegacyBatchingCollectionInitializer.initialize(LegacyBatchingCollectionInitializerBuilder.java:88) at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:688) at org.hibernate.event.internal.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:75) ...
Workaround
- To ensure a successful move, click on the reorder box before clicking the Move page button.
Note:
- If you receive the error message "Move failed. There was a problem contacting the server", it is possible that the move has actually been successful. Try refreshing the page and you should be able to see that the page has been moved to the correct parent. It is likely that this error message is a follow-up to the "Page Move failed" error message that you may have encountered earlier.
- relates to
-
CONFSERVER-44950 Large page tree move fails after 3 minutes
- Closed
- resolves
-
HOT-102746 Loading...