Diagnose Zimbra Mailbox Database Errors Before Repair

When Zimbra mailbox logs report “DB Error,” “DB Failure,” or a database corruption exception, do not start by repairing or deleting tables. First determine whether MySQL/MariaDB is unavailable, credentials are out of sync, storage is full, or the database engine reports actual corruption. Preserve logs and backups; use integrity and read-only checks before recovery.

1. Identify what failed

On the affected mailbox server, inspect the same time window in mailbox.log and the database error log. As the Zimbra operating-system user:

su - zimbra
tail -n 200 /opt/zimbra/log/mailbox.log
tail -n 200 /opt/zimbra/log/mysql_error.log
zmcontrol status
df -h /opt/zimbra

Use timestamps and surrounding lines, not just the first “DB Failure” message. Zimbra documents mailbox.log as mailbox activity logging and mysql_error.log as a place to check database health and corruption. A stopped database, full filesystem, or repeated connection errors points toward availability or resource trouble. InnoDB messages about damaged pages, tablespaces, or failed crash recovery are stronger evidence of engine-level corruption. A generic Java SQL exception alone does not prove the database files are corrupt.

A redacted mailbox log open in a terminal, with sensitive values replaced by placeholders
A redacted log view illustrates correlating mailbox.log entries with the same time window in mysql_error.log.

2. Run checks that do not change database contents

Verify that the Zimbra user can connect to the local database. Zimbra’s mailbox troubleshooting notes that an out-of-sync MySQL password can prevent mailbox services from starting:

mysql zimbra

If authentication or socket errors appear, save the exact output and check the database service and local configuration. Do not reset passwords or edit my.cnf based on a generic error; follow the procedure for your installed Zimbra version or involve support.

Run Zimbra’s integrity report:

/opt/zimbra/libexec/zmdbintegrityreport -v

The report can identify database/table integrity problems, but interpret output with the storage engine and Zimbra release in mind. Zimbra documentation specifically notes that REPAIR TABLE does not repair InnoDB tables. Warnings in archived guidance are not universal instructions for current systems. Save the full report and error output before making changes.

If logs identify one mailbox group, keep further investigation scoped to that evidence. Zimbra organizes mailbox records into mboxgroup databases. Use supported mailbox administration commands for your installed version to identify mailbox ID and group; do not guess the group from a fixed formula because local configuration may change the group count.

A terminal prompt showing the Zimbra database integrity report command before it runs
The integrity report command is a diagnostic step; review its actual output on the affected server before deciding on recovery.

3. Protect recoverable data before repair

Record the Zimbra version, affected server, error timestamps, service status, disk usage, and relevant mailbox or group IDs. Check available backups for the account:

zmbackupquery -a user@example.com

Confirm the backup is readable and appropriate for the recovery point; a listed backup alone does not prove that restore will succeed. Preserve a current backup or storage snapshot using your normal supported procedure, and confirm adequate destination space. Never remove files from /opt/zimbra/db/data, drop an mboxgroup, or restore over live database files as an exploratory test.

Database records and message content are related but not interchangeable. Zimbra documentation describes metadata such as message headers, contacts, and calendar data in database tables, while message content resides in the message store. Restoring only one side can leave mailboxes inconsistent, so plan recovery with both database state and mailbox content in view.

A terminal showing a generic backup directory listing without a claimed success result
Review the actual backup inventory and restore point before approving database recovery.

4. Choose a recovery path based on evidence

  • Database service is down, but no corruption is logged: investigate startup errors, disk space, permissions, and database credentials first. Correct the cause using the procedure for the installed release, then start the affected service and re-check logs.
  • The integrity report flags a table or mailbox group: preserve the report and establish scope. Zimbra’s older crash-recovery guidance describes targeted mailbox-group recovery, but includes version-specific destructive SQL operations. Treat it as escalation material, not a copy-and-paste recipe.
  • InnoDB reports corruption or repeatedly crashes: stop ad hoc repair attempts. Zimbra’s crash-recovery notes describe controlled dump-and-restore workflows and warn that higher InnoDB forced-recovery levels are risky. Steps vary by database and Zimbra version; use a tested backup and experienced administrator or Zimbra support before changing recovery settings, dropping databases, or rebuilding them.
  • No usable backup exists: do not run destructive repair hoping to preserve all data. Preserve current database files and logs, take a safe copy if possible, and get specialist advice on data extraction and acceptable loss.

Do not run REPAIR TABLE against InnoDB tables just because an integrity report shows an error. Do not increase innodb_force_recovery casually: it is a data-extraction aid during controlled recovery, not a routine fix. The wrong action for the storage engine or release can make recovery harder.

A blank incident worksheet listing mailbox ID, mailbox group, error time, backup status, and next action
Record the affected identifiers, error time, and verified backup state so the plan is tied to evidence.

5. Verify service and mailbox access

After a supported fix or restore, check service state and rerun the integrity report. Review fresh entries in both logs for recurring database exceptions, then test the affected mailbox and, where relevant, a second mailbox on the same store. Confirm expected folders, recent messages, contacts, and calendar items are present; a running mailboxd process alone does not show that data is complete.

Close the incident only when the database remains available, integrity output has been reviewed, the original failure is no longer recurring, and the account can access the expected data for its restore point. Keep logs and recovery notes with the incident record.

References

Leave a Comment

How to