Restore from a corrupted backup has killed Nagios
Posted: Mon Feb 17, 2020 12:37 pm
Hello,
This morning I attempted to restore from a backup. It turns out that the backup was corrupt. Despite this, the restore script kept running and totally destroyed our Nagios install.
Here is the output from the restore script:
gzip: stdin: unexpected end of file
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now
gzip: stdin: unexpected end of file
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now
TS=1581959036
Extracting backup to /store/backups/nagiosxi/1581959036-restore...
gzip: stdin: unexpected end of file
tar: Unexpected EOF in archive
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now
In /store/backups/nagiosxi/1581959036-restore/nagiosxi.1581926402...
Backup files look okay. Preparing to restore...
Shutting down services...
Stopping nagios: done.
Stopping ndo2db: done.
NPCD Stopped.
Restoring directories to /...
Restoring Nagios Core...
gzip: stdin: unexpected end of file
tar: Unexpected EOF in archive
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now
Restoring Nagios XI...
Restoring NagiosQL...
Restoring NagiosQL backups...
Restoring NRDP backups...
Restoring MRTG...
Restoring SNMP configuration files...
Restoring SNMP MIBs...
Restoring nagios home dir...
Restoring MySQL databases...
./restore_xi.sh: line 261: /store/backups/nagiosxi/1581959036-restore/nagiosxi.1581926402/mysql/nagios.sql: No such file or directory
Error restoring MySQL database 'nagios' - check the password in this script!
Huge chunks of Nagios and NagiosXI are now missing, the database is gone, and we're totally down.
I will leave aside the obvious questions of why the restore script performs no error checking and why our backups are silently corrupt.
Is there ANY way to recover from this?
-- Mike Beebe
This morning I attempted to restore from a backup. It turns out that the backup was corrupt. Despite this, the restore script kept running and totally destroyed our Nagios install.
Here is the output from the restore script:
gzip: stdin: unexpected end of file
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now
gzip: stdin: unexpected end of file
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now
TS=1581959036
Extracting backup to /store/backups/nagiosxi/1581959036-restore...
gzip: stdin: unexpected end of file
tar: Unexpected EOF in archive
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now
In /store/backups/nagiosxi/1581959036-restore/nagiosxi.1581926402...
Backup files look okay. Preparing to restore...
Shutting down services...
Stopping nagios: done.
Stopping ndo2db: done.
NPCD Stopped.
Restoring directories to /...
Restoring Nagios Core...
gzip: stdin: unexpected end of file
tar: Unexpected EOF in archive
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now
Restoring Nagios XI...
Restoring NagiosQL...
Restoring NagiosQL backups...
Restoring NRDP backups...
Restoring MRTG...
Restoring SNMP configuration files...
Restoring SNMP MIBs...
Restoring nagios home dir...
Restoring MySQL databases...
./restore_xi.sh: line 261: /store/backups/nagiosxi/1581959036-restore/nagiosxi.1581926402/mysql/nagios.sql: No such file or directory
Error restoring MySQL database 'nagios' - check the password in this script!
Huge chunks of Nagios and NagiosXI are now missing, the database is gone, and we're totally down.
I will leave aside the obvious questions of why the restore script performs no error checking and why our backups are silently corrupt.
Is there ANY way to recover from this?
-- Mike Beebe