MySql: Communications link failure
MySql: Communication link failure
Problem
A full backup for a single account stops with the following exception:
2016-05-11 13:58:25,603 WARN [FullBackupThread] [name=admin@example.com;mid=2;] backup - Error occurred during full backup for account admin@example.com; aborted backup and deleting /backup/tmp/full-20160511.115806.637/accounts/991/e7e/991e7e61-8ec0-4216-ac39-13407491ac83 com.zimbra.common.service.ServiceException: system failure: backing up table: mboxgroup2.mail_item ExceptionId:BackupSetWorkerThread-DB:1462967905595:a573750a2018f5f0 Code:service.FAILURE at com.zimbra.common.service.ServiceException.FAILURE(ServiceException.java:260) at com.zimbra.cs.db.DbBackup.saveTable(DbBackup.java:128) at com.zimbra.cs.backup.BackupAccountSession.storeTablesToLocalFile(BackupAccountSession.java:317) at com.zimbra.cs.backup.FileBackupTarget$BackupAcctSession.storeTablesStage(FileBackupTarget.java:1639) at com.zimbra.cs.backup.FileBackupTarget$BackupSetWorkerThread.run(FileBackupTarget.java:2993) Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Communications link failure The last packet successfully received from the server was 400 milliseconds ago. The last packet sent successfully to the server was 400 milliseconds ago.
Resolution
1. If the account is big and the backup takes too long, MySql will timeout. To solve the problem run the following command:
zmlocalconfig -e backup_disable_blob_digest_preloading=true
2. A second fix is to increase the timeout value in my.cnf file:
- Edit /opt/zimbra/conf/my.cnf file and put under the [mysqld] section:
wait_timeout = 28800
Save & exit.
zmcontrol restart
Additional Information
The problem occurs because the backup thread looses its connection to the DB if the blob stage has a long time to complete, which causes the backup to fail.