-
Bug
-
Resolution: Answered
-
High
-
None
-
7.1.0, 7.2.2, 7.3.1, 7.4.4, 7.4.9, 7.7.4, 7.13.2, 7.13.3
-
90
-
Severity 3 - Minor
-
124
-
This issue is caused by a missing property in our previously provided configuration documents. We have updated our documentation to correct this oversight. Please review Configuring a datasource connection to ensure your configuration is up to date.
If you would like additional details, please take a moment to review this comment.
Issue Summary
While Confluence is connected to the database via DataSource, we will see the following error in the atlassian-confluence.log despite the page publish successfully:
2020-02-25 16:31:18,884 ERROR [http-nio-6731-exec-6] [atlassian.confluence.event.ConfluenceEventDispatcher] run There was an exception thrown trying to dispatch event [com.atlassian.confluence.event.events.content.page.synchrony.ContentUpdatedEvent@f2a4df3d] from the invoker [SingleParameterMethodListenerInvoker{method=public void com.atlassian.confluence.plugins.synchrony.service.SynchronyContentService.syncContentOnUpdate(com.atlassian.confluence.event.events.content.page.synchrony.ContentUpdatedEvent), listener=com.atlassian.confluence.plugins.synchrony.service.SynchronyContentService@6691a1d9} (timed)] -- referer: http://localhost:6731/c731/pages/resumedraft.action?draftId=327693&draftShareId=2667a813-0d56-46b0-a249-45a6ecd709b4& | url: /c731/rest/api/content/327693 | traceId: 32b4e11053495fb0 | userName: admin java.lang.RuntimeException: com.atlassian.sal.spi.HostConnectionAccessor returned connection with autocommit set. Listener: com.atlassian.confluence.plugins.synchrony.service.SynchronyContentService event: com.atlassian.confluence.event.events.content.page.synchrony.ContentUpdatedEvent at com.atlassian.event.internal.SingleParameterMethodListenerInvoker.invoke(SingleParameterMethodListenerInvoker.java:57) at com.atlassian.confluence.event.ConfluenceListenerHandlersConfiguration$TimedListenerInvoker.invoke(ConfluenceListenerHandlersConfiguration.java:96) at com.atlassian.confluence.event.ConfluenceEventDispatcher$VCacheRequestContextRunnableFactory$1.lambda$run$0(ConfluenceEventDispatcher.java:93) at com.atlassian.confluence.vcache.VCacheRequestContextOperations.lambda$doInRequestContext$0(VCacheRequestContextOperations.java:50) at com.atlassian.confluence.impl.vcache.VCacheRequestContextManager.doInRequestContextInternal(VCacheRequestContextManager.java:84) at com.atlassian.confluence.impl.vcache.VCacheRequestContextManager.doInRequestContext(VCacheRequestContextManager.java:68) at com.atlassian.confluence.vcache.VCacheRequestContextOperations.doInRequestContext(VCacheRequestContextOperations.java:49) at com.atlassian.confluence.event.ConfluenceEventDispatcher$VCacheRequestContextRunnableFactory$1.run(ConfluenceEventDispatcher.java:93) ..... .... .... .... Caused by: java.lang.IllegalStateException: com.atlassian.sal.spi.HostConnectionAccessor returned connection with autocommit set at com.atlassian.sal.core.rdbms.DefaultTransactionalExecutor.assertAutoCommitFalse(DefaultTransactionalExecutor.java:94) at com.atlassian.sal.core.rdbms.DefaultTransactionalExecutor.executeInternal(DefaultTransactionalExecutor.java:82) at com.atlassian.sal.core.rdbms.DefaultTransactionalExecutor.lambda$execute$0(DefaultTransactionalExecutor.java:43) at com.atlassian.sal.spring.connection.SpringHostConnectionAccessor.lambda$execute$0(SpringHostConnectionAccessor.java:55) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140) at com.atlassian.sal.spring.connection.SpringHostConnectionAccessor.execute(SpringHostConnectionAccessor.java:49)
Steps to Reproduce
- Install Confluence and connect any supported database via datasource
- Create a new page
- Publish the page
- Check the atlassian-confluence.log
Expected Results
The page publishes successfully with no errors in the log.
Actual Results
The page publishes successfully but with errors in the log.
Notes
If 2 users are editing the same page this error is thrown when the first user publishes (or saves) the page and later when the second user tried to publish or save he will get a pop-up with the error "Can't sync with the server. Refresh the page to try to re-establish the connection.". Refreshing the page allows to proceed.
Workaround
Configure the following attribute to your Tomcat datasource:
defaultAutoCommit="false"
Just as an example, here's a sample datasource configuration for PostgreSQL with this attribute:
<Resource name="jdbc/confluence" auth="Container" type="javax.sql.DataSource" username="conf744dc" password="conf744dc" driverClassName="org.postgresql.Driver" url="jdbc:postgresql://127.0.0.1:5432/conf744dc" maxTotal="60" maxIdle="20" defaultAutoCommit="false" validationQuery="select 1" />
Confluence needs to be restarted so the modifications in server.xml are captured.
Also, if running on Data Center you must configure it on all nodes of the cluster.
Check the Tomcat documentation for additional information on attributes to configure the Tomcat JDBC datasource.
- mentioned in
-
Page No Confluence page found with the given URL.
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
Hi All,
I'm going to close this ticket and wanted to take a moment to explain why.
By default, Confluence runs with <property name="hibernate.connection.autocommit">false</property> when using the integrated database connection handler. The actual log message that is being written to the log file is a failed Java Assert expecting autocommit to be set to false. The workaround proposed by 1871051e9eec is correct and is actually the way the product should configured by default. This makes this issue primary a documentation issue.
We also investigated and confirmed the findings provided by 1871051e9eec with regards to the installation process failing when defaultAutoCommit=false is configured in Tomcat during the database setup phase. Confluence correctly creates the tables, but then fails when validating the setup. This setup proceeds as expected when defaultAutoCommit=false is not present. So we can confirm 1871051e9eec's findings.
To address both parts of this issue, we're updating our documentation to reflect the requirement for the defaultAutoCommit=false configuration, but to be added after the installation is complete. We'll be linking back to this issue and the associated answer as part of the documentation to make the requirement clear. I'm taking this approach in part due to the below.
We're also looking at removing support for Datasources as a method of Confluence database access moving forward. As a number of people have expressed strong interest in this feature, I'd like to capture some feedback about their use cases so we can understand their perspective when considering this issue. If you would like to submit feedback, please check out this community post and leave your thoughts on the page.
With this in mind, I'm going to go ahead and close the ticket.
Thanks,
James Ponting
Engineering Manager - Confluence Data Center