java.lang.IllegalStateException: ClobStringType requires active transaction synchronization

Atlassian JIRA | James Richards [Atlassian] | 3 months ago
  1. 0

    h3. Summary Confluence throws {{java.lang.IllegalStateException: ClobStringType requires active transaction synchronization}} in the log files. This is often followed by the same error as logged in CONF-43246, however the steps to reproduce {{net.sf.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: 29261827, of class: com.atlassian.confluence.pages.Page}} in that ticket does not generate this error. h3. Environment Based on investigation of support tickets, I have seen this error in: h4. Database * Microsoft SQL Server * MySQL * PostgreSQL * Oracle 12c h4. Add-Ons The only Add-ons in common for the customer issues were all default Confluence Add-Ons * atlassian-gadgets-shared-3.3.24.jar * com.springsource.net.jcip.annotations-1.0.0 * crowd.system.passwordencoders * org.apache.servicemix.bundles.spring-jdbc-4.2.0.RELEASE_2 * org.apache.servicemix.bundles.spring-tx-4.2.0.RELEASE_2 * org.randombits.confluence.toc h4. Bob Swift related error This issue was logged with Bob Swift ([SQL-446|https://bobswift.atlassian.net/browse/SQL-446]) although the fix there was to remove RandomBits Add-Ons. As shown above, not all customers have this Add-On (except the for default toc), so this is likely a [red herring|https://en.wikipedia.org/wiki/Red_herring]. h3. Steps to Reproduce h4. Source code Error comes from here, but it's unclear how it's caused. {code:java|title=package com.atlassian.confluence.web.filter.ConfluenceOpenSessionInViewFilter#closeSession} // We have to make sure that we throw NO exceptions from this method, or we just end up masking problems // in the Spring session filter (the terrible ClobStringType requires active txn sync bug..), and we also // interrupt the session cleanup and leak db connections. - cm @Override protected void closeSession(Session session, SessionFactory sessionFactory) { if (session != null && session.isOpen() && session.isConnected() && session.getFlushMode() != FlushMode.NEVER) { try { session.flush(); } catch (Exception e) { log.error("Unable to flush Hibernate session. Possible data loss: " + e.getMessage(), e); } finally { super.closeSession(session, sessionFactory); } } } {code} Unable to reproduce at this time. h3. Expected Results Logs have no error. h3. Actual Results Logs throw {code:java} 2016-07-31 09:09:21,804 ERROR [http-nio-80-exec-21] [atlassian.spring.filter.FlushingSpringSessionInViewFilter] closeSession Unable to flush Hibernate session. Possible data loss: ClobStringType requires active transaction synchronization -- traceId: f5a84584a0aace71 java.lang.IllegalStateException: ClobStringType requires active transaction synchronization at com.atlassian.hibernate.BucketClobStringType.nullSafeSet(BucketClobStringType.java:118) at net.sf.hibernate.type.CustomType.nullSafeSet(CustomType.java:118) at net.sf.hibernate.persister.EntityPersister.dehydrate(EntityPersister.java:387) at net.sf.hibernate.persister.EntityPersister.update(EntityPersister.java:651) at net.sf.hibernate.persister.EntityPersister.update(EntityPersister.java:630) at net.sf.hibernate.impl.ScheduledUpdate.execute(ScheduledUpdate.java:52) at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2476) at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2462) at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2420) at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2288) at com.atlassian.spring.filter.FlushingSpringSessionInViewFilter.closeSession(FlushingSpringSessionInViewFilter.java:46) ... at com.atlassian.confluence.impl.vcache.VCacheRequestContextManager.doInRequestContext(VCacheRequestContextManager.java:82) at com.atlassian.confluence.impl.vcache.VCacheRequestContextManager.doInRequestContext(VCacheRequestContextManager.java:72) ... at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1095) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1502) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1458) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) {code} h3. Notes There are quite a few tickets from Confluence 1.0 days that have this same error. It is unlikely to be a regression. It may be based on a timeout issue. Usually occurs when returning to the Dashboard, which is why is occurs often with CONF-43246. h3. Workaround There is no Workaround. h3. More Information Required To further troubleshoot this we need to be able to reproduce it. To figure out how to do that, we would like to look at instances which have access logging enabled, to try and establish usage patterns that immediately precede this error. So far we have seen login and dashboard requests immediately preceding, but we don't have enough data for this to be statistically significant, given that these are two extremely common actions. If you are experiencing this error and would be able to work with us to troubleshoot it, please raise a [Support Request|https://support.atlassian.com/].

    Atlassian JIRA | 3 months ago | James Richards [Atlassian]
    java.lang.IllegalStateException: ClobStringType requires active transaction synchronization
  2. 0

    After upgrading to Confluence v5.10, I started seeing errors in log: {noformat} 2016-07-05 09:13:30,262 WARN [UpmAsynchronousTaskManager:thread-3] [confluence.util.profiling.DurationThresholdWarningTimingHelperFactory] logMessage Execution time for publishing event com.atlassian.confluence.event.events.plugin.PluginInstallEvent(org.randombits.support.support-core) took 23859 ms (warning threshold is 5000 ms) -- url: /rest/plugins/1.0/ | referer: http://confluence.card.co.uk/plugins/servlet/upm | traceId: 2d3989e497a995af | userName: marks 2016-07-05 09:14:34,783 ERROR [http-nio-8090-exec-6] [atlassian.spring.filter.FlushingSpringSessionInViewFilter] closeSession Unable to flush Hibernate session. Possible data loss: ClobStringType requires active transaction synchronization -- traceId: 58d14dc6dc7a26ec java.lang.IllegalStateException: ClobStringType requires active transaction synchronization at com.atlassian.hibernate.BucketClobStringType.nullSafeSet(BucketClobStringType.java:118) at net.sf.hibernate.type.CustomType.nullSafeSet(CustomType.java:118) at net.sf.hibernate.persister.EntityPersister.dehydrate(EntityPersister.java:387) at net.sf.hibernate.persister.EntityPersister.update(EntityPersister.java:651) {noformat} See attached log extract. The error was consistently generated when visiting the Confluence Dashboard. The problem seemed similar to that described in [this KB article|https://confluence.atlassian.com/confkb/confluence-throws-nonuniqueobjectexception-error-in-logs-830147706.html]. Therefore I entered safe mode and found that the problem seems to come from the RB plugins. I found your page on [Removal of RB Dependencies|https://bobswift.atlassian.net/wiki/display/info/Removal+of+RB+Dependencies+for+Confluence+Add-ons] and have now uninstalled all these plugins. SQL for Confluence seems to be working great. I am not using any other plugins that have RB dependencies. So, the reason I am logging this support request is so that you are aware that there may be a problem... and perhaps to tweak the RB Dependencies page to mention Confluence v5.10. Lastly, if you confirm that there is a problem, do you think any words concerning RB components should be added to the Confluence article linked above?

    JIRA | 5 months ago | Mark Symons
    java.lang.IllegalStateException: ClobStringType requires active transaction synchronization
  3. 0

    As a result of the exception below, the edited pages can not be saved. Suggestions are very welcome... Stephan <[ServletContext(id=18982466,name=confluence,context-path=/confluence)] Servlet failed with Exception java.lang.IllegalStateException: ClobStringType requires active transaction synchronization at com.atlassian.confluence.util.ConfluenceClobStringType.nullSafeSet(ConfluenceClobStringType.java:51) at net.sf.hibernate.type.CustomType.nullSafeSet(CustomType.java:118) at net.sf.hibernate.persister.EntityPersister.dehydrate(EntityPersister.java:393) at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:466) at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:442) at net.sf.hibernate.impl.ScheduledInsertion.execute(ScheduledInsertion.j ava:29) at net.sf.hibernate.impl.SessionImpl.executeAl(SessionImpl.java:2382) at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2335) at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2204) at bucket.custom.FlushingSpringSessionInViewFilter.closeSession(Flushing SpringSessionInViewFilter.java:39) at org.springframework.orm.hibernate.support.OpenSessionInViewFilter.doF ilterInternal(OpenSessionInViewFilter.java:122) at bucket.custom.FlushingSpringSessionInViewFilter.doFilterInternal(FlushingSpringSessionInViewFilter.java:30) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:73) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27) at com.atlassian.util.profiling.filters.ProfilingFilter.doFilter(ProfilingFilter.java:132) at com.atlassian.confluence.util.error.ProfilingAndErrorFilter.doFilter( ProfilingAndErrorFilter.java:25) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27) at com.atlassian.util.profiling.filters.ProfilingFilter.doFilter(Profili ngFilter.java:132) at com.atlassian.confluence.util.error.ProfilingAndErrorFilter.doFilter( ProfilingAndErrorFilter.java:25) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27) at com.atlassian.core.filters.AbstractEncodingFilter.doFilter(AbstractEncodingFilter.java:38) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio n.run(WebAppServletContext.java:6356) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118) at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe rvletContext.java:3635) at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2585) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)

    Atlassian JIRA | 1 decade ago | Stephan Janssen
    java.lang.IllegalStateException: ClobStringType requires active transaction synchronization
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    ERROR [bucket.upgrade.UpgradeManager] Upgrade failed: ClobStringType requires active transaction synchronization java.lang.IllegalStateException: ClobStringType requires active transaction synchronization at bucket.util.BucketClobStringType.nullSafeSet(BucketClobStringType.java:127) at net.sf.hibernate.type.CustomType.nullSafeSet(CustomType.java:118) at net.sf.hibernate.persister.EntityPersister.dehydrate(EntityPersister.java:387) at net.sf.hibernate.persister.EntityPersister.update(EntityPersister.java:642) at net.sf.hibernate.persister.EntityPersister.update(EntityPersister.java:621) at net.sf.hibernate.impl.ScheduledUpdate.execute(ScheduledUpdate.java:52) at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2449) at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2435) at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2393) at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2261) at com.atlassian.confluence.util.AncestorTableBuilder.build(AncestorTableBuilder.java:48) at com.atlassian.confluence.upgrade.PagePermissionUpgradeTask.updateDatabase(PagePermissionUpgradeTask.java:51) at com.atlassian.confluence.upgrade.PagePermissionUpgradeTask.doUpgrade(PagePermissionUpgradeTask.java:38) at bucket.upgrade.AbstractUpgradeManager.doUpgrade(AbstractUpgradeManager.java:103) at bucket.upgrade.AbstractUpgradeManager.upgrade(AbstractUpgradeManager.java:63) at bucket.upgrade.UpgradeLauncherServletContextListener.contextInitialized(UpgradeLauncherServletContextListener.java:27) at com.atlassian.confluence.upgrade.ConfluenceUpgradeServletContextListener.contextInitialized(ConfluenceUpgradeServletContextListener.java:14)

    Atlassian JIRA | 1 decade ago | Geoffrey Wiseman
    java.lang.IllegalStateException: ClobStringType requires active transaction synchronization
  6. 0

    Currently, copying a folder from the local system works with Windows Web Folders, however any sub-folders will fail with something like the following error: MKCOL /plugins/servlet/webdav/SPACE/Parent%20Page/Child%20Page HTTP/1.1 accept-language: en-au, en-us;q=0.2 translate: f user-agent: Microsoft Data Access Internet Publishing Provider DAV 1.1 host: 192.168.0.167:10101 content-length: 0 connection: Keep-Alive cookie: JSESSIONID=070D331945055E9EEA08B16E984F7013 authorization: Basic d2ViZGF2OndlYmRhdg== 2006-03-21 09:11:02,011 ERROR [bucket.custom.FlushingSpringSessionInViewFilter] closeSession Unable to flush Hibernate session. Possible data loss: ClobStringType requires active transaction synchronization java.lang.IllegalStateException: ClobStringType requires active transaction synchronization at bucket.util.BucketClobStringType.nullSafeSet(BucketClobStringType.java:127) at net.sf.hibernate.type.CustomType.nullSafeSet(CustomType.java:118) at net.sf.hibernate.persister.EntityPersister.dehydrate(EntityPersister.java:387) at net.sf.hibernate.persister.EntityPersister.update(EntityPersister.java:642) at net.sf.hibernate.persister.EntityPersister.update(EntityPersister.java:621) at net.sf.hibernate.impl.ScheduledUpdate.execute(ScheduledUpdate.java:52) at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2449) at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2435) at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2393) at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2261) at bucket.custom.FlushingSpringSessionInViewFilter.closeSession(FlushingSpringSessionInViewFilter.java:48) at org.springframework.orm.hibernate.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:179) at bucket.custom.FlushingSpringSessionInViewFilter.doFilterInternal(FlushingSpringSessionInViewFilter.java:31) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:73) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at com.atlassian.util.profiling.filters.ProfilingFilter.doFilter(ProfilingFilter.java:132) at com.atlassian.confluence.util.error.ProfilingAndErrorFilter.doFilter(ProfilingAndErrorFilter.java:27) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at com.atlassian.core.filters.gzip.GzipFilter.doFilter(GzipFilter.java:61) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at com.atlassian.core.filters.AbstractEncodingFilter.doFilter(AbstractEncodingFilter.java:37) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:663) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Thread.java:613)

    Ecosystem JIRA | 1 decade ago | Jonathan Appel
    java.lang.IllegalStateException: ClobStringType requires active transaction synchronization

    1 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.IllegalStateException

      ClobStringType requires active transaction synchronization

      at com.atlassian.hibernate.BucketClobStringType.nullSafeSet()
    2. com.atlassian.hibernate
      BucketClobStringType.nullSafeSet
      1. com.atlassian.hibernate.BucketClobStringType.nullSafeSet(BucketClobStringType.java:118)
      1 frame
    3. net.sf.hibernate
      SessionImpl.flush
      1. net.sf.hibernate.type.CustomType.nullSafeSet(CustomType.java:118)
      2. net.sf.hibernate.persister.EntityPersister.dehydrate(EntityPersister.java:387)
      3. net.sf.hibernate.persister.EntityPersister.update(EntityPersister.java:651)
      4. net.sf.hibernate.persister.EntityPersister.update(EntityPersister.java:630)
      5. net.sf.hibernate.impl.ScheduledUpdate.execute(ScheduledUpdate.java:52)
      6. net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2476)
      7. net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2462)
      8. net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2420)
      9. net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2288)
      9 frames
    4. com.atlassian.spring
      FlushingSpringSessionInViewFilter.closeSession
      1. com.atlassian.spring.filter.FlushingSpringSessionInViewFilter.closeSession(FlushingSpringSessionInViewFilter.java:46)
      1 frame