Bug 1193487

Summary: root_cache plug-in overwrites root data if the tmpfs plug-in is enabled
Product: [Fedora] Fedora Reporter: Kamil Dudka <kdudka>
Component: mockAssignee: Miroslav Suchý <msuchy>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 21CC: jdisnard, mebrown, msimacek, msuchy, opensource, praiskup, williams
Target Milestone: ---Keywords: Patch
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: mock-1.2.10-1.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1190100 Environment:
Last Closed: 2015-05-01 16:50:41 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:
Bug Depends On:    
Bug Blocks: 1190100    
Attachments:
Description Flags
[PATCH] root_cache: do not assume volatile root with tmpfs kdudka: review?

Description Kamil Dudka 2015-02-17 13:01:43 UTC
+++ This bug was initially created as a clone of Bug #1190100 +++

Description of problem:
It looks like csmock tries to re-use chroots, which does not work with the tmpfs plugin enabled, see the attachment. With the tmpfs plugin disabled, it works better but is obviously slower.

Version-Release number of selected component (if applicable):
csmock-1.6.1-1.fc21

The setting to enable/disable tmpfs is:
config_opts['plugin_conf']['tmpfs_enable'] = True

in /etc/mock/site-defaults.cfg

--- Additional comment from Kamil Dudka on 2015-02-09 18:04:31 CET ---

Thank you for reporting the bug!

I am afraid this is by design.  The tmpfs plug-in as it is implemented makes sense mainly for "mock --rebuild".  However, csmock excessively uses "mock --chroot" to run commands inside the chroot.  I would expect the keep_mounted option of the tmpfs plug-in (bug #476837) to make it work, but does not:

$ echo "config_opts['plugin_conf']['tmpfs_opts']['keep_mounted'] = True" \
    | sudo tee -a /etc/mock/fedora-rawhide-x86_64.cfg
config_opts['plugin_conf']['tmpfs_opts']['keep_mounted'] = True

$ mock -r fedora-rawhide-x86_64 --install python 2>/dev/null && mount | grep /var/lib/mock
mock_chroot_tmpfs on /var/lib/mock/fedora-rawhide-x86_64/root type tmpfs (rw,relatime,seclabel,mode=755)

$ mock -r fedora-rawhide-x86_64 --chroot 'rpm -q python' 2>/dev/null
package python is not installed

A possible workaround would be to make csmock explicitly disable the tmpfs plug-in of mock as it did for the selinux plug-in when it was broken (bug #1002142).

Comment 1 Kamil Dudka 2015-02-17 13:02:38 UTC
Created attachment 992657 [details]
[PATCH] root_cache: do not assume volatile root with tmpfs

... if the tmpfs plug-in is configured with keep_mounted = True

Comment 2 Miroslav Suchý 2015-04-22 12:06:09 UTC
Commited (with one correction) as:
* 5dac828  plugin options can be string if specified on command line [RHBZ#1193487]
* cfd014f root_cache: do not assume volatile root with tmpfs [RHBZ#1193487]

Thanks for contribution.

Comment 3 Fedora Update System 2015-04-29 13:16:29 UTC
mock-1.2.8-1.fc22 has been submitted as an update for Fedora 22.
https://admin.fedoraproject.org/updates/mock-1.2.8-1.fc22

Comment 4 Fedora Update System 2015-04-29 13:16:54 UTC
mock-1.2.8-1.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/mock-1.2.8-1.fc21

Comment 5 Fedora Update System 2015-04-29 13:17:46 UTC
mock-1.2.8-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/mock-1.2.8-1.fc20

Comment 6 Fedora Update System 2015-04-29 13:18:56 UTC
mock-1.2.8-1.el7 has been submitted as an update for Fedora EPEL 7.
https://admin.fedoraproject.org/updates/mock-1.2.8-1.el7

Comment 7 Fedora Update System 2015-04-29 13:25:46 UTC
mock-1.2.8-1.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/mock-1.2.8-1.el6

Comment 8 Fedora Update System 2015-04-29 19:18:38 UTC
Package mock-1.2.8-1.el7:
* should fix your issue,
* was pushed to the Fedora EPEL 7 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=epel-testing mock-1.2.8-1.el7'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-EPEL-2015-6057/mock-1.2.8-1.el7
then log in and leave karma (feedback).

Comment 9 Fedora Update System 2015-05-01 16:50:41 UTC
mock-1.2.8-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 10 Fedora Update System 2015-05-02 18:08:20 UTC
mock-1.2.8-1.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 11 Fedora Update System 2015-05-12 20:46:26 UTC
mock-1.2.8-1.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 12 Fedora Update System 2015-06-04 11:42:11 UTC
mock-1.2.10-1.el7 has been submitted as an update for Fedora EPEL 7.
https://admin.fedoraproject.org/updates/mock-1.2.10-1.el7

Comment 13 Fedora Update System 2015-06-04 11:42:55 UTC
mock-1.2.10-1.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/mock-1.2.10-1.el6

Comment 14 Fedora Update System 2015-06-20 21:10:35 UTC
mock-1.2.10-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 15 Fedora Update System 2015-06-20 21:13:30 UTC
mock-1.2.10-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.