Hi,
After some recent upgrades (ubuntu 18.04 → 20.04, lxd 4.10 → lxd 4.15), my custom backup script fails while exporting (at least) one container:
$ lxc export --optimized-storage blog blogbackup
Error: Create backup: Backup create: Snapshot "snap23" in storage but not expected
From lxc info
:
Snapshots:
snap0 (taken at 2017/09/13 11:31 UTC) (stateless)
snap1 (taken at 2017/09/18 11:35 UTC) (stateless)
before-v3.8 (taken at 2018/07/24 15:07 UTC) (stateless)
before-fixing-certbot (taken at 2018/09/22 15:00 UTC) (stateless)
after-fixing-certbot (taken at 2018/09/22 15:22 UTC) (stateless)
finally-fixed (taken at 2019/11/19 20:19 UTC) (stateless)
snap116 (taken at 2021/05/15 04:18 UTC) (expires at 2021/08/07 04:18 UTC) (stateless)
snap117 (taken at 2021/05/22 04:18 UTC) (expires at 2021/08/14 04:18 UTC) (stateless)
snap118 (taken at 2021/05/29 04:18 UTC) (expires at 2021/08/21 04:18 UTC) (stateless)
snap119 (taken at 2021/06/05 04:18 UTC) (expires at 2021/08/28 04:18 UTC) (stateless)
snap120 (taken at 2021/06/12 04:18 UTC) (expires at 2021/09/04 04:18 UTC) (stateless)
snap121 (taken at 2021/06/19 04:18 UTC) (expires at 2021/09/11 04:18 UTC) (stateless)
snap122 (taken at 2021/06/26 04:18 UTC) (expires at 2021/09/18 04:18 UTC) (stateless)
snap123 (taken at 2021/07/03 04:18 UTC) (expires at 2021/09/25 04:18 UTC) (stateless)
snap124 (taken at 2021/07/10 04:18 UTC) (expires at 2021/10/02 04:18 UTC) (stateless)
snap125 (taken at 2021/07/17 04:18 UTC) (expires at 2021/10/09 04:18 UTC) (stateless)
snap126 (taken at 2021/07/24 04:18 UTC) (expires at 2021/10/16 04:18 UTC) (stateless)
snap127 (taken at 2021/07/31 04:18 UTC) (expires at 2021/10/23 04:18 UTC) (stateless)
on disk:
$ sudo ls -l /mnt/ssdbtrfs/lxd/containers-snapshots/blog/
total 0
drwxr-xr-x+ 1 100000 100000 78 Nov 28 2018 after-fixing-certbot
drwxr-xr-x+ 1 100000 100000 78 Nov 28 2018 before-fixing-certbot
drwxr-xr-x+ 1 100000 100000 78 Nov 28 2018 before-v3.8
d--x------+ 1 1000000 root 78 Nov 28 2018 finally-fixed
drwxr-xr-x+ 1 100000 100000 78 Nov 28 2018 snap0
drwxr-xr-x+ 1 100000 100000 78 Nov 28 2018 snap1
d--x------+ 1 1000000 root 78 Nov 28 2018 snap116
d--x------+ 1 1000000 root 78 Nov 28 2018 snap117
d--x------+ 1 1000000 root 78 Nov 28 2018 snap118
d--x------+ 1 1000000 root 78 Nov 28 2018 snap119
d--x------+ 1 1000000 root 78 Nov 28 2018 snap120
d--x------+ 1 1000000 root 78 Nov 28 2018 snap121
d--x------+ 1 1000000 root 78 Nov 28 2018 snap122
d--x------+ 1 1000000 root 78 Nov 28 2018 snap123
d--x------+ 1 1000000 root 78 Nov 28 2018 snap124
d--x------+ 1 1000000 root 78 Nov 28 2018 snap125
d--x------+ 1 1000000 root 78 Nov 28 2018 snap126
d--x------+ 1 1000000 root 78 Nov 28 2018 snap127
drwx--x--x+ 1 root root 78 Nov 28 2018 snap23
drwx--x--x+ 1 root root 78 Nov 28 2018 snap24
drwx--x--x+ 1 root root 78 Nov 28 2018 snap25
I suppose there has been a permission problem in LXD some (long) time ago that resulted in some older snapshots having the wrong permissions and could therefore not be properly deleted. I suppose I can just manually delete those on-disk remnants without breaking anything else?
(storage is btrfs, which is marvelous for LXD)