Description of problem: Unable to use mock shell to examine if a build failed. Version-Release number of selected component (if applicable): 1.1.11-1.fc16 How reproducible: Always Steps to Reproduce: 1. Set mock to use tmpfs 2. Do a build, if a build has a failure try to go to shell 3. run mock shell, unable to obtain chroot Actual results: Fails to mount filesystems in chroot, fails to give shell Expected results: mock-chroot> prompt
Would you include your setup for configuring to use tmpfs?
Hi! I can confirm this problem on RHEL6. I use stock *.cfg files and the following lines in site configuration file to enable the tmpfs plugin: config_opts['plugin_conf']['tmpfs_enable'] = True config_opts['plugin_conf']['tmpfs_opts']['required_ram_mb'] = 5120 config_opts['plugin_conf']['tmpfs_opts']['max_fs_size'] = '4096m' I have 6 GB of RAM allocated to this machine. I don't know if it matters, but SELinux is set to 'enforcing'. It's interesting that I don't see /var/lib/mock/conf/root populated with files and devices during the build. It's really a mystery to me how come I don't see anything in there... but most surprisingly, the root.log seems to indicate that there exact directories are indeed used as the mount points for tmpfs: INFO backend.py:837: Mock Version: 1.1.15 DEBUG backend.py:274: rootdir = /var/lib/mock/epel-5-x86_64/root/ DEBUG backend.py:275: resultdir = /var/lib/mock/epel-5-x86_64/result DEBUG util.py:284: Executing command: ['mount', '-n', '-t', 'tmpfs', '-o', 'size=4096m', 'mock_chroot_tmpfs', '/var/lib/mock/epel- 5-x86_64/root/'] DEBUG util.py:323: Child returncode was: 0 DEBUG util.py:57: ensuring that dir exists: /var/cache/mock/epel-5-x86_64/root_cache/ DEBUG util.py:284: Executing command: ['tar', '--use-compress-program', 'pigz', '-xf', '/var/cache/mock/epel-5-x86_64/root_cache/c ache.tar.gz', '-C', '/var/lib/mock/epel-5-x86_64/root/'] DEBUG util.py:323: Child returncode was: 0 DEBUG util.py:57: ensuring that dir exists: /var/lib/mock/epel-5-x86_64/root/./proc DEBUG util.py:60: creating dir: /var/lib/mock/epel-5-x86_64/root/./proc I can provide any further information you might need to diagnose this issue.
This almost looks like the hooks aren't being called properly. If you look at the tmpfs plugin, you'll see that the mound command is setup as a 'preinit' hook, which should be call when the chroot object (in backend.py) does a self._callHooks('preinit') but I don't see any print saying 'mounting tmpfs'. I don't know if this is specific to tmpfs or there's something worse wrong in the hooks logic.
Ahh, I remember now. We don't create a Root object when we do a shell, due to the Root object not really being setup for interactive use. I'll have to look at this some more. Possibly we can create a Root object, do all the appropriate hooks, *then* kick off the interactive shell, then clean up the Root object after the shell exits.
I've modified the --shell and --chroot commands to do the same thing as a --rebuild. Haven't tested with tmpfs yet but I suspect it will work properly this time. These changes should appear in mock-1.1.16
mock-1.1.16-1.fc15 has been submitted as an update for Fedora 15. https://admin.fedoraproject.org/updates/mock-1.1.16-1.fc15
mock-1.0.23-1.el5 has been submitted as an update for Fedora EPEL 5. https://admin.fedoraproject.org/updates/mock-1.0.23-1.el5
mock-1.1.16-1.fc14 has been submitted as an update for Fedora 14. https://admin.fedoraproject.org/updates/mock-1.1.16-1.fc14
mock-1.1.16-1.el6 has been submitted as an update for Fedora EPEL 6. https://admin.fedoraproject.org/updates/mock-1.1.16-1.el6
Package mock-1.1.16-1.fc14: * should fix your issue, * was pushed to the Fedora 14 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing mock-1.1.16-1.fc14' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2011-14382 then log in and leave karma (feedback).
Hmmmm, unfortunately the update didn't seem to fix the issue for me. How about you, Shawn? [zaytsev@locke SRPMS]$ mock --shell -r epel-6-x86_64 INFO: mock.py version 1.1.16 starting... State Changed: init plugins INFO: tmpfs initialized INFO: selinux enabled State Changed: start State Changed: lock buildroot INFO: mounting tmpfs at /var/lib/mock/epel-6-x86_64/root/. State Changed: shell Traceback (most recent call last): File "/usr/sbin/mock", line 842, in <module> main(retParams) File "/usr/sbin/mock", line 730, in main sys.exit(chroot.shell()) File "/usr/lib/python2.6/site-packages/mockbuild/backend.py", line 646, in shell gid=self.chrootgid) File "/usr/lib/python2.6/site-packages/mockbuild/util.py", line 388, in doshell return subprocess.call(cmdstr, preexec_fn=preexec, env=environ, shell=True) File "/usr/lib64/python2.6/subprocess.py", line 478, in call p = Popen(*popenargs, **kwargs) File "/usr/lib64/python2.6/subprocess.py", line 639, in __init__ errread, errwrite) File "/usr/lib64/python2.6/subprocess.py", line 1220, in _execute_child raise child_exception OSError: [Errno 2] No such file or directory Also, the lock is left behind... What really amazes me is that the builds succeed, the directory /var/lib/mock/epel-6-x86_64/root/ exists, but when I am trying to ls it during the build I see *nothing* in there. Kind of black magic, huh... drwxrwsr-x. 2 root mock 4096 Oct 15 23:19 root
mock-1.1.16-1.fc14 has been pushed to the Fedora 14 stable repository. If problems still persist, please make note of it in this bug report.
Except that it doesn't solve the problem...
mock-1.1.16-1.fc15 has been pushed to the Fedora 15 stable repository. If problems still persist, please make note of it in this bug report.
mock-1.1.17-1.fc15 has been submitted as an update for Fedora 15. https://admin.fedoraproject.org/updates/mock-1.1.17-1.fc15
mock-1.1.17-1.fc16 has been submitted as an update for Fedora 16. https://admin.fedoraproject.org/updates/mock-1.1.17-1.fc16
mock-1.1.17-1.fc14 has been submitted as an update for Fedora 14. https://admin.fedoraproject.org/updates/mock-1.1.17-1.fc14
mock-1.0.24-1.el5 has been submitted as an update for Fedora EPEL 5. https://admin.fedoraproject.org/updates/mock-1.0.24-1.el5
mock-1.1.17-1.el6 has been submitted as an update for Fedora EPEL 6. https://admin.fedoraproject.org/updates/mock-1.1.17-1.el6
Still doesn't work for me: [zaytsev@locke SRPMS]$ mock --shell -r epel-6-x86_64 INFO: mock.py version 1.1.17 starting... State Changed: init plugins INFO: tmpfs initialized INFO: selinux enabled State Changed: start State Changed: lock buildroot INFO: mounting tmpfs at /var/lib/mock/epel-6-x86_64/root/. State Changed: shell Traceback (most recent call last): File "/usr/sbin/mock", line 849, in <module> main(retParams) File "/usr/sbin/mock", line 737, in main sys.exit(chroot.shell(options, cmd)) File "/usr/lib/python2.6/site-packages/mockbuild/backend.py", line 655, in shell cmd=cmd) File "/usr/lib/python2.6/site-packages/mockbuild/util.py", line 391, in doshell return subprocess.call(cmdstr, preexec_fn=preexec, env=environ, shell=True) File "/usr/lib64/python2.6/subprocess.py", line 478, in call p = Popen(*popenargs, **kwargs) File "/usr/lib64/python2.6/subprocess.py", line 639, in __init__ errread, errwrite) File "/usr/lib64/python2.6/subprocess.py", line 1220, in _execute_child raise child_exception OSError: [Errno 2] No such file or directory
In the mean time, building works fine: [zaytsev@locke SRPMS]$ mock mock-1.1.17-1.el6.src.rpm -r epel-6-x86_64 INFO: mock.py version 1.1.17 starting... State Changed: init plugins INFO: tmpfs initialized INFO: selinux enabled State Changed: start INFO: Start(mock-1.1.17-1.el6.src.rpm) Config(epel-6-x86_64) State Changed: lock buildroot State Changed: clean INFO: chroot (/var/lib/mock/epel-6-x86_64) unlocked and deleted State Changed: unlock buildroot State Changed: init State Changed: lock buildroot Mock Version: 1.1.17 INFO: Mock Version: 1.1.17 INFO: calling preinit hooks INFO: mounting tmpfs at /var/lib/mock/epel-6-x86_64/root/. INFO: enabled root cache State Changed: unpacking root cache State Changed: running yum State Changed: unlock buildroot State Changed: setup State Changed: build INFO: unmounting tmpfs. INFO: Done(mock-1.1.17-1.el6.src.rpm) Config(epel-6-x86_64) 0 minutes 16 seconds INFO: Results and/or logs in: /var/lib/mock/epel-6-x86_64/result State Changed: end
(In reply to comment #20) > Still doesn't work for me: > > Yeah, I'm still not sure how to fix this. I haven't forgotten though...
Package mock-1.0.24-1.el5: * should fix your issue, * was pushed to the Fedora EPEL 5 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=epel-testing mock-1.0.24-1.el5' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-EPEL-2011-4823 then log in and leave karma (feedback).
mock-1.1.17-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.1.17-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.
mock-1.0.24-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.
mock-1.1.17-1.fc14 has been pushed to the Fedora 14 stable repository. If problems still persist, please make note of it in this bug report.
mock-1.1.17-1.fc15 has been pushed to the Fedora 15 stable repository. If problems still persist, please make note of it in this bug report.
mock-1.1.18: still the same...
mock-1.1.21: $ mock --shell -r epel-6-i386 INFO: mock.py version 1.1.21 starting... State Changed: init plugins INFO: tmpfs initialized INFO: selinux enabled State Changed: start State Changed: lock buildroot INFO: mounting tmpfs at /var/lib/mock/epel-6-i386/root/. State Changed: shell Traceback (most recent call last): File "/usr/sbin/mock", line 881, in <module> main(retParams) File "/usr/sbin/mock", line 759, in main sys.exit(chroot.shell(options, cmd)) File "/usr/lib/python2.6/site-packages/mockbuild/backend.py", line 682, in shell cmd=cmd) File "/usr/lib/python2.6/site-packages/mockbuild/util.py", line 402, in doshell return subprocess.call(cmdstr, preexec_fn=preexec, env=environ, shell=True) File "/usr/lib64/python2.6/subprocess.py", line 478, in call p = Popen(*popenargs, **kwargs) File "/usr/lib64/python2.6/subprocess.py", line 639, in __init__ errread, errwrite) File "/usr/lib64/python2.6/subprocess.py", line 1228, in _execute_child raise child_exception OSError: [Errno 2] No such file or directory
Honestly, I'm not sure how to fix this (or if we really want to). The problem is that we mount/umount the tmpfs on mock startup/shutdown, because tmpfs is supposed to be *temporary*. I don't want to try and hack in some logic to mount the tmpfs and then leave it mounted when mock exits. Possibly we could come up with a way to use an existing tmpfs that was mounted before mock starts up and leave it alone on exit. Does your failure only occur when using tmpfs?
I looked at this again today and honestly, I don't see a good way to keep a tmpfs build around after a build. Closing as not a bug.