Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1091698

Summary: yum-plugin-fs-snapshot fails to take a BTRFS snapshot
Product: Red Hat Enterprise Linux 7 Reporter: Nux <nux>
Component: yum-utilsAssignee: Michal Domonkos <mdomonko>
Status: CLOSED ERRATA QA Contact: Eva Mrakova <emrakova>
Severity: high Docs Contact:
Priority: unspecified    
Version: 7.0CC: alexander.strachan, alexandre.chanu, brendan, dkochuka, emrakova, jzeleny, riehecky, tbabut, vmukhame, warren
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: yum-utils-1.1.31-35.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-04 00:13:24 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
patch
none
spec file patch none

Description Nux 2014-04-27 11:57:29 UTC
Description of problem:
After installing yum-plugin-fs-snapshot snapshotting operations fail and yum functionality is broken.

Version-Release number of selected component (if applicable):
1.1.31-24.el7

How reproducible:
always

Steps to Reproduce:
1. yum install yum-plugin-fs-snapshot
2. yum install whatever
3.

Actual results:
Running transaction
fs-snapshot: snapshotting /: /yum_20140427124336
Traceback (most recent call last):
  File "/bin/yum", line 29, in <module>
    yummain.user_main(sys.argv[1:], exit_code=True)
  File "/usr/share/yum-cli/yummain.py", line 355, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 261, in main
    return_code = base.doTransaction()
  File "/usr/share/yum-cli/cli.py", line 771, in doTransaction
    resultobject = self.runTransaction(cb=cb)
  File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 1761, in runTransaction
    self.plugins.run('pretrans')
  File "/usr/lib/python2.7/site-packages/yum/plugins.py", line 188, in run
    func(conduitcls(self, self.base, conf, **kwargs))
  File "/usr/lib/yum-plugins/fs-snapshot.py", line 326, in pretrans_hook
    create_snapshots(conduit)
  File "/usr/lib/yum-plugins/fs-snapshot.py", line 316, in create_snapshots
    rc = _create_snapshot(conduit, snapshot_tag, volume)
  File "/usr/lib/yum-plugins/fs-snapshot.py", line 191, in _create_snapshot
    return _create_btrfs_snapshot(conduit, snapshot_tag, volume)
  File "/usr/lib/yum-plugins/fs-snapshot.py", line 215, in _create_btrfs_snapshot
    p = Popen(["/sbin/btrfsctl", "-c", mntpnt], stdout=PIPE, stderr=PIPE)
  File "/usr/lib64/python2.7/subprocess.py", line 711, in __init__
    errread, errwrite)
  File "/usr/lib64/python2.7/subprocess.py", line 1308, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory


btrfs subvolume list /
ID 257 gen 1598 top level 5 path root

Expected results:
yum transaction should complete and snapshot taken

Additional info:

It seems to want "/sbin/btrfsctl" which does not exist in EL7 RC, perhaps related to http://lists.baseurl.org/pipermail/yum-devel/2013-September/010371.html

Comment 2 Brendan Hide 2014-10-14 14:47:36 UTC
Workaround to remove the plugin:
edit /etc/yum/pluginconf.d/fs-snapshot.conf
change "enabled" from "1" to "0"
$ yum remove yum-plugin-fs-snapshot

Comment 3 Warren Young 2014-12-08 23:44:14 UTC
I received a report via private email that simply changing the btrfsctl command to btrfs fixes it.

Comment 4 Warren Young 2014-12-08 23:48:41 UTC
Please ignore the previous. I misunderstood the email. The required change is a bit more involved.

A command like `btrfsctl -s ...` needs to be something like `btrfs subvolume snapshot <fs> <fs>/<snapname>` now.

Comment 8 Michal Domonkos 2016-02-17 17:22:07 UTC
Created attachment 1127982 [details]
patch

Patch in upstream, backporting.

Comment 9 Michal Domonkos 2016-02-17 17:24:55 UTC
> It seems to want "/sbin/btrfsctl" which does not exist in EL7 RC, perhaps
> related to
> http://lists.baseurl.org/pipermail/yum-devel/2013-September/010371.html

Yes, it indeed is.  Thanks for the reference!

Comment 10 Michal Domonkos 2016-02-17 17:31:35 UTC
Created attachment 1127984 [details]
spec file patch

Comment 15 errata-xmlrpc 2016-11-04 00:13:24 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-2187.html