Bug 1281369

Summary: mock <options> <localpath>/my.srpm fails if <localpath>/my.srpm is on nfs filesytem
Product: [Fedora] Fedora EPEL Reporter: Mark Robinson <mrobinson>
Component: mockAssignee: Miroslav Suchý <msuchy>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: el6CC: jdisnard, mebrown, msimacek, msuchy, praiskup, williams
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: mock-1.2.14-1.fc23 mock-1.2.14-1.el6 mock-1.2.14-1.fc22 mock-1.2.14-1.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-27 18:21:21 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
Proposed patch of the root_cache.py file none

Description Mark Robinson 2015-11-12 12:02:06 UTC
Created attachment 1093194 [details]
Proposed patch of the root_cache.py file

Description of problem:
This is related to https://bugzilla.redhat.com/show_bug.cgi?id=916685 which was closed, but the underlying issue did not get fixed.

Unable to run mock -r <config> srpms/my.srpm on a Vagrant guest (running in /vagrant).

The problem seems to come about in re-using the existing root cache.

In _rootCacheLock, mockbuild.util.get_fs_type detects that /vagrant is an 'nfs' drive, and then changes the working-directory to a 'non-nfs' drive (from mockbuild.util.find_non_nfs_dir). However, as the working directory is no longer in /vagrant, mock is then unable to find the srpm.

Have attached a possible patch (this assumes that the functionality of unpacking of the root cache is contained in that function, and there are no side effects where other functions may need to be in a non-nfs directory - IIUC, https://bugzilla.redhat.com/show_bug.cgi?id=649192 was originally raised to implement the get_fs_type/find_non_nfs_dir directory)


Version-Release number of selected component (if applicable):
mock-1.1.38-1.el6.noarch (but also able to reproduce in mock-1.2.7-1.el7.noarch)

How reproducible:
On a system where the home is an nfs (however, if the root cache is being re-built, e.g. it detected the mock config has changed, then that mock run succeeds).

Steps to Reproduce:
1. Copy srpm to an 'nfs' mount directory (i.e. one that causes mockbuild.util.get_fs_type to return 'nfs')
2. Run
 mock <options> my.srpm

Actual results:
ERROR: [Errno 2] No such file or directory:


Expected results:
To find and build the srpm


Additional info:
Workaround is to run
 mock <options> <fullpath>/my.srpm

Comment 1 Miroslav Suchý 2015-11-24 23:28:35 UTC
Commited as 
* fef4c05 (origin/devel, devel) after unpacking chroot, change back to $CWD [RHBZ#1281369]

Comment 2 Fedora Update System 2015-11-24 23:32:03 UTC
mock-1.2.14-1.el7 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2015-a295f19cae

Comment 3 Fedora Update System 2015-11-24 23:32:06 UTC
mock-1.2.14-1.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2015-6d1cc55330

Comment 4 Fedora Update System 2015-11-24 23:32:37 UTC
mock-1.2.14-1.fc21 has been submitted as an update to Fedora 21. https://bodhi.fedoraproject.org/updates/FEDORA-2015-b4d491366d

Comment 5 Fedora Update System 2015-11-24 23:32:39 UTC
mock-1.2.14-1.el6 has been submitted as an update to Fedora EPEL 6. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2015-fd9c932e3a

Comment 6 Fedora Update System 2015-11-24 23:33:10 UTC
mock-1.2.14-1.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2015-3ef940024e

Comment 7 Fedora Update System 2015-11-26 00:51:28 UTC
mock-1.2.14-1.el6 has been pushed to the Fedora EPEL 6 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
$ su -c 'yum --enablerepo=epel-testing update mock'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2015-fd9c932e3a

Comment 8 Fedora Update System 2015-11-26 00:53:29 UTC
mock-1.2.14-1.el7 has been pushed to the Fedora EPEL 7 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
$ su -c 'yum --enablerepo=epel-testing update mock'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2015-a295f19cae

Comment 9 Fedora Update System 2015-11-26 01:22:14 UTC
mock-1.2.14-1.fc21 has been pushed to the Fedora 21 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
$ su -c 'dnf --enablerepo=updates-testing update mock'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-b4d491366d

Comment 10 Fedora Update System 2015-11-26 02:25:48 UTC
mock-1.2.14-1.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
$ su -c 'dnf --enablerepo=updates-testing update mock'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-3ef940024e

Comment 11 Fedora Update System 2015-11-26 02:54:46 UTC
mock-1.2.14-1.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
$ su -c 'dnf --enablerepo=updates-testing update mock'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-6d1cc55330

Comment 12 Fedora Update System 2015-11-27 18:20:50 UTC
mock-1.2.14-1.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.

Comment 13 Fedora Update System 2016-01-03 20:26:39 UTC
mock-1.2.14-1.el6 has been pushed to the Fedora EPEL 6 stable repository. If problems still persist, please make note of it in this bug report.

Comment 14 Fedora Update System 2016-01-03 21:20:26 UTC
mock-1.2.14-1.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.

Comment 15 Fedora Update System 2016-01-03 23:26:23 UTC
mock-1.2.14-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.