Bug 741722

Summary: better chroot support
Product: [Fedora] Fedora Reporter: Daniel Mach <dmach>
Component: loraxAssignee: Martin Gracik <mgracik>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 16CC: bcl, dmach, mgracik
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: lorax-16.4.6-1.fc16 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-10-13 04:33:00 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Daniel Mach 2011-09-27 18:24:18 UTC
I ran lorax (as part of pungi) in mock chroot.

It failed with:
Traceback (most recent call last):
  File "/usr/bin/pungi", line 222, in <module>
    main()
  File "/usr/bin/pungi", line 124, in main
    mypungi.doBuildinstall()
  File "/usr/lib/python2.7/site-packages/pypungi/__init__.py", line 845, in doBuildinstall
    workdir=workdir, outputdir=outputdir)
  File "/usr/lib/python2.7/site-packages/pylorax/__init__.py", line 438, in run
    self.installtree.yum.remove(package, pattern_list)
  File "/usr/lib/python2.7/site-packages/pylorax/yumhelper.py", line 120, in remove
    shutil.rmtree(fname)
  File "/usr/lib64/python2.7/shutil.py", line 244, in rmtree
    rmtree(fullname, ignore_errors, onerror)
  File "/usr/lib64/python2.7/shutil.py", line 253, in rmtree
    onerror(os.rmdir, path, sys.exc_info())
  File "/usr/lib64/python2.7/shutil.py", line 251, in rmtree
    os.rmdir(path)
OSError: [Errno 39] Directory not empty: '.../work/x86_64/yumroot//var/lib/yum/history'

This is probably due to using a NFS storage.


Lorax also needs /proc mounted (since /etc/mtab is a symlink to /proc/mounts).

Touching /proc/mounts is not enough, because /proc is also needed when creating images (efiboot, I think):
/proc/devices: fopen failed: No such file or directory
Failure to communicate with kernel device-mapper driver.
Check that device-mapper is available in the kernel.
Command failed
unable to create efidisk image

if /proc is not mounted, it ends with various crashes and lorax should check whether /proc is mounted as soon as possible.



Proposed fixes:
1)
 $ vim /usr/lib/python2.7/site-packages/pylorax/yumhelper.py +120
 add: ignore_errors=True to rmtree()
 (that's what mgracik proposed, seems to be working)

2) check if /proc is mounted when starting lorax

Comment 1 Fedora Update System 2011-10-03 14:03:42 UTC
lorax-16.4.5-1.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/lorax-16.4.5-1.fc16

Comment 2 Fedora Update System 2011-10-03 17:44:20 UTC
Package lorax-16.4.5-1.fc16:
* should fix your issue,
* was pushed to the Fedora 16 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing lorax-16.4.5-1.fc16'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/lorax-16.4.5-1.fc16
then log in and leave karma (feedback).

Comment 3 Fedora Update System 2011-10-11 17:54:10 UTC
lorax-16.4.6-1.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/lorax-16.4.6-1.fc16

Comment 4 Fedora Update System 2011-10-13 04:33:00 UTC
lorax-16.4.6-1.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.