Skip to content

xattrs not supported warning during extract fails due to % in filename #6063

Description

@petenewcomb

Have you checked borgbackup docs, FAQ, and open Github issues?

Yes

Is this a BUG / ISSUE report or a QUESTION?

BUG

System information. For client/server mode post info for both machines.

Your borg version (borg -V).

1.1.15

Operating system (distribution) and version.

Ubuntu 20.04

Hardware / network configuration, and filesystems used.

Local repo, Ext4

How much data is handled by borg?

4.6TiB of Borg repositories total, archive in question is 776GiB but extract fails at 57GiB due to this bug.

Full borg commandline that lead to the problem (leave away excludes and passwords)

borg extract /backups/oldeyelow/repo::fluffy-2020-08-22T23:13:37.716949

Describe the problem you're observing.

Restoring a file with %p in the name that includes xattrs (from Windows Subsystem for Linux) onto an ext4 partition causes an exception because the filename gets expanded into the LHS of the % formatting operator. Excerpted log and full stack trace below.

Can you reproduce the problem? If so, describe how. If not, describe troubleshooting steps you took before opening the issue.

Yes, same results every time I attempted to extract the archive. I tried using --errors to suppress, but the faulty logic still gets executed. The version I'm using doesn't yet support --noxattrs as now exists in the 1.1-maint branch, so that wasn't an option. I therefore edited /usr/lib/python3/dist-packages/borg/archive.py to change the logic so that the LHS is always a constant string. This allowed the archive extract completely while still generating the intended warnings.

Include any warning/errors/backtraces from the system logs

[... many more "xattrs not supported" warnings like the following line ...]
/data/oldbackups/flufftest/mnt/c/Users/isaac/AppData/Roaming/Mozilla/Firefox/Profiles/2416qrmh.default-release/storage/default/https+++mail.google.com/idb/953658429glmaaviyle-ks-w.files: when setting extended attribute system.wsl_case_sensitive: xattrs not supported on this filesystem
Local Exception
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/borg/archive.py", line 771, in restore_attrs
    xattr.setxattr(fd or path, k, v, follow_symlinks=False)
  File "/usr/lib/python3/dist-packages/borg/xattr.py", line 249, in setxattr
    _setxattr_inner(func, path, name, value)
  File "/usr/lib/python3/dist-packages/borg/xattr.py", line 188, in _setxattr_inner
    _check(func(path, name, value, size), path, detect_buffer_too_small=False)
  File "/usr/lib/python3/dist-packages/borg/xattr.py", line 143, in _check
    raise OSError(e, msg, path)
OSError: [Errno 95] Operation not supported: b'/data/oldbackups/flufftest/mnt/c/Users/isaac/AppData/Roaming/Mozilla/Firefox/Profiles/2416qrmh.default-release/storage/default/https+++mail.google.com/idb/555926040iddano6l%p4u0tcnoermn.files'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/borg/archiver.py", line 4621, in main
    exit_code = archiver.run(args)
  File "/usr/lib/python3/dist-packages/borg/archiver.py", line 4553, in run
    return set_ec(func(args))
  File "/usr/lib/python3/dist-packages/borg/archiver.py", line 177, in wrapper
    return method(self, args, repository=repository, **kwargs)
  File "/usr/lib/python3/dist-packages/borg/archiver.py", line 190, in wrapper
    return method(self, args, repository=repository, manifest=manifest, key=key, archive=archive, **kwargs)
  File "/usr/lib/python3/dist-packages/borg/archiver.py", line 793, in do_extract
    archive.extract_item(dir_item, stdout=stdout)
  File "/usr/lib/python3/dist-packages/borg/archive.py", line 684, in extract_item
    self.restore_attrs(path, item)
  File "/usr/lib/python3/dist-packages/borg/archive.py", line 788, in restore_attrs
    logger.warning(msg_format % err_str)
ValueError: unsupported format character 'p' (0x70) at index 173

Platform: Linux daneel 5.4.0-90-generic #101-Ubuntu SMP Fri Oct 15 20:00:55 UTC 2021 x86_64
Linux: Unknown Linux  
Borg: 1.1.15  Python: CPython 3.8.10 msgpack: 0.5.6
PID: 203540  CWD: /data/oldbackups/flufftest
sys.argv: ['/usr/bin/borg', 'extract', '/backups/oldeyelow/repo::fluffy-2020-08-22T23:13:37.716949']
SSH_ORIGINAL_COMMAND: None

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions