+++ This bug was initially created as a clone of Bug #1205564 +++ --- Additional comment from on 2015-12-07 18:24:05 EST --- Doesn't work on my system. First, some proof: $ dnf list installed mock Installed Packages mock.noarch 1.2.13-2.fc22 @updates $ mock --clean --trace # excerpt INFO: ENTER umount(<mockbuild.mounts.FileSystemMountPoint object at 0x7fc93078c320>) INFO: LEAVE umount --> None INFO: LEAVE umountall --> None INFO: ENTER call_hooks(<mockbuild.plugin.Plugins object at 0x7fc93c994b70>, 'umount_root') INFO: LEAVE call_hooks --> None INFO: ENTER _unlock_buildroot(<mockbuild.buildroot.Buildroot object at 0x7fc93077f9e8>) INFO: LEAVE _unlock_buildroot --> None INFO: EXCEPTION: [Errno 1] Operation not permitted: '/var/lib/mock/fedora-22-x86_64/root/var/lib/machines' Traceback (most recent call last): File "/usr/lib/python3.4/site-packages/mockbuild/trace_decorator.py", line 84, in trace result = func(*args, **kw) File "/usr/lib/python3.4/site-packages/mockbuild/buildroot.py", line 563, in delete util.rmtree(self.basedir, selinux=self.selinux) File "/usr/lib/python3.4/site-packages/mockbuild/trace_decorator.py", line 84, in trace result = func(*args, **kw) File "/usr/lib/python3.4/site-packages/mockbuild/util.py", line 136, in rmtree rmtree(fullname, selinux=selinux, exclude=exclude) File "/usr/lib/python3.4/site-packages/mockbuild/trace_decorator.py", line 84, in trace result = func(*args, **kw) File "/usr/lib/python3.4/site-packages/mockbuild/util.py", line 136, in rmtree rmtree(fullname, selinux=selinux, exclude=exclude) File "/usr/lib/python3.4/site-packages/mockbuild/trace_decorator.py", line 84, in trace result = func(*args, **kw) File "/usr/lib/python3.4/site-packages/mockbuild/util.py", line 136, in rmtree rmtree(fullname, selinux=selinux, exclude=exclude) File "/usr/lib/python3.4/site-packages/mockbuild/trace_decorator.py", line 84, in trace result = func(*args, **kw) File "/usr/lib/python3.4/site-packages/mockbuild/util.py", line 136, in rmtree rmtree(fullname, selinux=selinux, exclude=exclude) File "/usr/lib/python3.4/site-packages/mockbuild/trace_decorator.py", line 84, in trace result = func(*args, **kw) File "/usr/lib/python3.4/site-packages/mockbuild/util.py", line 145, in rmtree os.rmdir(path) PermissionError: [Errno 1] Operation not permitted: '/var/lib/mock/fedora-22-x86_64/root/var/lib/machines' INFO: LEAVE delete --> EXCEPTION RAISED INFO: EXCEPTION: [Errno 1] Operation not permitted: '/var/lib/mock/fedora-22-x86_64/root/var/lib/machines' Traceback (most recent call last): File "/usr/lib/python3.4/site-packages/mockbuild/trace_decorator.py", line 84, in trace result = func(*args, **kw) File "/usr/lib/python3.4/site-packages/mockbuild/backend.py", line 72, in clean self.buildroot.delete() File "/usr/lib/python3.4/site-packages/mockbuild/trace_decorator.py", line 84, in trace result = func(*args, **kw) File "/usr/lib/python3.4/site-packages/mockbuild/buildroot.py", line 563, in delete util.rmtree(self.basedir, selinux=self.selinux) File "/usr/lib/python3.4/site-packages/mockbuild/trace_decorator.py", line 84, in trace result = func(*args, **kw) File "/usr/lib/python3.4/site-packages/mockbuild/util.py", line 136, in rmtree rmtree(fullname, selinux=selinux, exclude=exclude) File "/usr/lib/python3.4/site-packages/mockbuild/trace_decorator.py", line 84, in trace result = func(*args, **kw) File "/usr/lib/python3.4/site-packages/mockbuild/util.py", line 136, in rmtree rmtree(fullname, selinux=selinux, exclude=exclude) File "/usr/lib/python3.4/site-packages/mockbuild/trace_decorator.py", line 84, in trace result = func(*args, **kw) File "/usr/lib/python3.4/site-packages/mockbuild/util.py", line 136, in rmtree rmtree(fullname, selinux=selinux, exclude=exclude) File "/usr/lib/python3.4/site-packages/mockbuild/trace_decorator.py", line 84, in trace result = func(*args, **kw) File "/usr/lib/python3.4/site-packages/mockbuild/util.py", line 136, in rmtree rmtree(fullname, selinux=selinux, exclude=exclude) File "/usr/lib/python3.4/site-packages/mockbuild/trace_decorator.py", line 84, in trace result = func(*args, **kw) File "/usr/lib/python3.4/site-packages/mockbuild/util.py", line 145, in rmtree os.rmdir(path) PermissionError: [Errno 1] Operation not permitted: '/var/lib/mock/fedora-22-x86_64/root/var/lib/machines' INFO: LEAVE clean --> EXCEPTION RAISED INFO: ENTER finalize(<mockbuild.buildroot.Buildroot object at 0x7fc93077f9e8>) INFO: ENTER make_chroot_path(<mockbuild.buildroot.Buildroot object at 0x7fc93077f9e8>) INFO: LEAVE make_chroot_path --> /var/lib/mock/fedora-22-x86_64/root It doesn't work because of my btrfs layout: $ btrfs subvolume list / | egrep -i "mock|var|root" ID 257 gen 935842 top level 5 path root ID 258 gen 935847 top level 5 path var ID 724 gen 935172 top level 258 path var/lib/machines ID 3157 gen 935516 top level 258 path var/lib/mock/fedora-22-x86_64/root/var/lib/machines $ btrfs subvolume list /var/lib/mock/fedora-22-x86_64/ | egrep -i "mock|var|root" ID 257 gen 935851 top level 5 path root ID 258 gen 935857 top level 5 path var ID 3157 gen 935516 top level 258 path lib/mock/fedora-22-x86_64/root/var/lib/machines | notice -----------------------------------| This is because subvolumes are trees, which makes parsing more difficult ... but "btrfs subvolume list" does all the heavy lifting given the appropriate arguments. $ btrfs subvolume list -a /var/lib/mock/fedora-22-x86_64 | egrep -i "mock|var|root" ID 257 gen 935878 top level 5 path <FS_TREE>/root ID 258 gen 935880 top level 5 path <FS_TREE>/var ID 724 gen 935172 top level 258 path var/lib/machines ID 3157 gen 935516 top level 258 path var/lib/mock/fedora-22-x86_64/root/var/lib/machines $ btrfs subvolume list -o /var/lib/mock/fedora-22-x86_64 ID 724 gen 935172 top level 258 path var/lib/machines ID 3157 gen 935516 top level 258 path var/lib/mock/fedora-22-x86_64/root/var/lib/machines Proposed workaround: modify find_btrfs_in_chroot() to add the above "-o" flag: def find_btrfs_in_chroot(mockdir, chroot_path): ... try: for l in do(["btrfs", "subv", "list", "-o", mockdir], returnOutput=1)[:-1].splitlines(): ...
Hmm RHEL6 does not support -o option :(
Just tried to build some rpms on centos 7.2, hit this bug, added -o option, still doesn't work :(
This bug appears to have been reported against 'rawhide' during the Fedora 24 development cycle. Changing version to '24'. More information and reason for this action is here: https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora24#Rawhide_Rebase
This message is a reminder that Fedora 25 is nearing its end of life. Approximately 4 (four) weeks from now Fedora will stop maintaining and issuing updates for Fedora 25. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '25'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 25 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
Fedora 25 changed to end-of-life (EOL) status on 2017-12-12. Fedora 25 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed.