Bug 1010974 - [abrt] yum-3.4.3-106.fc19: subprocess.py:1308:_execute_child:OSError: [Errno 2] No such file or directory
[abrt] yum-3.4.3-106.fc19: subprocess.py:1308:_execute_child:OSError: [Errno ...
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: yum (Show other bugs)
19
x86_64 Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: packaging-team-maint
Fedora Extras Quality Assurance
abrt_hash:a1d02c0dfe1558f2e7678baed61...
:
: 1013377 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-09-23 08:21 EDT by Stephen Degler
Modified: 2013-09-30 02:45 EDT (History)
7 users (show)

See Also:
Fixed In Version: yum-utils-1.1.31-18.fc19
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-09-28 21:46:13 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
File: backtrace (2.43 KB, text/plain)
2013-09-23 08:21 EDT, Stephen Degler
no flags Details
File: dso_list (76 bytes, text/plain)
2013-09-23 08:21 EDT, Stephen Degler
no flags Details
File: environ (2.23 KB, text/plain)
2013-09-23 08:21 EDT, Stephen Degler
no flags Details

  None (edit)
Description Stephen Degler 2013-09-23 08:21:45 EDT
Description of problem:
yum plugin fs snapshot

Version-Release number of selected component:
yum-3.4.3-106.fc19

Additional info:
reporter:       libreport-2.1.7
cmdline:        /usr/bin/python /bin/yum -y upgrade
executable:     /bin/yum
kernel:         3.11.1-200.fc19.x86_64.debug
runlevel:       N 5
type:           Python
uid:            0

Truncated backtrace:
subprocess.py:1308:_execute_child:OSError: [Errno 2] No such file or directory

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 316, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 219, in main
    return_code = base.doTransaction()
  File "/usr/share/yum-cli/cli.py", line 732, in doTransaction
    resultobject = self.runTransaction(cb=cb)
  File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 1732, 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

Local variables in innermost frame:
errread: 56
c2pread: 31
gc_was_enabled: True
errwrite: 57
shell: False
errpipe_write: 59
executable: '/sbin/btrfsctl'
close_fds: False
self: <subprocess.Popen object at 0x6ec0710>
env: None
cwd: None
child_exception: OSError(2, 'No such file or directory')
args: ['/sbin/btrfsctl', '-c', '/']
c2pwrite: 55
data: 'cexceptions\nOSError\np0\n(I2\nS\'No such file or directory\'\np1\ntp2\nRp3\n(dp4\nS\'child_traceback\'\np5\nS\'Traceback (most recent call last):\\n  File "/usr/lib64/python2.7/subprocess.py", line 1263, in _execute_child\\n    os.execvp(executable, args)\\n  File "/usr/lib64/python2.7/os.py", line 344, in execvp\\n    _execvpe(file, args)\\n  File "/usr/lib64/python2.7/os.py", line 368, in _execvpe\\n    func(file, *argrest)\\nOSError: [Errno 2] No such file or directory\\n\'\np6\nsb.'
creationflags: 0
errpipe_read: 58
preexec_fn: None
p2cread: None
startupinfo: None
p2cwrite: None
universal_newlines: False
Comment 1 Stephen Degler 2013-09-23 08:21:50 EDT
Created attachment 801588 [details]
File: backtrace
Comment 2 Stephen Degler 2013-09-23 08:21:53 EDT
Created attachment 801589 [details]
File: dso_list
Comment 3 Stephen Degler 2013-09-23 08:21:57 EDT
Created attachment 801590 [details]
File: environ
Comment 4 Zdeněk Pavlas 2013-09-23 08:37:30 EDT
Probably a missing dep, I hope this is good enough:

commit 3910e8712775e0de2ffd1a9859396f5b051b45a2
Author: Zdenek Pavlas <zpavlas@redhat.com>
Date:   Mon Sep 23 14:36:04 2013 +0200

    yum-plugin-fs-snapshot requires btrfs-progs

diff --git a/yum-utils.spec b/yum-utils.spec
index e22d692..6d6d699 100644
--- a/yum-utils.spec
+++ b/yum-utils.spec
@@ -350,6 +350,7 @@ repo. removes it (and can thus. be reinstalled/downgraded/etc.).
 Summary: Yum plugin to automatically snapshot your filesystems during updates
 Group: System Environment/Base
 Requires: yum >= 3.2.22
+Requires: btrfs-progs
 
 %description -n yum-plugin-fs-snapshot
 When this plugin is installed it will automatically snapshot any
Comment 5 Stephen Degler 2013-09-23 18:40:54 EDT
Ah, latest btrfs-progs *does not include btrfsctl*

Whats the point of the fs sync?  Is that needed or just paranoia?
The following appears to work for me.

% diff -u fs-snapshot.py /usr/lib/yum-plugins/fs-snapshot.py
--- fs-snapshot.py	2013-09-23 18:34:37.488541760 -0400
+++ /usr/lib/yum-plugins/fs-snapshot.py	2013-09-23 18:26:46.497672471 -0400
-    p = Popen(["/sbin/btrfsctl", "-c", mntpnt], stdout=PIPE, stderr=PIPE)
-    err = p.wait()
-    if err:
-        return 1
-    p = Popen(["/sbin/btrfsctl", "-s", snapname, mntpnt], stdout=PIPE, stderr=PIPE)
+    #p = Popen(["/sbin/btrfsctl", "-c", mntpnt], stdout=PIPE, stderr=PIPE)
+    #err = p.wait()
+    #if err:
+    #    return 1
+    p = Popen(["/sbin/btrfs", "subvolume", "snapshot", mntpnt, snapname], stdout=PIPE, stderr=PIPE)
Comment 6 Zdeněk Pavlas 2013-09-24 03:38:12 EDT
It depends.. if the block cache is implemented on top of lvm (and it probably is, because that'd make it a bit faster), then we definitely *should* sync before snapshotting. All examples I've googled so far include the sync, so let's keep it.

Could you just change "btrfsctl -c <mntpnt>" to "btrfs filesystem sync <mntpnt>"? If that works, I'd merge your patch.  Thanks!
Comment 7 Stephen Degler 2013-09-24 10:53:41 EDT
Ok, here is the patch as requested, with function doc updated as well.


% diff -u fs-snapshot.py /usr/lib/yum-plugins/fs-snapshot.py
--- fs-snapshot.py	2013-09-23 18:34:37.488541760 -0400
+++ /usr/lib/yum-plugins/fs-snapshot.py	2013-09-24 10:39:52.993241471 -0400
@@ -198,9 +198,8 @@
     """
     Runs the commands necessary for a snapshot.  Basically its just
 
-    btrfsctl -c /dir/to/snapshot    #this syncs the fs
-    btrfsctl -s /dir/to/snapshot/${snapshot_tag}
-                /dir/to/snapshot
+    btrfs filesystem sync /dir/to/snapshot    #this syncs the fs
+    btrfs subvolume snapshot /dir/to/snapshot /dir/to/snapshot/${snapshot_tag}
 
     and then we're done.
     """
@@ -212,11 +211,11 @@
 
     snapname = mntpnt + snapshot_tag
     conduit.info(1, "fs-snapshot: snapshotting " + mntpnt + ": " + snapname)
-    p = Popen(["/sbin/btrfsctl", "-c", mntpnt], stdout=PIPE, stderr=PIPE)
+    p = Popen(["/sbin/btrfs", "filesystem", "sync", mntpnt], stdout=PIPE, stderr=PIPE)
     err = p.wait()
     if err:
         return 1
-    p = Popen(["/sbin/btrfsctl", "-s", snapname, mntpnt], stdout=PIPE, stderr=PIPE)
+    p = Popen(["/sbin/btrfs", "subvolume", "snapshot", mntpnt, snapname], stdout=PIPE, stderr=PIPE)
     err = p.wait()
     if err:
         return 1
Comment 8 Fedora Update System 2013-09-27 08:26:21 EDT
yum-utils-1.1.31-18.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/yum-utils-1.1.31-18.fc19
Comment 9 Fedora Update System 2013-09-27 20:22:13 EDT
Package yum-utils-1.1.31-18.fc19:
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing yum-utils-1.1.31-18.fc19'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-17856/yum-utils-1.1.31-18.fc19
then log in and leave karma (feedback).
Comment 10 Fedora Update System 2013-09-28 21:46:13 EDT
yum-utils-1.1.31-18.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 11 Zdeněk Pavlas 2013-09-30 02:45:08 EDT
*** Bug 1013377 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.