kdave / btrfs-progs

Development of userspace BTRFS tools
GNU General Public License v2.0
542 stars 240 forks source link

send/receive – lremovexattr security.capability failed: No data available – empty stream #613

Open leszekdubiel opened 1 year ago

leszekdubiel commented 1 year ago

Short description

I get errors:

ERROR: lremovexattr  some-file-here   security.capability failed: No data available
ERROR: empty stream is not considered valid
root@star#   uname -a
Linux star 5.10.0-21-amd64 #1 SMP Debian 5.10.162-1 (2023-01-21) x86_64 GNU/Linux

root@star#   # btrfs --version 
btrfs-progs v6.1.3 

root@star#   cat /etc/issue
Debian GNU/Linux 11 \n \l

Longer description

There is original server "alfa" with data in Btrfs filesystem organized like this:

 /data          <--- here I keep user data 
 /snaps        <--- here I make snapshots of data 
     /100              
     /101
     /102 

On server "alfa" I create snapshots 100, 101, 102 and so on using such a command:

root@alfa#   btrfs subvol snapshot  data  snaps/103

There is a backup server "beta" that imports data by sending and receiving, for example:

root@beta#   ssh  alfa    "btrfs send -p /snaps/102 /snaps/103"   |   btrfs receive ./copies/

on "beta" structure is like this:

/snaps
     /101
    /102
    /103 

There is another server "star" (off site, 50 km away from company) that imports data. When I connect to server "beta" and do like this:

root@star#     ssh   beta    "btrfs send -p /snaps/102 /snaps/103"   |   btrfs receive /snaps/

I get errors:

ERROR: lremovexattr  some-file-here   security.capability failed: No data available
ERROR: empty stream is not considered valid

If I connect to "alfa" instead of beta:

root@star#     ssh   alfa    "btrfs send -p /snaps/102 /snaps/103"   |   btrfs receive /snaps/

everything works ok.

Different info I found here: https://github.com/digint/btrbk/issues/160

  1. I don't know how to track that issue more to give more details.
  2. send/receive alfa->star works always good, and send/receive beta->star fails very often
leszekdubiel commented 1 year ago

More info.

root@alfa# getcap /snaps/105/some-file-here

root@star# getcap /snaps/105/some-file-here
/snaps/105/some-file-here   cap_net_raw=ep

On server "alfa" getcap prints no result. On remote servers "beta" or "star" there is "cap_net_raw=ep".

On remote servers "cap_net_raw=ep" is set for some files during send --> receive process.

leszekdubiel commented 9 months ago

Debian stable. Error is still there.

# btrfs --version 
btrfs-progs v6.2

# cat /etc/issue
Debian GNU/Linux 12 \n \l

Temporary solution -- change erorr to warning:

cmds/receive.c
    868,869c868,869
    <       ret = -errno;
    <       error("lremovexattr %s %s failed: %m", path, name);
    ---
    >       ret = 0; 
    >       warning("leszek 2023-12-17: lremovexattr %s %s failed: %m", path, name);

After this patch backup works normally, prints warnings.

Checked subvolumes with rsync -avixc — are exactly the same.

Forza-tng commented 9 months ago

@leszekdubiel

btrfs --version btrfs-progs v6.2

I suggest you try static build v6.6.3 from the releases page. It does not need installation and should work on all x86_64/amd64 machines.

leszekdubiel commented 8 months ago

I have put v6.6.3. Didn't help unfortunatelly.


ERROR: lremovexattr root/Omega/Domains/Zakupy/Folders/ZK_85142/Documents/IMG_1430.JPG security.capability failed: No data available

# getcap "/mnt/sde3/orion_snaps/2023-12-04 23:54:01 908003686"/root/Omega/Domains/Zakupy/Folders/ZK_85142/Documents/IMG_1430.JPG

/mnt/sde3/orion_snaps/2023-12-04 23:54:01 908003686/root/Omega/Domains/Zakupy/Folders/ZK_85142/Documents/IMG_1430.JPG cap_net_raw=ep

# ls -l "/mnt/sde3/orion_snaps/2023-12-04 23:54:01 908003686"/root/Omega/Domains/Zakupy/Folders/ZK_85142/Documents/IMG_1430.JPG

-rwxrwxr-x 1 1045 1031 3010166 2023-04-05  '/mnt/sde3/orion_snaps/2023-12-04 23:54:01 908003686/root/Omega/Domains/Zakupy/Folders/ZK_85142/Documents/IMG_1430.JPG'

# btrfs --version 
btrfs-progs v6.6.3

# ls -lt /usr/bin/btrfs
-rwxr-xr-x 1 root root 2749872 12-19 13:15 /usr/bin/btrfs