apt-btrfs-snapshot supported reports "Sorry, your system lacks support for the snapshot feature" since update of btrfs-tools to 4.0-2 in debian/testing

Bug #1454306 reported by rincewind
184
This bug affects 36 people
Affects Status Importance Assigned to Milestone
apt-btrfs-snapshot (Ubuntu)
Fix Released
High
Reinhard Tartler
Xenial
Won't Fix
High
Reinhard Tartler
Yakkety
Fix Released
High
Reinhard Tartler

Bug Description

[Impact]
apt-btrfs-snapshot is unable to detect the btrfs binary, rendering the package completely useless. The symptom is that the package claims the system was not supported despite having root on btrfs

[Test Case]
root@halde:~# apt-btrfs-snapshot supported
Supported

[Regression Potential]
Unclear

Original Report follows:
I' using apt-btrfs-snapshot in debian testing and wit worked fine since now.
(Yes, that's debian, but I think it's likely that this change will come to ubuntu sooner or later, please read on.)

In version 4.0-2, the debian package of apt-btrfs-snapshot, moved the btrfs binary from /sbin to /bin, see

http://metadata.ftp-master.debian.org/changelogs//main/b/btrfs-tools/btrfs-tools_4.0-2_changelog

This lets the check of apt-btrfs-snapshot fail.

I suggest enhancing the check in snapshots_supported() at line 122 to check both paths /sbin/btrfs and /bin/btrfs to make it work again.

Related branches

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
yurikoles (yurikoles) wrote :

I have committed to personal branch, please merge

Changed in apt-btrfs-snapshot (Ubuntu):
assignee: nobody → yurikoles (yurikoles)
status: Confirmed → In Progress
status: In Progress → Fix Committed
yurikoles (yurikoles)
Changed in apt-btrfs-snapshot (Ubuntu):
assignee: yurikoles (yurikoles) → nobody
Revision history for this message
Paulo Dias (paulo-miguel-dias) wrote :

i can confirm this bug, changing the path to /bin/btrfs snapshots_supported() fixes it. still there in ubuntu 15.10 beta 2

Revision history for this message
Alexander Fieroch (fieroch) wrote :

Confirming bug still open in final ubuntu 15.10

Revision history for this message
QkiZ (qkiz) wrote :

Even if I
sudo ln -s /bin/btrfs /sbin/btrfs
it's not working properly. apt-btrfs-snapshot doesn't see snapshots.

Revision history for this message
Mircea Vutcovici (mirceavutcovici) wrote :

I solved the problem on my system with this patch:

diff /usr/lib/python3/dist-packages/apt_btrfs_snapshot.py-old /usr/lib/python3/dist-packages/apt_btrfs_snapshot.py
122c122
< if not os.path.exists("/sbin/btrfs"):
---
> if not ( os.path.exists("/sbin/btrfs") or os.path.exists("/bin/btrfs") ):

Revision history for this message
QkiZ (qkiz) wrote :

I made changes in /usr/lib/python3/dist-packages/apt_btrfs_snapshot.py, now apt-btrfs-snapshot print that system is supported, but another error appears:
Supported
ERROR: error accessing '/tmp/apt-btrfs-snapshot-mp-g7t0m7uy/@'
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
when I try to install something.

Harry Coin (hcoin)
Changed in apt-btrfs-snapshot (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Felix Kurth (fkurth) wrote :

This bug is still present in Xenial Xerus as of beta 2. Any plan to fix?

Revision history for this message
Xcorp (k-launchpad-xcorp-at) wrote :

It's present in the final release of 16.04 as well.

Revision history for this message
Reinhard Tartler (siretart) wrote :

I can also confirm that this bug is present in the Final xenial release

Changed in apt-btrfs-snapshot (Ubuntu):
importance: Undecided → High
status: Fix Released → Confirmed
Revision history for this message
Reinhard Tartler (siretart) wrote :

Hi Michael,

I've locally built your branch lp:~mvo/apt-btrfs-snapshot/trunk and am happy to confirm that it fixes this bug. Too bad it didn't make it into xenial, because without it the package is rather useless.

Can you please upload it to yakety so that we can start the SRU process?

Thanks,

Revision history for this message
Reinhard Tartler (siretart) wrote :

I've checked with mvo on #ubuntu-devel:

12:38 <siretart> mvo: any chance you could upload the changes in your apt-btrfs-snapshot branch? Did you see my question to you in LP: #1454306? - can I help you with doing the upload for
                 you?
12:47 <mvo> siretart: uh, I have not seen that. and help with the upload is very welcome, thanks a bunch for the offer!

I've just uploaded package version 3.5 which fixes this issue at least for me.

Changed in apt-btrfs-snapshot (Ubuntu Yakkety):
assignee: nobody → Reinhard Tartler (siretart)
Changed in apt-btrfs-snapshot (Ubuntu Xenial):
assignee: nobody → Reinhard Tartler (siretart)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apt-btrfs-snapshot - 3.5.1

---------------
apt-btrfs-snapshot (3.5.1) yakkety; urgency=medium

  * fix mock of "btrfs" binary

 -- Michael Vogt <email address hidden> Fri, 29 Apr 2016 17:13:19 +0200

Changed in apt-btrfs-snapshot (Ubuntu Yakkety):
status: Confirmed → Fix Released
description: updated
Revision history for this message
Reinhard Tartler (siretart) wrote :

I've uploaded version 3.5.1ubuntu0.1 to xenial-proposed.

Ubuntu-SRU, please review and approve. Thanks

Changed in apt-btrfs-snapshot (Ubuntu Xenial):
status: New → In Progress
importance: Undecided → High
Revision history for this message
S. W. (cebit2006) wrote :

he guys

can someone tell me why this bug bugs use for a year now? is it so hart to fix the problem? it is very annoying that it works on some systems (e.g. trusty with kernel 4.4) while on others its broken ...

i have installed (purged the old packe and did a fresh install) the 3.5.1 on an xenial (upgrade from 15.10, upgrade from 15.04) and its still NOT working! with 15.04 it worked as far as i can remind me.

w@WVK-Storage:~$ btrfs --version
btrfs-progs v4.4
w@Storage:~$ uname -a
Linux Storage 4.4.0-22-generic #39-Ubuntu SMP Thu May 5 16:53:32 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
root@Storage:~# dpkg -i apt-btrfs-snapshot_3.5.1_all.deb
Vormals nicht ausgewähltes Paket apt-btrfs-snapshot wird gewählt.
(Lese Datenbank ... 329622 Dateien und Verzeichnisse sind derzeit installiert.)
Vorbereitung zum Entpacken von apt-btrfs-snapshot_3.5.1_all.deb ...
Entpacken von apt-btrfs-snapshot (3.5.1) ...
apt-btrfs-snapshot (3.5.1) wird eingerichtet ...
root@Storage:~# apt-btrfs-snapshot supported
Traceback (most recent call last):
  File "/usr/bin/apt-btrfs-snapshot", line 92, in <module>
    apt_btrfs = AptBtrfsSnapshot()
  File "/usr/lib/python3/dist-packages/apt_btrfs_snapshot.py", line 117, in __init__
    self.fstab = Fstab(fstab)
  File "/usr/lib/python3/dist-packages/apt_btrfs_snapshot.py", line 80, in __init__
    entry = FstabEntry.from_line(line)
  File "/usr/lib/python3/dist-packages/apt_btrfs_snapshot.py", line 53, in from_line
    return FstabEntry(*args[0:6])
TypeError: __init__() missing 3 required positional arguments: 'mountpoint', 'fstype', and 'options'

btw: snapper works flawlessly on this system on a different subvol.

regards
sash

Revision history for this message
Reinhard Tartler (siretart) wrote : Re: [Bug 1454306] Re: apt-btrfs-snapshot supported reports "Sorry, your system lacks support for the snapshot feature" since update of btrfs-tools to 4.0-2 in debian/testing
Download full text (3.4 KiB)

This issue is already fixed in the latest development version of Ubuntu
yakkety.

The fix has also been uploaded to xenial, the most recent Ubuntu release,
and is currently waiting for the archive admins to approve.

On Mon, May 9, 2016, 11:11 S. W. <email address hidden> wrote:

> he guys
>
>
> can someone tell me why this bug bugs use for a year now? is it so hart to
> fix the problem? it is very annoying that it works on some systems (e.g.
> trusty with kernel 4.4) while on others its broken ...
>
> i have installed (purged the old packe and did a fresh install) the
> 3.5.1 on an xenial (upgrade from 15.10, upgrade from 15.04) and its
> still NOT working! with 15.04 it worked as far as i can remind me.
>
> w@WVK-Storage:~$ btrfs --version
> btrfs-progs v4.4
> w@Storage:~$ uname -a
> Linux Storage 4.4.0-22-generic #39-Ubuntu SMP Thu May 5 16:53:32 UTC 2016
> x86_64 x86_64 x86_64 GNU/Linux
> root@Storage:~# dpkg -i apt-btrfs-snapshot_3.5.1_all.deb
> Vormals nicht ausgewähltes Paket apt-btrfs-snapshot wird gewählt.
> (Lese Datenbank ... 329622 Dateien und Verzeichnisse sind derzeit
> installiert.)
> Vorbereitung zum Entpacken von apt-btrfs-snapshot_3.5.1_all.deb ...
> Entpacken von apt-btrfs-snapshot (3.5.1) ...
> apt-btrfs-snapshot (3.5.1) wird eingerichtet ...
> root@Storage:~# apt-btrfs-snapshot supported
> Traceback (most recent call last):
> File "/usr/bin/apt-btrfs-snapshot", line 92, in <module>
> apt_btrfs = AptBtrfsSnapshot()
> File "/usr/lib/python3/dist-packages/apt_btrfs_snapshot.py", line 117,
> in __init__
> self.fstab = Fstab(fstab)
> File "/usr/lib/python3/dist-packages/apt_btrfs_snapshot.py", line 80, in
> __init__
> entry = FstabEntry.from_line(line)
> File "/usr/lib/python3/dist-packages/apt_btrfs_snapshot.py", line 53, in
> from_line
> return FstabEntry(*args[0:6])
> TypeError: __init__() missing 3 required positional arguments:
> 'mountpoint', 'fstype', and 'options'
>
>
> btw: snapper works flawlessly on this system on a different subvol.
>
>
> regards
> sash
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1454306
>
> Title:
> apt-btrfs-snapshot supported reports "Sorry, your system lacks support
> for the snapshot feature" since update of btrfs-tools to 4.0-2 in
> debian/testing
>
> To manage notifications about this bug go to:
>
> https://bugs.launchpad.net/ubuntu/+source/apt-btrfs-snapshot/+bug/1454306/+subscriptions
>
> Launchpad-Notification-Type: bug
> Launchpad-Bug: distribution=ubuntu; sourcepackage=apt-btrfs-snapshot;
> component=universe; status=Fix Released; importance=High; assignee=
> <email address hidden>;
> Launchpad-Bug: distribution=ubuntu; distroseries=xenial;
> sourcepackage=apt-btrfs-snapshot; component=universe; status=In Progress;
> importance=High; <email address hidden>;
> Launchpad-Bug: distribution=ubuntu; distroseries=yakkety;
> sourcepackage=apt-btrfs-snapshot; component=universe; status=Fix Released;
> importance=High; <email address hidden>;
> Launchpad-Bug-Information-Type: Public
> Launchpad-Bug-Private: no
> Launchpad-Bug-Security-Vulnerability: no
> Launchpad-Bug-Commente...

Read more...

Revision history for this message
Martin Pitt (pitti) wrote :

- print(_("Sorry, your system lacks support for the snapshot feature"))
+ print(_("The system does not support apt-btrfs-snapshot"))

I must say I'm not very happy about changing translated and user-visible strings in an SRU that are just noise (i. e. they don't correct a wrong piece of information, it's just a stylistic change).

Revision history for this message
Reinhard Tartler (siretart) wrote :

I've uploaded a package that reverts the string to the version in xenial

Revision history for this message
Martin Pitt (pitti) wrote :

The version number of the SRU upload is wrong, it needs to be lower than yakkety (3.5.10. So please reupload as 3.5.1~ubuntu16.04 or 3.5.1~ubuntu1 or similar.

Revision history for this message
Josh Hill (ingenium) wrote :

Can someone please tell me where the updated package is uploaded? It doesn't appear to be in xenial-proposed yet.

Revision history for this message
Martin Pitt (pitti) wrote : Please test proposed package

Hello rincewind, or anyone else affected,

Accepted apt-btrfs-snapshot into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/apt-btrfs-snapshot/3.5.1~ubuntu0.2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in apt-btrfs-snapshot (Ubuntu Xenial):
status: In Progress → Fix Committed
tags: added: verification-needed
Revision history for this message
seanlano (seanlano) wrote :

I have tested from xenial-proposed, I can confirm the problem is now fixed for me.

apt-btrfs-snapshot:
  Installed: 3.5.1~ubuntu0.2
  Candidate: 3.5.1~ubuntu0.2
  Version table:
 *** 3.5.1~ubuntu0.2 400
        400 http://au.archive.ubuntu.com/ubuntu xenial-proposed/universe amd64 Packages
        400 http://au.archive.ubuntu.com/ubuntu xenial-proposed/universe i386 Packages
        100 /var/lib/dpkg/status
     0.3.4.2 500
        500 http://au.archive.ubuntu.com/ubuntu xenial/universe amd64 Packages
        500 http://au.archive.ubuntu.com/ubuntu xenial/universe i386 Packages

tags: added: verification-done
removed: verification-needed
Revision history for this message
Rory Jaffe (rsjaffe) wrote :

3.5.1~ubuntu0.2 tested and works

Revision history for this message
Grzegorz Cieslewski (grzegorz-gmail) wrote :

Tested from xenial-proposed 3.5.1~ubuntu0.2 works

Revision history for this message
Simon Sebold (simon-sebold1991) wrote :

3.5.1~ubuntu0.2 tested and works

Ubuntu 16.04.1 LTS (GNU/Linux 4.4.0-34-generic x86_64)

Revision history for this message
Martin Pitt (pitti) wrote : Proposed package removed from archive

The version of apt-btrfs-snapshot in the proposed pocket of Xenial that was purported to fix this bug report has been removed because the bugs that were to be fixed by the upload were not verified in a timely (105 days) fashion.

Changed in apt-btrfs-snapshot (Ubuntu Xenial):
status: Fix Committed → Won't Fix
Revision history for this message
seanlano (seanlano) wrote :

I can see three comments saying the fixed that was released to Xenial proposed worked, including for me. What else is required to have the fix verified?

Revision history for this message
Christopher Patrick (cpatrick08) wrote :

I an verify the release to Xenial proposed worked as well

tags: added: xenial
Revision history for this message
Gabe Van Engel (gvengel) wrote :

Why is this high importance bug marked "Won't fix" for Xenial, when the fix is trivial and tested?
 Is there anything we can do to help push this forward?

Revision history for this message
Christopher Patrick (cpatrick08) wrote :

This needs to be fixed in Xenial as the package in xenial-proposed fixes the problem. This problem should not exist but especially the current LTS release. Fix it please or explain why you won't fix it.

tags: added: verification-done-xenial
removed: verification-done
Revision history for this message
Vincent Fortier (th0ma7) wrote :

Interesting that I've just hit this bug.
Current version in xenial is still 3.4.2.
Version 3.5+ is not in proposed update anymore.
This seems like a trivial task to fix, can anyone look into it?
Thnx really much in advance!

Revision history for this message
Vincent Fortier (th0ma7) wrote :

For the one interested into a workaround:

Activate sources channels:
$ sudo perl -p -i.bak -e 's/# deb-src/deb-src/g' /etc/apt/sources.list

Install build dependencies:
$ sudo apt-get update
$ sudo apt-get install fakeroot
$ sudo apt-get build-dep apt-btrfs-snapshot

Download sources from Bionic 18.04:
$ wget http://archive.ubuntu.com/ubuntu/pool/universe/a/apt-btrfs-snapshot/apt-btrfs-snapshot_3.5.1.tar.xz
$ wget http://archive.ubuntu.com/ubuntu/pool/universe/a/apt-btrfs-snapshot/apt-btrfs-snapshot_3.5.1.dsc

Decompress source package:
$ dpkg-source -x apt-btrfs-snapshot_3.5.1.dsc

Build:
$ cd apt-btrfs-snapshot-3.5.1/
$ dpkg-buildpackage -rfakeroot -uc -b
$ cd -

Install:
$ sudo dpkg -i apt-btrfs-snapshot_3.5.1_all.deb

Test:
$ sudo apt-btrfs-snapshot supported
Supported

Upgrade:
$ sudo apt-get update
$ sudo apt-get dist-upgrade -f
...
Create a snapshot of '/tmp/apt-btrfs-snapshot-mp-ycsujp_2/@' in '/tmp/apt-btrfs-snapshot-mp-ycsujp_2/@apt-snapshot-2017-12-14_19:21:13'

Confirm:
$ sudo btrfs subvolume list -p -a -t -u /
ID gen parent top level uuid path
-- --- ------ --------- ---- ----
257 4429 5 5 d1b1ef5b-3e09-064b-bef1-faeeb82e3d10 <FS_TREE>/@
258 4393 5 5 84bb48d7-f40a-3c40-bfd0-f93628a729f5 <FS_TREE>/@home
266 4409 5 5 17ad1ca3-e111-d742-a3b0-58b5a61c6079 <FS_TREE>/@apt-snapshot-2017-12-14_19:21:13

Enjoy!

Revision history for this message
Simon Sebold (simon-sebold1991) wrote :

Another Workaround from my side:

sudo -i
vi /etc/apt/sources.list.d/apt-btrfs-snapshot.list
 #apt-btrfs-snapshot
 deb http://de.archive.ubuntu.com/ubuntu bionic main universe
vi /etc/apt/preferences.d/proposed-updates
 Package: *
 Pin: release a=bionic
 Pin-Priority: 400
apt update
apt install apt-btrfs-snapshot/bionic
apt-btrfs-snapshot supported
exit

Revision history for this message
Andrew Derry (unrheal) wrote :

All these messages from 2016-2017 saying it's fixed in v16..
Now it's 2021, Feb, I'm using up-to date 20.04 LTS with apt-btrfs-snapshot v353.
I still get the message. How could it have been fixed 5 years ago, but I'm still having the problem?
I even made sure there was a copy in /bin and /sbin (and /usr/bin where it was according to which)
Thanks

Revision history for this message
johnny lee (johnnyl33-k) wrote :

I can confirm this still happens on Ubuntu/Xubuntu 20.04 with apt-btrfs-snapshot v353. Is there any intention to fix this?

Revision history for this message
nunya (nunyabeezwaxez) wrote :

This is certainly NOT fixed and it has absolutely nothing at all to do with where the binary is located. The error message itself is completely useless. This is like a car mechanic telling you "Yep, your car doesnt work". Then sending you on your way not telling you wtf the problem is.

So there are 2 problems here:

1. Error message is useless. To ambiguous.
2. The underlying issue is still not fixed.

Revision history for this message
nunya (nunyabeezwaxez) wrote :

After some investigation I found that the underlying issue is: subvol=@ not being used in /etc/fstab. The error msg completely fails to tell the user this very simple information and results in totally unnecessary wasted time debugging things that shouldnt need debugging.

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.