Update Fails due to btrfs not being able to take a snapshot

Bug #853849 reported by Damiön la Bagh
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
apt-btrfs-snapshot (Ubuntu)
Fix Released
Medium
Michael Vogt
Xenial
Won't Fix
Medium
Unassigned

Bug Description

x099329@KLMB68684:~$ lsb_release -rd
Description: Ubuntu 11.04
Release: 11.04

apt-btrfs-snapshot

What I expected to happen:
I expected Update Manager to update my computer.

What really happened:
installArchives() failed: Create a snapshot of '/tmp/apt-btrfs-snapshot-mp-OY3YRo/@' in '/tmp/apt-btrfs-snapshot-mp-OY3YRo/@apt-snapshot-2011-09-19_14:55:26'

Create a snapshot of '/tmp/apt-btrfs-snapshot-mp-2BJcCi/@' in '/tmp/apt-btrfs-snapshot-mp-2BJcCi/@apt-snapshot-2011-09-19_14:55:26/@'

Create a snapshot of '/tmp/apt-btrfs-snapshot-mp-o5YK6p/@' in '/tmp/apt-btrfs-snapshot-mp-o5YK6p/@apt-snapshot-2011-09-19_14:55:26/@'

ERROR: cannot snapshot '/tmp/apt-btrfs-snapshot-mp-o5YK6p/@'

I logged out and logged back in and tried again, but didn't work.

There is 64GB free space so it's not a space issue
/dev/sda1 74G 6,4G 64G 10% /
none 1,1G 730k 1,1G 1% /dev
none 1,1G 1,5M 1,1G 1% /dev/shm
none 1,1G 234k 1,1G 1% /var/run
none 1,1G 0 1,1G 0% /var/lock
/dev/sda1 74G 6,4G 64G 10% /home

This is the only thing I could find in the logging
Sep 19 14:55:26 KLMB68684 kernel: [29794.276339] device fsid 549cc6d5403793a-2f70e4cf3c24e5af devid 1 transid 9957 /dev/sda1
Sep 19 14:55:26 KLMB68684 kernel: [29794.349977] btrfs: unlinked 7 orphans
Sep 19 14:55:26 KLMB68684 kernel: [29794.423598] device fsid 549cc6d5403793a-2f70e4cf3c24e5af devid 1 transid 9958 /dev/sda1
Sep 19 14:55:26 KLMB68684 kernel: [29794.541662] btrfs: unlinked 7 orphans

This is a security bug as I cannot update my computer.

ProblemType: Bug
DistroRelease: Ubuntu 11.04
Package: apt-btrfs-snapshot 0.1.1
ProcVersionSignature: Ubuntu 2.6.38-11.48-generic 2.6.38.8
Uname: Linux 2.6.38-11-generic x86_64
Architecture: amd64
Date: Mon Sep 19 14:56:26 2011
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Release amd64 (20110427.1)
PackageArchitecture: all
ProcEnviron:
 LANGUAGE=nl_NL:en
 LANG=nl_NL.UTF-8
 SHELL=/bin/bash
SourcePackage: apt-btrfs-snapshot
UpgradeStatus: No upgrade log present (probably fresh install)

Related branches

Revision history for this message
Damiön la Bagh (kat-amsterdam) wrote :
Revision history for this message
Damiön la Bagh (kat-amsterdam) wrote :

This piece of the syslog is also interesting.

Sep 16 05:23:37 KLMB68684 AptDaemon.Worker: INFO: Installing local package file: /home/x099329/Downloads/google-chrome-stable_current_amd64.deb
Sep 16 05:24:04 KLMB68684 AptDaemon.Worker: WARNING: An additional step to open the cache is required
Sep 16 05:24:15 KLMB68684 AptDaemon.Worker: INFO: Finished transaction /org/debian/apt/transaction/b402518372104a039cf9f106e34d2642
Sep 16 05:25:47 KLMB68684 AptDaemon: INFO: CommitPackages() was called: dbus.Array([dbus.String(u'apt-btrfs-snapshot')], signature=dbus.Signature('s')), dbus.Array([dbus.String(u'')], signature=dbus.Signature('s')), dbus.Array([dbus.String(u'')], signature=dbus.Signature('s')), dbus.Array([dbus.String(u'')], signature=dbus.Signature('s')), dbus.Array([dbus.String(u'')], signature=dbus.Signature('s')), dbus.Array([dbus.String(u'')], signature=dbus.Signature('s'))
Sep 16 05:25:47 KLMB68684 AptDaemon.Trans: INFO: Queuing transaction /org/debian/apt/transaction/8b8eea0313c84714b8fb159ebc951d32
Sep 16 05:25:52 KLMB68684 AptDaemon.Worker: INFO: Simulating trans: /org/debian/apt/transaction/8b8eea0313c84714b8fb159ebc951d32
Sep 16 05:25:52 KLMB68684 AptDaemon.Worker: INFO: Committing packages: dbus.Array([dbus.String(u'apt-btrfs-snapshot')], signature=dbus.Signature('s')), dbus.Array([], signature=dbus.Signature('s')), dbus.Array([], signature=dbus.Signature('s')), dbus.Array([], signature=dbus.Signature('s')), dbus.Array([], signature=dbus.Signature('s')), dbus.Array([], signature=dbus.Signature('s'))
Sep 16 05:25:53 KLMB68684 AptDaemon.Worker: INFO: Processing transaction /org/debian/apt/transaction/8b8eea0313c84714b8fb159ebc951d32
Sep 16 05:25:54 KLMB68684 AptDaemon.Worker: INFO: Committing packages: dbus.Array([dbus.String(u'apt-btrfs-snapshot')], signature=dbus.Signature('s')), dbus.Array([], signature=dbus.Signature('s')), dbus.Array([], signature=dbus.Signature('s')), dbus.Array([], signature=dbus.Signature('s')), dbus.Array([], signature=dbus.Signature('s')), dbus.Array([], signature=dbus.Signature('s'))
Sep 16 05:25:56 KLMB68684 AptDaemon.Worker: INFO: Finished transaction /org/debian/apt/transaction/8b8eea0313c84714b8fb159ebc951d32
Sep 16 05:31:37 KLMB68684 AptDaemon: INFO: Quitting due to inactivity

Revision history for this message
Jamie Strandboge (jdstrand) wrote : Bug is not a security issue

Thanks for taking the time to report this bug and helping to make Ubuntu better. We appreciate the difficulties you are facing, but this appears to be a "regular" (non-security) bug. I have unmarked it as a security issue since this bug does not show evidence of allowing attackers to cross privilege boundaries nor directly cause loss of data/privacy. Please feel free to report any other bugs you may find.

security vulnerability: yes → no
visibility: private → public
Revision history for this message
Michael Vogt (mvo) wrote :

Thanks for your bugreport.

The feature requires that there is a subvolume "@" on the root "/". This is created automatically with the standard patition layout. The check in apt-btrfs-snapshot needs to improve.

Changed in apt-btrfs-snapshot (Ubuntu):
status: New → Incomplete
status: Incomplete → Confirmed
importance: Undecided → Medium
Revision history for this message
Damiön la Bagh (kat-amsterdam) wrote :

This is my fstab (I've modified the UUID's in the post for security) As you can see the subvolume is @ on /

# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc nodev,noexec,nosuid 0 0
# / was on /dev/sda1 during installation
UUID=3a790354-6dcc-4905-afe5-xxxxxxxxxxxx / btrfs defaults,subvol=@ 0 1
# /home was on /dev/sda1 during installation
UUID=3a790354-6dcc-4905-afe5-xxxxxxxxxxxx /home btrfs defaults,subvol=@home 0 2
# swap was on /dev/sda2 during installation
UUID=05149535-4fc5-49b1-b661-xxxxxxxxxxxx none swap sw 0 0

Michael Vogt (mvo)
Changed in apt-btrfs-snapshot (Ubuntu):
assignee: nobody → Michael Vogt (mvo)
Revision history for this message
Michael Vogt (mvo) wrote :

Thanks a lot Kat! What happens if you manually create a snapshot with the folling command:
$ sudo apt-btrfs-snapshot snapshot --debug
any output that may help diagnose the issue?

Revision history for this message
Damiön la Bagh (kat-amsterdam) wrote :

This is what I get...

x099329@KLMB68684:/tmp$ sudo apt-btrfs-snapshot snapshot --debug
Create a snapshot of '/tmp/apt-btrfs-snapshot-mp-KHC0Hw/@' in '/tmp/apt-btrfs-snapshot-mp-KHC0Hw/@apt-snapshot---debug2011-10-11_17:38:47'

I've attached the directory listing of /tmp after the snapshot... I can't find the apt-btrfs-snapshot-mp-KHC0Hw anywhere

syslog shows this

ct 11 17:36:14 KLMB68684 AptDaemon: INFO: Initializing daemon
Oct 11 17:36:23 KLMB68684 AptDaemon: INFO: CommitPackages() was called: dbus.Array([dbus.String(u'apt-btrfs-snapshot')], signature=dbus.Signature('s')), dbus.Array([dbus.String(u'')], signature=dbus.Signature('s')), dbus.Array([dbus.String(u'')], signature=dbus.Signature('s')), dbus.Array([dbus.String(u'')], signature=dbus.Signature('s')), dbus.Array([dbus.String(u'')], signature=dbus.Signature('s')), dbus.Array([dbus.String(u'')], signature=dbus.Signature('s'))
Oct 11 17:36:23 KLMB68684 AptDaemon.Trans: INFO: Queuing transaction /org/debian/apt/transaction/e5d2fbbe2eba46389be0a7afb4f607d1
Oct 11 17:36:27 KLMB68684 AptDaemon.Worker: INFO: Simulating trans: /org/debian/apt/transaction/e5d2fbbe2eba46389be0a7afb4f607d1
Oct 11 17:36:27 KLMB68684 AptDaemon.Worker: INFO: Committing packages: dbus.Array([dbus.String(u'apt-btrfs-snapshot')], signature=dbus.Signature('s')), dbus.Array([], signature=dbus.Signature('s')), dbus.Array([], signature=dbus.Signature('s')), dbus.Array([], signature=dbus.Signature('s')), dbus.Array([], signature=dbus.Signature('s')), dbus.Array([], signature=dbus.Signature('s'))
Oct 11 17:36:28 KLMB68684 AptDaemon.Worker: INFO: Processing transaction /org/debian/apt/transaction/e5d2fbbe2eba46389be0a7afb4f607d1
Oct 11 17:36:29 KLMB68684 AptDaemon.Worker: INFO: Committing packages: dbus.Array([dbus.String(u'apt-btrfs-snapshot')], signature=dbus.Signature('s')), dbus.Array([], signature=dbus.Signature('s')), dbus.Array([], signature=dbus.Signature('s')), dbus.Array([], signature=dbus.Signature('s')), dbus.Array([], signature=dbus.Signature('s')), dbus.Array([], signature=dbus.Signature('s'))
Oct 11 17:36:33 KLMB68684 AptDaemon.Worker: INFO: Finished transaction /org/debian/apt/transaction/e5d2fbbe2eba46389be0a7afb4f607d1
Oct 11 17:37:08 KLMB68684 kernel: [29409.869348] device fsid 549cc6d5403793a-2f70e4cf3c24e5af devid 1 transid 33383 /dev/sda1
Oct 11 17:37:08 KLMB68684 kernel: [29409.913790] btrfs: unlinked 32 orphans
Oct 11 17:38:47 KLMB68684 kernel: [29509.212811] device fsid 549cc6d5403793a-2f70e4cf3c24e5af devid 1 transid 33388 /dev/sda1
Oct 11 17:38:47 KLMB68684 kernel: [29509.267000] btrfs: unlinked 35 orphans

Revision history for this message
Damiön la Bagh (kat-amsterdam) wrote :
Revision history for this message
Ian Ohr (munk3h) wrote :

I'm getting the same error messages on 12.04.2 LTS

ian@ubuntu-pc:~$ lsb_release -rd
Description: Ubuntu 12.04.2 LTS
Release: 12.04

ian@ubuntu-pc:~$ sudo apt-btrfs-snapshot supported
[sudo] password for ian:
Supported

Failure using Updater shows this error:
====
installArchives() failed: Supported
Create a snapshot of '/tmp/apt-btrfs-snapshot-mp-t8mziy/@' in '/tmp/apt-btrfs-snapshot-mp-t8mziy/@apt-snapshot-2013-03-19_08:02:05'
Supported
Create a snapshot of '/tmp/apt-btrfs-snapshot-mp-9V5i0H/@' in '/tmp/apt-btrfs-snapshot-mp-9V5i0H/@apt-snapshot-2013-03-19_08:02:06'
Supported
Create a snapshot of '/tmp/apt-btrfs-snapshot-mp-WAjeCZ/@' in '/tmp/apt-btrfs-snapshot-mp-WAjeCZ/@apt-snapshot-2013-03-19_08:02:06/@'
ERROR: cannot snapshot '/tmp/apt-btrfs-snapshot-mp-WAjeCZ/@'
====

On the command line, it works fine. See attached

tags: added: precise
Revision history for this message
Bram Geron (bgeron) wrote :

You probably need an SSD to reproduce this bug.

Bram Geron (bgeron)
Changed in apt-btrfs-snapshot (Ubuntu):
status: Confirmed → Fix Committed
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):
status: Fix Committed → Fix Released
Revision history for this message
Martin Pitt (pitti) wrote : Please test proposed package

Hello Damiön, 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: New → Fix Committed
tags: added: verification-needed
Mathew Hodson (mhodson)
Changed in apt-btrfs-snapshot (Ubuntu Xenial):
importance: Undecided → Medium
Revision history for this message
Damiön la Bagh (kat-amsterdam) wrote :

The machine from 2011 has been decommissioned but I still have it in storage. I will try to replicate this bug this weekend using a similar setup as I see the original FSTAB in this bug-report.

Revision history for this message
Damiön la Bagh (kat-amsterdam) wrote :

Ha,ha,ha :D
On the first laptop I now get the message:
"Sorry, your system lacks support for the snapshot feature"

That's one way of solving the bug. :D

I'm upgrading another laptop with the same btrfs config to see what message I get there.

Revision history for this message
Damiön la Bagh (kat-amsterdam) wrote :

On the other laptop:
14.04.5 with proposed enabled

sudo apt-btrfs-snapshot
Traceback (most recent call last):
    File "/usr/bin/apt-btrfs-snapshot", line 98, in <module>
      if args.command == "supported":
AttributeError: 'Namespace' object has no attribute 'command'

I'll upgrade this machine to 16.04.1 to see if the problem still exists there.

Revision history for this message
Damiön la Bagh (kat-amsterdam) wrote :

Upgraded a second laptop to 16.04.1

get the exact same message as with 14.04.5

sudo apt-btrfs-snapshot
Traceback (most recent call last):
    File "/usr/bin/apt-btrfs-snapshot", line 98, in <module>
      if args.command == "supported":
AttributeError: 'Namespace' object has no attribute 'command'

Revision history for this message
Damiön la Bagh (kat-amsterdam) wrote :

Sorry forgot to mention the version of the package I tested:

apt-btrfs-snapshot 3.5.1~ubuntu

tags: added: verification-failed
removed: verification-needed
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
Rolf Leggewie (r0lf) wrote :

This bug should be reopened. Damiön ran "sudo apt-btrfs-snapshot" without any subcommand and thus ran into bug 1217828. This was not a failure to verify if the fix worked or not, it was simply another bug.

Please reopen.

Revision history for this message
Damiön la Bagh (kat-amsterdam) wrote :

Thanks, after loosing 4 terabytes of data due to buggy BTRFS, I moved away from the file system back to ext4. I still have the machine on a shelf for the day BTRFS becomes stable or gains recovery tools, so I can recover and access the data again.

If you want to test this specific case then create a full disk BTRFS (no partition table) on a small disk SSD (128GB) and run the apt-btrfs-snapshot command with no arguments.

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.