KeyError: 'xattr'

View: New views
3 Messages — Rating Filter:   Alert me  

KeyError: 'xattr'

by Austin Roberts-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I've been using rdiff-backup for a little over a year, and it has been very stable up until now. Several days ago, I had a crash and rdiff-backup was forcefully terminated. The next time I tried to backup, I got an error something like this:

Warning, could not find mirror_metadata file.
Metadata will be read from filesystem instead.
Fatal Error: No metadata for time Fri Sep 26 19:01:41 2008 (1222473701) found,
cannot regress

I eventually figured out that this was because I had multiple current_mirror files. I moved the older one to another directory, and it started backing up my files and rebuilding the metadata. I assume it's because it is rebuilding the metadata, it takes about as long as a full backup (I start the backup around 5:00 PM, it's not done by the time I go to bed). Once it backs up the last file, it gives the following error:

Exception ''xattr'' raised of class '<type 'exceptions.KeyError'>':
  File "/var/lib/python-support/python2.5/rdiff_backup/Main.py", line 302, in error_check_Main
    try: Main(arglist)
  File "/var/lib/python-support/python2.5/rdiff_backup/Main.py", line 322, in Main
    take_action(rps)
  File "/var/lib/python-support/python2.5/rdiff_backup/Main.py", line 278, in take_action
    elif action == "backup": Backup(rps[0], rps[1])
  File "/var/lib/python-support/python2.5/rdiff_backup/Main.py", line 341, in Backup
    backup.Mirror_and_increment(rpin, rpout, incdir)
  File "/var/lib/python-support/python2.5/rdiff_backup/backup.py", line 51, in Mirror_and_increment
    DestS.patch_and_increment(dest_rpath, source_diffiter, inc_rpath)
  File "/var/lib/python-support/python2.5/rdiff_backup/backup.py", line 238, in patch_and_increment
    cls.CCPP.close()
  File "/var/lib/python-support/python2.5/rdiff_backup/backup.py", line 479, in close
    while self.cache_indicies: self.shorten_cache()
  File "/var/lib/python-support/python2.5/rdiff_backup/backup.py", line 360, in shorten_cache
    changed_flag, success_flag, inc)
  File "/var/lib/python-support/python2.5/rdiff_backup/backup.py", line 410, in post_process
    self.metawriter.write_object(metadata_rorp)
  File "/var/lib/python-support/python2.5/rdiff_backup/metadata.py", line 443, in write_object
    if self.eawriter and not rorp.get_ea().empty():
  File "/var/lib/python-support/python2.5/rdiff_backup/rpath.py", line 1233, in get_ea
    except KeyError: ea = self.data['ea'] = ea_get(self)
  File "/var/lib/python-support/python2.5/rdiff_backup/eas_acls.py", line 565, in rpath_ea_get
    ea.read_from_rp(rp)
  File "/var/lib/python-support/python2.5/rdiff_backup/eas_acls.py", line 59, in read_from_rp
    try: attr_list = rp.conn.xattr.listxattr(rp.path)
  File "/var/lib/python-support/python2.5/rdiff_backup/connection.py", line 65, in __getattr__
    elif isinstance(__builtins__, dict): return __builtins__[name]

Traceback (most recent call last):
  File "/usr/bin/rdiff-backup", line 23, in <module>
    rdiff_backup.Main.error_check_Main(sys.argv[1:])
  File "/var/lib/python-support/python2.5/rdiff_backup/Main.py", line 302, in error_check_Main
    try: Main(arglist)
  File "/var/lib/python-support/python2.5/rdiff_backup/Main.py", line 322, in Main
    take_action(rps)
  File "/var/lib/python-support/python2.5/rdiff_backup/Main.py", line 278, in take_action
    elif action == "backup": Backup(rps[0], rps[1])
  File "/var/lib/python-support/python2.5/rdiff_backup/Main.py", line 341, in Backup
    backup.Mirror_and_increment(rpin, rpout, incdir)
  File "/var/lib/python-support/python2.5/rdiff_backup/backup.py", line 51, in Mirror_and_increment
    DestS.patch_and_increment(dest_rpath, source_diffiter, inc_rpath)
  File "/var/lib/python-support/python2.5/rdiff_backup/backup.py", line 238, in patch_and_increment
    cls.CCPP.close()
  File "/var/lib/python-support/python2.5/rdiff_backup/backup.py", line 479, in close
    while self.cache_indicies: self.shorten_cache()
  File "/var/lib/python-support/python2.5/rdiff_backup/backup.py", line 360, in shorten_cache
    changed_flag, success_flag, inc)
  File "/var/lib/python-support/python2.5/rdiff_backup/backup.py", line 410, in post_process
    self.metawriter.write_object(metadata_rorp)
  File "/var/lib/python-support/python2.5/rdiff_backup/metadata.py", line 443, in write_object
    if self.eawriter and not rorp.get_ea().empty():
  File "/var/lib/python-support/python2.5/rdiff_backup/rpath.py", line 1233, in get_ea
    except KeyError: ea = self.data['ea'] = ea_get(self)
  File "/var/lib/python-support/python2.5/rdiff_backup/eas_acls.py", line 565, in rpath_ea_get
    ea.read_from_rp(rp)
  File "/var/lib/python-support/python2.5/rdiff_backup/eas_acls.py", line 59, in read_from_rp
    try: attr_list = rp.conn.xattr.listxattr(rp.path)
  File "/var/lib/python-support/python2.5/rdiff_backup/connection.py", line 65, in __getattr__
    elif isinstance(__builtins__, dict): return __builtins__[name]
KeyError: 'xattr'
Fatal Error: Lost connection to the remote system
And the next time I try to run a backup, I have multiple current_mirror files again, and no metadata for the most recent backup. If it were just a matter of getting it to backup, I could write a script that would remove one of the current_mirror files before initiating the backup, but I also don't have 10 hours for the backup every night.

If it comes down to it I'll scrap the existing repository and start over, but it would sure be nice to keep my last several months of backups in-tact as well.

Any help is greatly appreciated,

- Austin

_______________________________________________
rdiff-backup-users mailing list at rdiff-backup-users@...
http://lists.nongnu.org/mailman/listinfo/rdiff-backup-users
Wiki URL: http://rdiff-backup.solutionsfirst.com.au/index.php/RdiffBackupWiki

Re: KeyError: 'xattr'

by Andrew Ferguson-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sep 27, 2008, at 10:39 AM, Austin Roberts wrote:
> Exception ''xattr'' raised of class '<type 'exceptions.KeyError'>':


Hi Austin,

This is somewhat of a strange error to get. You are getting this error  
because the remote side of the connection cannot import the 'xattr'  
Python module, which is the support for Extended Attributes. However,  
rdiff-backup tests for extended attributes support during  
initialization and should never request functions from that module,  
unless it has successfully loaded it.

To diagnose this problem, please send the following information:

1) What version of rdiff-backup you are using, both on the local side  
and the remote side(s)

2) The command line you are using to run rdiff-backup

3) The output of rdiff-backup with the  -v 4   option added (this will  
set the verbosity of your logging to 4). With the -v 4 option, we will  
be able to see the results of rdiff-backup's tests for extended  
attributes support.



Have you setup Extended Attributes support in the past and recently  
tried to disable it?

Finally, you can definitely avoid this problem by adding the --no-eas  
option to rdiff-backup. That will turn off extended attributes support  
and bypass the tests for it (although I am interested in why the test  
is reporting success for you and then this error occurs).


Andrew


_______________________________________________
rdiff-backup-users mailing list at rdiff-backup-users@...
http://lists.nongnu.org/mailman/listinfo/rdiff-backup-users
Wiki URL: http://rdiff-backup.solutionsfirst.com.au/index.php/RdiffBackupWiki

Re: KeyError: 'xattr'

by Solli Moreira Honorio :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Austin, I had the same problem on rdiff-backup on all of my Debians
(sarge/etch/lenny). My workaround of this problem was just remove
python-pyattr.

Solli M. Honorio

Austin Roberts escreveu:

> I've been using rdiff-backup for a little over a year, and it has been
> very stable up until now. Several days ago, I had a crash and
> rdiff-backup was forcefully terminated. The next time I tried to
> backup, I got an error something like this:
>
> Warning, could not find mirror_metadata file.
> Metadata will be read from filesystem instead.
> Fatal Error: No metadata for time Fri Sep 26 19:01:41 2008
> (1222473701) found,
> cannot regress
>
> I eventually figured out that this was because I had multiple
> current_mirror files. I moved the older one to another directory, and
> it started backing up my files and rebuilding the metadata. I assume
> it's because it is rebuilding the metadata, it takes about as long as
> a full backup (I start the backup around 5:00 PM, it's not done by the
> time I go to bed). Once it backs up the last file, it gives the
> following error:
>
>     Exception ''xattr'' raised of class '<type 'exceptions.KeyError'>':
>       File "/var/lib/python-support/python2.5/rdiff_backup/Main.py",
>     line 302, in error_check_Main
>         try: Main(arglist)
>       File "/var/lib/python-support/python2.5/rdiff_backup/Main.py",
>     line 322, in Main
>         take_action(rps)
>       File "/var/lib/python-support/python2.5/rdiff_backup/Main.py",
>     line 278, in take_action
>         elif action == "backup": Backup(rps[0], rps[1])
>       File "/var/lib/python-support/python2.5/rdiff_backup/Main.py",
>     line 341, in Backup
>         backup.Mirror_and_increment(rpin, rpout, incdir)
>       File "/var/lib/python-support/python2.5/rdiff_backup/backup.py",
>     line 51, in Mirror_and_increment
>         DestS.patch_and_increment(dest_rpath, source_diffiter, inc_rpath)
>       File "/var/lib/python-support/python2.5/rdiff_backup/backup.py",
>     line 238, in patch_and_increment
>         cls.CCPP.close()
>       File "/var/lib/python-support/python2.5/rdiff_backup/backup.py",
>     line 479, in close
>         while self.cache_indicies: self.shorten_cache()
>       File "/var/lib/python-support/python2.5/rdiff_backup/backup.py",
>     line 360, in shorten_cache
>         changed_flag, success_flag, inc)
>       File "/var/lib/python-support/python2.5/rdiff_backup/backup.py",
>     line 410, in post_process
>         self.metawriter.write_object(metadata_rorp)
>       File
>     "/var/lib/python-support/python2.5/rdiff_backup/metadata.py", line
>     443, in write_object
>         if self.eawriter and not rorp.get_ea().empty():
>       File "/var/lib/python-support/python2.5/rdiff_backup/rpath.py",
>     line 1233, in get_ea
>         except KeyError: ea = self.data['ea'] = ea_get(self)
>       File
>     "/var/lib/python-support/python2.5/rdiff_backup/eas_acls.py", line
>     565, in rpath_ea_get
>         ea.read_from_rp(rp)
>       File
>     "/var/lib/python-support/python2.5/rdiff_backup/eas_acls.py", line
>     59, in read_from_rp
>         try: attr_list = rp.conn.xattr.listxattr(rp.path)
>       File
>     "/var/lib/python-support/python2.5/rdiff_backup/connection.py",
>     line 65, in __getattr__
>         elif isinstance(__builtins__, dict): return __builtins__[name]
>
>     Traceback (most recent call last):
>       File "/usr/bin/rdiff-backup", line 23, in <module>
>         rdiff_backup.Main.error_check_Main(sys.argv[1:])
>       File "/var/lib/python-support/python2.5/rdiff_backup/Main.py",
>     line 302, in error_check_Main
>         try: Main(arglist)
>       File "/var/lib/python-support/python2.5/rdiff_backup/Main.py",
>     line 322, in Main
>         take_action(rps)
>       File "/var/lib/python-support/python2.5/rdiff_backup/Main.py",
>     line 278, in take_action
>         elif action == "backup": Backup(rps[0], rps[1])
>       File "/var/lib/python-support/python2.5/rdiff_backup/Main.py",
>     line 341, in Backup
>         backup.Mirror_and_increment(rpin, rpout, incdir)
>       File "/var/lib/python-support/python2.5/rdiff_backup/backup.py",
>     line 51, in Mirror_and_increment
>         DestS.patch_and_increment(dest_rpath, source_diffiter, inc_rpath)
>       File "/var/lib/python-support/python2.5/rdiff_backup/backup.py",
>     line 238, in patch_and_increment
>         cls.CCPP.close()
>       File "/var/lib/python-support/python2.5/rdiff_backup/backup.py",
>     line 479, in close
>         while self.cache_indicies: self.shorten_cache()
>       File "/var/lib/python-support/python2.5/rdiff_backup/backup.py",
>     line 360, in shorten_cache
>         changed_flag, success_flag, inc)
>       File "/var/lib/python-support/python2.5/rdiff_backup/backup.py",
>     line 410, in post_process
>         self.metawriter.write_object(metadata_rorp)
>       File
>     "/var/lib/python-support/python2.5/rdiff_backup/metadata.py", line
>     443, in write_object
>         if self.eawriter and not rorp.get_ea().empty():
>       File "/var/lib/python-support/python2.5/rdiff_backup/rpath.py",
>     line 1233, in get_ea
>         except KeyError: ea = self.data['ea'] = ea_get(self)
>       File
>     "/var/lib/python-support/python2.5/rdiff_backup/eas_acls.py", line
>     565, in rpath_ea_get
>         ea.read_from_rp(rp)
>       File
>     "/var/lib/python-support/python2.5/rdiff_backup/eas_acls.py", line
>     59, in read_from_rp
>         try: attr_list = rp.conn.xattr.listxattr(rp.path)
>       File
>     "/var/lib/python-support/python2.5/rdiff_backup/connection.py",
>     line 65, in __getattr__
>         elif isinstance(__builtins__, dict): return __builtins__[name]
>     KeyError: 'xattr'
>     Fatal Error: Lost connection to the remote system
>
> And the next time I try to run a backup, I have multiple
> current_mirror files again, and no metadata for the most recent
> backup. If it were just a matter of getting it to backup, I could
> write a script that would remove one of the current_mirror files
> before initiating the backup, but I also don't have 10 hours for the
> backup every night.
>
> If it comes down to it I'll scrap the existing repository and start
> over, but it would sure be nice to keep my last several months of
> backups in-tact as well.
>
> Any help is greatly appreciated,
>
> - Austin
> ------------------------------------------------------------------------
>
> _______________________________________________
> rdiff-backup-users mailing list at rdiff-backup-users@...
> http://lists.nongnu.org/mailman/listinfo/rdiff-backup-users
> Wiki URL: http://rdiff-backup.solutionsfirst.com.au/index.php/RdiffBackupWiki



_______________________________________________
rdiff-backup-users mailing list at rdiff-backup-users@...
http://lists.nongnu.org/mailman/listinfo/rdiff-backup-users
Wiki URL: http://rdiff-backup.solutionsfirst.com.au/index.php/RdiffBackupWiki
LightInTheBox - Buy quality products at wholesale price!