Bug 1447658

Summary: [lvm] The buildroot volume is not kept mounted after build
Product: [Fedora] Fedora Reporter: Vít Ondruch <vondruch>
Component: mockAssignee: Miroslav Suchý <msuchy>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: jdisnard, mebrown, msimacek, msuchy, praiskup, williams
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: mock-1.4.2-1.fc26 mock-1.4.2-1.fc25 mock-1.4.2-1.el7 mock-1.4.6-1.fc26 mock-1.4.6-1.fc25 mock-1.4.6-1.fc27 mock-1.4.6-1.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-09-19 03:25:31 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:

Description Vít Ondruch 2017-05-03 12:14:47 UTC
Description of problem:
The buildroot volume is unmounted mounted after build. This is very annoying bug.


Version-Release number of selected component (if applicable):
$ rpm -q mock
mock-1.4.1-1.fc27.noarch


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:
Buildroot volume is unmounted


Expected results:
Buildroot volume is mounted


Additional info:

Comment 1 Miroslav Suchý 2017-05-12 11:17:11 UTC
Notes for myself:

It should be umounted. However when you specify:
config_opts['plugin_conf']['lvm_root_opts']['umount_root'] = False
It should be mounted.

Which is if you do not use bootstrap. However with bootstrap is is at final stage called:
  bootstrap_buildroot.finalize()
which will unmount it.

Comment 2 Vít Ondruch 2017-05-12 12:08:04 UTC
(In reply to Miroslav Suchý from comment #1)
> It should be umounted. However when you specify:
> config_opts['plugin_conf']['lvm_root_opts']['umount_root'] = False
> It should be mounted.

I never specified such option and the volumes were always kept mounted, that is why I noticed and reported this.

Comment 3 Miroslav Suchý 2017-06-05 14:11:55 UTC
Addressed by several commits:
* 06f9fd7 (HEAD -> devel, origin/devel) umount all internal mounts before umounting lvm
* 3bd37d6 umountall try to umount several times in case there are deps between mounts
* 32a234b unify behaviour of umount()
* 934655b do not umount LVM volumes if umount_root is set to true [RHBZ#1447658]

Now the volume is kept mounted. However when you leave the default ie.
  config_opts['plugin_conf']['lvm_root_opts']['umount_root'] = True
Then sometimes it is not umounted. Only sometimes.
And consequent `mock --umount` will fix it. It seems there is some race condition.

Comment 4 Fedora Update System 2017-06-19 07:12:56 UTC
mock-1.4.2-1.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-21b345dd60

Comment 5 Fedora Update System 2017-06-19 07:13:57 UTC
mock-1.4.2-1.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-3d88d9f8b5

Comment 6 Fedora Update System 2017-06-19 07:14:51 UTC
mock-1.4.2-1.el7 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2017-65be829503

Comment 7 Vít Ondruch 2017-06-19 14:49:03 UTC
This does not work :/

~~~
... snip ...

DEBUG:     plugin_conf:  {'ccache_enable': False, 'ccache_opts': {'max_cache_size': '4G', 'compress': None, 'dir': '%(cache_topdir)s/%(root)s/ccache/u%(chrootuid)s/', 'basedir': '/var/lib/mock/fedora-rawhide-x86_64', 'cache_topdir': '/var/cache/mock', 'cachedir': '/var/cache/mock/fedora-rawhide-x86_64', 'root': 'fedora-rawhide-x86_64', 'resultdir': '/var/lib/mock/fedora-rawhide-x86_64/result'}, 'yum_cache_enable': True, 'yum_cache_opts': {'max_age_days': 30, 'max_metadata_age_days': 30, 'dir': '%(cache_topdir)s/fedora-rawhide-x86_64/%(package_manager)s_cache/', 'target_dir': '/var/cache/%(package_manager)s/', 'online': True, 'basedir': '/var/lib/mock/fedora-rawhide-x86_64', 'cache_topdir': '/var/cache/mock', 'cachedir': '/var/cache/mock/fedora-rawhide-x86_64', 'root': 'fedora-rawhide-x86_64', 'resultdir': '/var/lib/mock/fedora-rawhide-x86_64/result', 'package_manager': 'dnf'}, 'root_cache_enable': False, 'root_cache_opts': {'age_check': True, 'max_age_days': 15, 'dir': '%(cache_topdir)s/%(root)s/root_cache/', 'compress_program': 'pigz', 'exclude_dirs': ['./proc', './sys', './dev', './tmp/ccache', './var/cache/yum', './var/cache/dnf'], 'extension': '.gz', 'basedir': '/var/lib/mock/fedora-rawhide-x86_64', 'cache_topdir': '/var/cache/mock', 'cachedir': '/var/cache/mock/fedora-rawhide-x86_64', 'root': 'fedora-rawhide-x86_64', 'resultdir': '/var/lib/mock/fedora-rawhide-x86_64/result'}, 'bind_mount_enable': True, 'bind_mount_opts': {'dirs': [], 'create_dirs': False, 'basedir': '/var/lib/mock/fedora-rawhide-x86_64', 'cache_topdir': '/var/cache/mock', 'cachedir': '/var/cache/mock/fedora-rawhide-x86_64', 'root': 'fedora-rawhide-x86_64', 'resultdir': '/var/lib/mock/fedora-rawhide-x86_64/result'}, 'mount_enable': False, 'mount_opts': {'basedir': '/var/lib/mock/fedora-rawhide-x86_64', 'cache_topdir': '/var/cache/mock', 'cachedir': '/var/cache/mock/fedora-rawhide-x86_64', 'root': 'fedora-rawhide-x86_64', 'resultdir': '/var/lib/mock/fedora-rawhide-x86_64/result'}, 'tmpfs_enable': False, 'tmpfs_opts': {'required_ram_mb': 900, 'max_fs_size': None, 'mode': '0755', 'keep_mounted': False, 'basedir': '/var/lib/mock/fedora-rawhide-x86_64', 'cache_topdir': '/var/cache/mock', 'cachedir': '/var/cache/mock/fedora-rawhide-x86_64', 'root': 'fedora-rawhide-x86_64', 'resultdir': '/var/lib/mock/fedora-rawhide-x86_64/result'}, 'selinux_enable': True, 'selinux_opts': {'basedir': '/var/lib/mock/fedora-rawhide-x86_64', 'cache_topdir': '/var/cache/mock', 'cachedir': '/var/cache/mock/fedora-rawhide-x86_64', 'root': 'fedora-rawhide-x86_64', 'resultdir': '/var/lib/mock/fedora-rawhide-x86_64/result'}, 'package_state_enable': True, 'package_state_opts': {'available_pkgs': False, 'installed_pkgs': True, 'basedir': '/var/lib/mock/fedora-rawhide-x86_64', 'cache_topdir': '/var/cache/mock', 'cachedir': '/var/cache/mock/fedora-rawhide-x86_64', 'root': 'fedora-rawhide-x86_64', 'resultdir': '/var/lib/mock/fedora-rawhide-x86_64/result'}, 'pm_request_enable': False, 'pm_request_opts': {'basedir': '/var/lib/mock/fedora-rawhide-x86_64', 'cache_topdir': '/var/cache/mock', 'cachedir': '/var/cache/mock/fedora-rawhide-x86_64', 'root': 'fedora-rawhide-x86_64', 'resultdir': '/var/lib/mock/fedora-rawhide-x86_64/result'}, 'lvm_root_enable': True, 'lvm_root_opts': {'volume_group': 'vg_fedora', 'size': '20G', 'pool_name': 'mock', 'umount_root': False, 'basedir': '/var/lib/mock/fedora-rawhide-x86_64', 'cache_topdir': '/var/cache/mock', 'cachedir': '/var/cache/mock/fedora-rawhide-x86_64', 'root': 'fedora-rawhide-x86_64', 'resultdir': '/var/lib/mock/fedora-rawhide-x86_64/result'}, 'chroot_scan_enable': False, 'chroot_scan_opts': {'regexes': ['^[^k]?core(\\.\\d+)?$', '\\.log$'], 'only_failed': True, 'basedir': '/var/lib/mock/fedora-rawhide-x86_64', 'cache_topdir': '/var/cache/mock', 'cachedir': '/var/cache/mock/fedora-rawhide-x86_64', 'root': 'fedora-rawhide-x86_64', 'resultdir': '/var/lib/mock/fedora-rawhide-x86_64/result'}, 'sign_enable': False, 'sign_opts': {'cmd': 'rpmsign', 'opts': '--addsign %(rpms)s', 'basedir': '/var/lib/mock/fedora-rawhide-x86_64', 'cache_topdir': '/var/cache/mock', 'cachedir': '/var/cache/mock/fedora-rawhide-x86_64', 'root': 'fedora-rawhide-x86_64', 'resultdir': '/var/lib/mock/fedora-rawhide-x86_64/result'}, 'hw_info_enable': True, 'hw_info_opts': {'basedir': '/var/lib/mock/fedora-rawhide-x86_64', 'cache_topdir': '/var/cache/mock', 'cachedir': '/var/cache/mock/fedora-rawhide-x86_64', 'root': 'fedora-rawhide-x86_64', 'resultdir': '/var/lib/mock/fedora-rawhide-x86_64/result'}}


... snip ...

+ bundle exec rspec2 spec
/var/tmp/rpm-tmp.J9rkrX: line 52: bundle: command not found


chyby sestavení RPM:
chyba: Špatný návratový kód z /var/tmp/rpm-tmp.J9rkrX (%check)
    Špatný návratový kód z /var/tmp/rpm-tmp.J9rkrX (%check)
DEBUG: Child return code was: 1
INFO: EXCEPTION: [Error()]
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/mockbuild/trace_decorator.py", line 96, in trace
    result = func(*args, **kw)
  File "/usr/lib/python3.6/site-packages/mockbuild/util.py", line 590, in do
    raise exception.Error("Command failed: \n # %s\n%s" % (command, output), child.returncode)
mockbuild.exception.Error: Command failed: 
 # /usr/bin/systemd-nspawn -q -M 99a4acb97dd44017bb1d39702388d1c1 -D /var/lib/mock/fedora-rawhide-x86_64/root -a --setenv=TERM=vt100 --setenv=SHELL=/bin/bash --setenv=HOME=/builddir --setenv=HOSTNAME=mock --setenv=PATH=/usr/bin:/bin:/usr/sbin:/sbin --setenv=PROMPT_COMMAND=printf "\033]0;<mock-chroot>\007" --setenv=PS1=<mock-chroot> \s-\v\$  --setenv=LANG=cs_CZ.utf8 -u mockbuild bash --login -c /usr/bin/rpmbuild -bb --target x86_64 --nodeps /builddir/build/SPECS/vagrant-libvirt.spec

ERROR: Exception(vagrant-libvirt-0.0.40-1.fc27.src.rpm) Config(fedora-rawhide-x86_64) 0 minutes 8 seconds
INFO: Results and/or logs in: /var/lib/mock/fedora-rawhide-x86_64/result
DEBUG: kill orphans
DEBUG: child environment: None
DEBUG: Executing command: ['/bin/umount', '-n', '/var/lib/mock/fedora-rawhide-x86_64/root/var/cache/dnf/'] with env {'TERM': 'vt100', 'SHELL': '/bin/sh', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'LANG': 'cs_CZ.utf8'} and shell False
DEBUG: Child return code was: 0
DEBUG: kill orphans
DEBUG: child environment: None
DEBUG: Executing command: ['/bin/umount', '-n', '/var/lib/mock/fedora-rawhide-x86_64-bootstrap/root/var/lib/mock/fedora-rawhide-x86_64/root'] with env {'TERM': 'vt100', 'SHELL': '/bin/sh', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'LANG': 'cs_CZ.utf8'} and shell False
DEBUG: Child return code was: 0
DEBUG: child environment: None
DEBUG: Executing command: ['/bin/umount', '-n', '/var/lib/mock/fedora-rawhide-x86_64-bootstrap/root/var/cache/dnf/'] with env {'TERM': 'vt100', 'SHELL': '/bin/sh', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'LANG': 'cs_CZ.utf8'} and shell False
DEBUG: Child return code was: 0
ERROR: Command failed: 
 # /usr/bin/systemd-nspawn -q -M 99a4acb97dd44017bb1d39702388d1c1 -D /var/lib/mock/fedora-rawhide-x86_64/root -a --setenv=TERM=vt100 --setenv=SHELL=/bin/bash --setenv=HOME=/builddir --setenv=HOSTNAME=mock --setenv=PATH=/usr/bin:/bin:/usr/sbin:/sbin --setenv=PROMPT_COMMAND=printf "\033]0;<mock-chroot>\007" --setenv=PS1=<mock-chroot> \s-\v\$  --setenv=LANG=cs_CZ.utf8 -u mockbuild bash --login -c /usr/bin/rpmbuild -bb --target x86_64 --nodeps /builddir/build/SPECS/vagrant-libvirt.spec
~~~




$ rpm -q mock
mock-1.4.2-1.fc27.noarch

Comment 8 Fedora Update System 2017-06-19 14:53:03 UTC
mock-1.4.2-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.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2017-65be829503

Comment 9 Fedora Update System 2017-06-19 15:52:35 UTC
mock-1.4.2-1.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-21b345dd60

Comment 10 Fedora Update System 2017-06-19 19:24:47 UTC
mock-1.4.2-1.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-3d88d9f8b5

Comment 11 Fedora Update System 2017-06-25 16:19:56 UTC
mock-1.4.2-1.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.

Comment 12 Vít Ondruch 2017-06-26 10:33:23 UTC
Ok, lets fight with Bodhi ...

Comment 13 Fedora Update System 2017-07-04 01:51:54 UTC
mock-1.4.2-1.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.

Comment 14 Fedora Update System 2017-07-06 05:19:29 UTC
mock-1.4.2-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.

Comment 15 Miroslav Suchý 2017-09-15 19:55:15 UTC
Should be fixed by commits:
* bf1d725 [site-defaults] Fix umount_root documentation
* 54c2423 Fix keeping the LVM volume mounted
* 9190184 Revert "do not umount LVM volumes if umount_root is set to true [RHBZ#1447658]"

Comment 16 Fedora Update System 2017-09-15 19:59:25 UTC
mock-core-configs-27.2-1.fc26 mock-1.4.5-1.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-dd7e57c3f2

Comment 17 Fedora Update System 2017-09-15 19:59:38 UTC
mock-core-configs-27.2-1.fc25 mock-1.4.5-1.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-95ad2160e1

Comment 18 Fedora Update System 2017-09-15 19:59:51 UTC
mock-core-configs-27.2-1.el7 mock-1.4.5-1.el7 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2017-f26dc7ded1

Comment 19 Fedora Update System 2017-09-15 20:00:04 UTC
mock-core-configs-27.2-1.fc27 mock-1.4.5-1.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2017-3f7acc4d15

Comment 20 Fedora Update System 2017-09-16 18:22:40 UTC
mock-1.4.6-1.fc27, mock-core-configs-27.2-1.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-3f7acc4d15

Comment 21 Fedora Update System 2017-09-17 10:48:50 UTC
mock-1.4.6-1.fc25, mock-core-configs-27.2-1.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-95ad2160e1

Comment 22 Fedora Update System 2017-09-17 10:50:57 UTC
mock-1.4.6-1.fc26, mock-core-configs-27.2-1.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-dd7e57c3f2

Comment 23 Fedora Update System 2017-09-17 12:47:04 UTC
mock-1.4.6-1.el7, mock-core-configs-27.2-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.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2017-f26dc7ded1

Comment 24 Fedora Update System 2017-09-19 03:25:31 UTC
mock-1.4.6-1.fc26, mock-core-configs-27.2-1.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.

Comment 25 Fedora Update System 2017-09-27 05:27:37 UTC
mock-1.4.6-1.fc25, mock-core-configs-27.2-1.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.

Comment 26 Fedora Update System 2017-09-30 06:36:55 UTC
mock-1.4.6-1.fc27, mock-core-configs-27.2-1.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.

Comment 27 Fedora Update System 2017-10-02 02:18:52 UTC
mock-1.4.6-1.el7, mock-core-configs-27.2-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.