backupninja is tricky

I am using backupninja (Debian package) to backup parts of the data on a server to another machine. The server has home directories, web stuff, and an SVN repository. Backupninja seemed a good choice because it is very easy to tell it to export the SVN repository to a flat file before executing the backup.

I copied two files from /usr/share/backup/backupninja/examples to /etc/backup.d:
example.svn -> 10.subversion.svn
example.rdiff -> 90.rdiff

The defaults in the SVN file worked fine for me. I edited 90.rdiff to include the data I want backed up.

Recently, however, a network glitch caused the rdiff backup to fail with the following output (which I received in my usual status email from backupninja):


== warnings from /etc/backup.d/90.rdiff ==

Warning: Exception '' raised of class 'exceptions.AssertionError': File "/usr/lib/python2.3/site-packages/rdiff_backup/Main.py", line 295, in error_check_Main try: Main(arglist) File "/usr/lib/python2.3/site-packages/rdiff_backup/Main.py", line 315, in Main take_action(rps) File "/usr/lib/python2.3/site-packages/rdiff_backup/Main.py", line 271, in take_action elif action == "backup": Backup(rps[0], rps[1]) File "/usr/lib/python2.3/site-packages/rdiff_backup/Main.py", line 328, in Backup backup_final_init(rpout) File "/usr/lib/python2.3/site-packages/rdiff_backup/Main.py", line 425, in backup_final_init checkdest_if_necessary(rpout) File "/usr/lib/python2.3/site-packages/rdiff_backup/Main.py", line 820, in checkdest_if_necessary need_check = checkdest_need_check(dest_rp) File "/usr/lib/python2.3/site-packages/rdiff_backup/Main.py", line 810, in checkdest_need_check if not force: curmir_incs[0].conn.regress.check_pids(curmir_incs) File "/usr/lib/python2.3/site-packages/rdiff_ba
ckup/connection.py", line 448, in __call__ return apply(self.connection.reval, (self.name,) + args) File "/usr/lib/python2.3/site-packages/rdiff_backup/connection.py", line 367, in reval for arg in args: self._put(arg, req_num) File "/usr/lib/python2.3/site-packages/rdiff_backup/connection.py", line 139, in _put else: self._putobj(obj, req_num) File "/usr/lib/python2.3/site-packages/rdiff_backup/connection.py", line 144, in _putobj self._write("o", pickle.dumps(obj, 1), req_num) File "/usr/lib/python2.3/pickle.py", line 1386, in dumps Pickler(file, protocol, bin).dump(obj) File "/usr/lib/python2.3/pickle.py", line 231, in dump self.save(obj) File "/usr/lib/python2.3/pickle.py", line 293, in save f(self, obj) # Call unbound method with explicit self File "/usr/lib/python2.3/pickle.py", line 614, in save_list self._batch_appends(iter(obj)) File "/usr/lib/python2.3/pickle.py", line 647, in _batch_appends save(x) File "/usr/lib/python2.3/pickle.py", line 293, in save f(self, obj
) # Call unbound method with explicit self File "/usr/lib/python2.3/pickle.py", line 737, in save_inst stuff = getstate() File "/usr/lib/python2.3/site-packages/rdiff_backup/rpath.py", line 754, in __getstate__ assert self.conn is Globals.local_connection Traceback (most recent call last): File "/usr/bin/rdiff-backup", line 23, in ? rdiff_backup.Main.error_check_Main(sys.argv[1:]) File "/usr/lib/python2.3/site-packages/rdiff_backup/Main.py", line 295, in error_check_Main try: Main(arglist) File "/usr/lib/python2.3/site-packages/rdiff_backup/Main.py", line 315, in Main take_action(rps) File "/usr/lib/python2.3/site-packages/rdiff_backup/Main.py", line 271, in take_action elif action == "backup": Backup(rps[0], rps[1]) File "/usr/lib/python2.3/site-packages/rdiff_backup/Main.py", line 328, in Backup backup_final_init(rpout) File "/usr/lib/python2.3/site-packages/rdiff_backup/Main.py", line 425, in backup_final_init checkdest_if_necessary(rpout) File "/usr/lib/python2.3/site-pa
ckages/rdiff_backup/Main.py", line 820, in checkdest_if_necessary need_check = checkdest_need_check(dest_rp) File "/usr/lib/python2.3/site-packages/rdiff_backup/Main.py", line 810, in checkdest_need_check if not force: curmir_incs[0].conn.regress.check_pids(curmir_incs) File "/usr/lib/python2.3/site-packages/rdiff_backup/connection.py", line 448, in __call__ return apply(self.connection.reval, (self.name,) + args) File "/usr/lib/python2.3/site-packages/rdiff_backup/connection.py", line 367, in reval for arg in args: self._put(arg, req_num) File "/usr/lib/python2.3/site-packages/rdiff_backup/connection.py", line 139, in _put else: self._putobj(obj, req_num) File "/usr/lib/python2.3/site-packages/rdiff_backup/connection.py", line 144, in _putobj self._write("o", pickle.dumps(obj, 1), req_num) File "/usr/lib/python2.3/pickle.py", line 1386, in dumps Pickler(file, protocol, bin).dump(obj) File "/usr/lib/python2.3/pickle.py", line 231, in dump self.save(obj) File "/usr/lib/python
2.3/pickle.py", line 293, in save f(self, obj) # Call unbound method with explicit self File "/usr/lib/python2.3/pickle.py", line 614, in save_list self._batch_appends(iter(obj)) File "/usr/lib/python2.3/pickle.py", line 647, in _batch_appends save(x) File "/usr/lib/python2.3/pickle.py", line 293, in save f(self, obj) # Call unbound method with explicit self File "/usr/lib/python2.3/pickle.py", line 737, in save_inst stuff = getstate() File "/usr/lib/python2.3/site-packages/rdiff_backup/rpath.py", line 754, in __getstate__ assert self.conn is Globals.local_connection AssertionError Fatal Error: Lost connection to the remote system
Warning: Failed backup up source

This confused me badly and I ended up trying a bunch of things which did not work. In the end, I moved my current backups out of the way on the backup machine and started anew.

Error messages I received in the mean time include:


== warnings from /etc/backup.d/90.rdiff ==

Warning: Previous backup seems to have failed, regressing destination now. Warning, could not find mirror_metadata file. Metadata will be read from filesystem instead. Fatal Error: No metadata for time Thu Apr 27 18:38:23 2006 (1146177503) found, cannot regress Fatal Error: Lost connection to the remote system
Warning: Failed backup up source

as well as:


== warnings from /etc/backup.d/90.rdiff ==

Warning: Exception 'Found too many current_mirror incs!' raised of class 'exceptions.AssertionError': File "/usr/lib/python2.3/site-packages/rdiff_backup/Main.py", line 295, in error_check_Main try: Main(arglist) File "/usr/lib/python2.3/site-packages/rdiff_backup/Main.py", line 315, in Main take_action(rps) File "/usr/lib/python2.3/site-packages/rdiff_backup/Main.py", line 271, in take_action elif action == "backup": Backup(rps[0], rps[1]) File "/usr/lib/python2.3/site-packages/rdiff_backup/Main.py", line 328, in Backup backup_final_init(rpout) File "/usr/lib/python2.3/site-packages/rdiff_backup/Main.py", line 425, in backup_final_init checkdest_if_necessary(rpout) File "/usr/lib/python2.3/site-packages/rdiff_backup/Main.py", line 820, in checkdest_if_necessary need_check = checkdest_need_check(dest_rp) File "/usr/lib/python2.3/site-packages/rdiff_backup/Main.py", line 811, in checkdest_need_check assert len(curmir_incs) == 2, "Found too many current_mirror incs!" Traceback
(most recent call last): File "/usr/bin/rdiff-backup", line 23, in ? rdiff_backup.Main.error_check_Main(sys.argv[1:]) File "/usr/lib/python2.3/site-packages/rdiff_backup/Main.py", line 295, in error_check_Main try: Main(arglist) File "/usr/lib/python2.3/site-packages/rdiff_backup/Main.py", line 315, in Main take_action(rps) File "/usr/lib/python2.3/site-packages/rdiff_backup/Main.py", line 271, in take_action elif action == "backup": Backup(rps[0], rps[1]) File "/usr/lib/python2.3/site-packages/rdiff_backup/Main.py", line 328, in Backup backup_final_init(rpout) File "/usr/lib/python2.3/site-packages/rdiff_backup/Main.py", line 425, in backup_final_init checkdest_if_necessary(rpout) File "/usr/lib/python2.3/site-packages/rdiff_backup/Main.py", line 820, in checkdest_if_necessary need_check = checkdest_need_check(dest_rp) File "/usr/lib/python2.3/site-packages/rdiff_backup/Main.py", line 811, in checkdest_need_check assert len(curmir_incs) == 2, "Found too many current_mirror
incs!" AssertionError: Found too many current_mirror incs! Fatal Error: Lost connection to the remote system
Warning: Failed backup up source

Here is an rdiff backup wiki which provided some of the suggestions which I tried unsuccessfully. Also, here is the rdiff-backup-users mailing list archive, which could prove to be useful.

My advice is this: if rdiff-backup fails, add in the –force option and retry. Hopefully that alone is sufficient to fix it. If that doesn’t fix it, I don’t know what to do.

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s