Description of problem: After a failed build, mock scrub fails: $ mock -r fedora-rawhide-x86_64 --scrub=chroot INFO: mock.py version 1.1.27 starting... Start: init plugins INFO: selinux enabled Finish: init plugins Start: run Start: lock buildroot Start: scrub ['chroot'] ERROR: [Errno 2] No such file or directory: '/var/lib/mock/fedora-rawhide-x86_64/result/state.log' Traceback (most recent call last): File "/usr/sbin/mock", line 539, in <module> def do_buildsrpm(config_opts, chroot, options, args): File "/usr/sbin/mock", line 788, in main chroot.scrub(options.scrub) File "<peak.util.decorators.rewrap wrapping mockbuild.backend.scrub at 0x0294B140>", line 3, in scrub def scrub(self, scrub_opts): return __decorated(self, scrub_opts) File "/usr/lib/python2.7/site-packages/mockbuild/trace_decorator.py", line 70, in trace result = func(*args, **kw) File "/usr/lib/python2.7/site-packages/mockbuild/backend.py", line 209, in scrub self._resetLogging() File "<peak.util.decorators.rewrap wrapping mockbuild.backend._resetLogging at 0x02953F50>", line 3, in _resetLogging def _resetLogging(self): return __decorated(self) File "/usr/lib/python2.7/site-packages/mockbuild/trace_decorator.py", line 70, in trace result = func(*args, **kw) File "/usr/lib/python2.7/site-packages/mockbuild/backend.py", line 969, in _resetLogging fh = logging.FileHandler(fullPath, "a+") File "/usr/lib64/python2.7/logging/__init__.py", line 897, in __init__ StreamHandler.__init__(self, self._open()) File "/usr/lib64/python2.7/logging/__init__.py", line 916, in _open stream = open(self.baseFilename, self.mode) IOError: [Errno 2] No such file or directory: '/var/lib/mock/fedora-rawhide-x86_64/result/state.log' Version-Release number of selected component (if applicable): mock-1.1.27-2.fc19.noarch How reproducible: Always Steps to Reproduce: 1. Make a build fail 2. mock -r <profile> --scrub={all|chroot} Additional info: Workaround: mkdir -p /var/lib/mock/fedora-rawhide-x86_64/result/ touch /var/lib/mock/fedora-rawhide-x86_64/result/state.log mock -r <profile> --scrub=all
Good catch. Looks like the scrub code has places where it presumes the chroot paths exist and when they don't, boom. Trying to decide now whether to check for existence of the path and if it's not there just return success or whether I should create the skeleton of the path (/var/lib/mock/fedora-rawhide-x86_64/result in the above case) and let things continue.
Created attachment 620488 [details] patch to allow scrub of non-existent chroot Please try the attached patch to make sure it works for your configuration
Ugh, I was too quick on that patch above. seems to be causing failures in my regression test suite. I'll debug this and post a second patch.
any news?:)
Well, nothing good. I tried to short-circuit the problem in the backend code (in the init method) but I'm seeing a failure in rawhide. Unfortunately this has coincided with a rare set of travel for me so I probably won't get back on this until I get back home (this coming Monday).
still looking at it
Created attachment 636369 [details] Simpler patch to handle scrub calls to non-existant chroots Put scrub body inside try/except/finally block and issue warning if called on non-existent chroot. Queued to go out with 1.1.28
mock-1.1.28-1.el6 has been submitted as an update for Fedora EPEL 6. https://admin.fedoraproject.org/updates/mock-1.1.28-1.el6
mock-1.1.28-1.fc18 has been submitted as an update for Fedora 18. https://admin.fedoraproject.org/updates/mock-1.1.28-1.fc18
mock-1.0.36-1.el5 has been submitted as an update for Fedora EPEL 5. https://admin.fedoraproject.org/updates/mock-1.0.36-1.el5
mock-1.1.28-1.fc17 has been submitted as an update for Fedora 17. https://admin.fedoraproject.org/updates/mock-1.1.28-1.fc17
mock-1.1.28-1.fc16 has been submitted as an update for Fedora 16. https://admin.fedoraproject.org/updates/mock-1.1.28-1.fc16
Package mock-1.1.28-1.el6: * should fix your issue, * was pushed to the Fedora EPEL 6 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=epel-testing mock-1.1.28-1.el6' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-EPEL-2012-13374/mock-1.1.28-1.el6 then log in and leave karma (feedback).
mock-1.1.28-1.fc17 has been pushed to the Fedora 17 stable repository. If problems still persist, please make note of it in this bug report.
mock-1.1.28-1.fc16 has been pushed to the Fedora 16 stable repository. If problems still persist, please make note of it in this bug report.
mock-1.0.36-1.el5 has been pushed to the Fedora EPEL 5 stable repository. If problems still persist, please make note of it in this bug report.