Created attachment 952474 [details] patch for handling getcwd() error when we are calling mock from chroot path Description of problem: When root cache is present and we are trying to run mock from /var/lib/mock/{chroot}, mock fails on os.getcwd(). Version-Release number of selected component (if applicable): 1.2.0-1 How reproducible: Try to run mock --rebuild (without --no-clean) from /var/lib/mock/{chroot} when root cache was created. Steps to Reproduce: 1. mock --init 2. cd /var/lib/mock/fedoraXXX 3. mock --rebuild /path/to/src/XXX.src.rpm Actual results: Getting "OSError: [Errno 2] No such file or directory". Expected results: Rebuilding src.rpm as usual Additional info: Can be catched by additional early checking of current directory and printing more friendly output.
Created attachment 952476 [details] log file attached
I can reproduce.
Thank for the patch, it made my life easier. However there is no need to forbid it. Instead we can just chdir to some / or /tmp or somwhere else, which exatly that does mockbuild.util.find_non_nfs_dir() Commited as 8bc6d24
Hm, but we still can see 'error retrieving current directory: getcwd: cannot access parent directories: No such file or directory' during the build prepare stage
Created attachment 953126 [details] error in output is still present
After a little investigation, it seems that error located in buildroot.py:_setup_dbus_uuid and appears on uuid module loading. Also, every time getcwd() is called in different places we need to add extra check-code . Maybe it is better to do check once?
Right, my investigation ended with same result. I will file BZ on python. Hhmm I will try to move thet to util.py module and make some wrapper aroudn getcwd(), it is used on just two other places.
Created util.pretty_getcwd(), which will try to use getcwd() or orginal path when mock was started or find_non_nfs_dir() as last resort. All instances of getcwd() was edited to util.pretty_getcwd() Commited as 7f347a7
mock-1.2.1-1.fc21 has been submitted as an update for Fedora 21. https://admin.fedoraproject.org/updates/mock-1.2.1-1.fc21
mock-1.2.1-1.fc20 has been submitted as an update for Fedora 20. https://admin.fedoraproject.org/updates/mock-1.2.1-1.fc20
mock-1.2.1-1.el7 has been submitted as an update for Fedora EPEL 7. https://admin.fedoraproject.org/updates/mock-1.2.1-1.el7
mock-1.2.1-1.el6 has been submitted as an update for Fedora EPEL 6. https://admin.fedoraproject.org/updates/mock-1.2.1-1.el6
Package mock-1.2.1-1.fc20: * should fix your issue, * was pushed to the Fedora 20 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing mock-1.2.1-1.fc20' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2014-15217/mock-1.2.1-1.fc20 then log in and leave karma (feedback).
mock-1.2.3-1.fc21 has been submitted as an update for Fedora 21. https://admin.fedoraproject.org/updates/mock-1.2.3-1.fc21
mock-1.2.3-1.fc20 has been submitted as an update for Fedora 20. https://admin.fedoraproject.org/updates/mock-1.2.3-1.fc20
mock-1.2.3-1.el7 has been submitted as an update for Fedora EPEL 7. https://admin.fedoraproject.org/updates/mock-1.2.3-1.el7
mock-1.2.3-1.fc21 has been pushed to the Fedora 21 stable repository. If problems still persist, please make note of it in this bug report.
mock-1.2.3-1.fc20 has been pushed to the Fedora 20 stable repository. If problems still persist, please make note of it in this bug report.
mock-1.2.3-1.el7 has been pushed to the Fedora EPEL 7 stable repository. If problems still persist, please make note of it in this bug report.