Unable to create a Confluence XML site backup when using MySQL

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Problem

You are not able to create an XML site backup, specifically when using MySQL as your database with Confluence.

The following appears in the atlassian-confluence.log

atlassian-confluence.log

1 2 Caused by: java.io.EOFException: Can not read response from server. Expected to read 4 bytes, read 0 bytes before connection was unexpectedly lost. WARN [http-nio-8090-exec-58] [v2.c3p0.impl.NewPooledConnection] log [c3p0] Another error has occurred [ com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after connection closed. ] which will not be reported to listeners!

Cause

MySQL closes the database connection that Confluence is using while creating the XML backup, which is a long-running process.

Workaround

Increase the interactive_timeout and wait_timeout in MySQL.

interactive_timeout: The number of seconds the server waits for activity on an interactive connection before closing it.

wait_timeout: The number of seconds the server waits for activity on a non-interactive connection before closing it.

  • Find out your current timeout values by running the following in MySQL with a privileged account:

    1 SHOW VARIABLES LIKE '%timeout%';
  • Edit the my.cnf file and increase the interactive_timeout and wait_timeout to be higher than the current value. You can do this by adding the respective variable and value under the [mysqld] section.

    Default Values

    1 2 3 [mysqld] wait_timeout = 28800 interactive_timeout = 28800
  • Restart MySQL to apply the changes

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.