apt-btrfs-snapshot blocks apt

Bug #1870482 reported by Mauro Miatello
18
This bug affects 4 people
Affects Status Importance Assigned to Milestone
apt-btrfs-snapshot (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

I've installed apt-btrfs-snapshot
then every apt operation shows:

Traceback (most recent call last):
  File "/usr/bin/apt-btrfs-snapshot", line 29, in <module>
    from apt_btrfs_snapshot import AptBtrfsSnapshot
  File "/usr/lib/python3/dist-packages/apt_btrfs_snapshot.py", line 28, in <module>
    from distutils.spawn import find_executable
ModuleNotFoundError: No module named 'distutils.spawn'

so I've installed python3-distutils, now apt doesn't work any more:

Supported
ERROR: Could not statfs: No such file or directory
E: Problem executing scripts DPkg::Pre-Invoke 'if [ -x /usr/bin/apt-btrfs-snapshot ] && apt-btrfs-snapshot supported; then apt-btrfs-snapshot snapshot; fi '
E: Sub-process returned an error code

also I can't remove packages
workaround is renaming /usr/bin/apt-btrfs-snapshot

Revision history for this message
Mauro Miatello (mauro-miatello) wrote :

same on kubuntu 20.04, but I didn't install python3-distutils so I have only warning
for now, I removed apt-btrfs-snapshot

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in apt-btrfs-snapshot (Ubuntu):
status: New → Confirmed
Revision history for this message
Alan Walter Thomas (alazyworkaholic) wrote :

I never had the python error above, but ever since I reverted to a snapshot for the first time I do get the ERROR: Could not statfs: No such file or directory.

I was able to keep apt-btrfs-snapshot's error from making apt unable to do anything by deleting /etc/apt/apt.conf.d/80-btrfs-snapshot, but that's really not a solution.

I have no idea what file it's looking for. Invoking it manually with --debug didn't yield any other information.

Revision history for this message
Kent Ross (mumbleskates) wrote :

i ran into this and figured out what it was.

apt-btrfs-snapshot makes several assumptions when it operates, not all of which are checked:

1. / is mounted from a btrfs device subvolume named /@
2. the btrfs filesystem on that device will mount the root filesystem, inside which @ resides.

1. is checked by "supported" by looking in fstab and ensuring that subvolid=@ is *explicitly* specified, 2. is not checked at all. if your volume root mounts @ as the default subvolume it's not gonna work!

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.