Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Description of problem:
When installing a system using "liveimg" directive and formatting a file system with "noauto" option (here for "/storage" mount point), Anaconda dies with the following backtrace:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
===============================================================================
An unknown error has occurred
===============================================================================
anaconda 29.19.1.13 exception report
Traceback (most recent call first):
File "/usr/lib64/python3.6/site-packages/pyanaconda/payload/livepayload.py", line 115, in progress
mnt_stat = os.statvfs(util.getSysroot() + mnt)
File "/usr/lib64/python3.6/threading.py", line 864, in run
self._target(*self._args, **self._kwargs)
File "/usr/lib64/python3.6/site-packages/pyanaconda/threading.py", line 286, in run
threading.Thread.run(self)
FileNotFoundError: [Errno 2] No such file or directory: '/mnt/sysimage/storage'
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
This is due to the a statfs("/storage") being performed which doesn't exist since "/storage" is not mounted, just created.
Version-Release number of selected component (if applicable):
RHEL 8.1 and RHEL 7.x
How reproducible:
Always
Steps to Reproduce:
1. Boot a kickstart using "liveimg" and not mounting a filesystem
liveimg --url=http://192.168.122.1/7.8/LiveOS/squashfs.img
bootloader --location=mbr
clearpart --all --initlabel
part /boot --fstype="xfs" --size=1024
part pv.342 --fstype="lvmpv" --size=18000
volgroup rhel --pesize=4096 pv.342
logvol swap --fstype="swap" --size=1024 --name=swap --vgname=rhel
logvol / --fstype="xfs" --size=16240 --name=root --vgname=rhel
logvol /storage --fstype="xfs" --grow --size=1 --fsoptions="noauto" --name=storage --vgname=rhel
Actual results:
Exception and program stops.
Expected results:
No exception and program continues.
Additional info:
The broken piece of code is shown below:
pyanaconda/packaging/livepayload.py (RHEL 7.7 code, but similar logic on RHEL 8.1):
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
100 def progress(self):
101 """Monitor the amount of disk space used on the target and source and
102 update the hub's progress bar.
103 """
104 mountpoints = self.storage.mountpoints.copy()
105 last_pct = -1
106 while self.pct < 100:
107 dest_size = 0
108 for mnt in mountpoints:
109 mnt_stat = iutil.eintr_retry_call(os.statvfs, iutil.getSysroot()+mnt)
110 dest_size += mnt_stat.f_frsize * (mnt_stat.f_blocks - mnt_stat.f_bfree)
111 if dest_size >= self._adj_size:
112 dest_size -= self._adj_size
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
On line 109, a statvfs() is made even though "mnt" can refer to a non-mounted mount point:
On line 104, "mountpoints" contains *all* the mount points, including non-mounted ones.
Suggested (lazy) fix is to catch the exception and ignore:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
@@ -106,7 +106,10 @@
while self.pct < 100:
dest_size = 0
for mnt in mountpoints:
- mnt_stat = iutil.eintr_retry_call(os.statvfs, iutil.getSysroot()+mnt)
+ try:
+ mnt_stat = iutil.eintr_retry_call(os.statvfs, iutil.getSysroot()+mnt)
+ except OSError:
+ continue
dest_size += mnt_stat.f_frsize * (mnt_stat.f_blocks - mnt_stat.f_bfree)
if dest_size >= self._adj_size:
dest_size -= self._adj_size
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
Probably filtering on "mountpoints" should be performed instead to removed unmounted devices.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory (anaconda bug fix and enhancement update), and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHBA-2022:7462
Description of problem: When installing a system using "liveimg" directive and formatting a file system with "noauto" option (here for "/storage" mount point), Anaconda dies with the following backtrace: -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< -------- =============================================================================== An unknown error has occurred =============================================================================== anaconda 29.19.1.13 exception report Traceback (most recent call first): File "/usr/lib64/python3.6/site-packages/pyanaconda/payload/livepayload.py", line 115, in progress mnt_stat = os.statvfs(util.getSysroot() + mnt) File "/usr/lib64/python3.6/threading.py", line 864, in run self._target(*self._args, **self._kwargs) File "/usr/lib64/python3.6/site-packages/pyanaconda/threading.py", line 286, in run threading.Thread.run(self) FileNotFoundError: [Errno 2] No such file or directory: '/mnt/sysimage/storage' -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< -------- This is due to the a statfs("/storage") being performed which doesn't exist since "/storage" is not mounted, just created. Version-Release number of selected component (if applicable): RHEL 8.1 and RHEL 7.x How reproducible: Always Steps to Reproduce: 1. Boot a kickstart using "liveimg" and not mounting a filesystem liveimg --url=http://192.168.122.1/7.8/LiveOS/squashfs.img bootloader --location=mbr clearpart --all --initlabel part /boot --fstype="xfs" --size=1024 part pv.342 --fstype="lvmpv" --size=18000 volgroup rhel --pesize=4096 pv.342 logvol swap --fstype="swap" --size=1024 --name=swap --vgname=rhel logvol / --fstype="xfs" --size=16240 --name=root --vgname=rhel logvol /storage --fstype="xfs" --grow --size=1 --fsoptions="noauto" --name=storage --vgname=rhel Actual results: Exception and program stops. Expected results: No exception and program continues. Additional info: The broken piece of code is shown below: pyanaconda/packaging/livepayload.py (RHEL 7.7 code, but similar logic on RHEL 8.1): -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< -------- 100 def progress(self): 101 """Monitor the amount of disk space used on the target and source and 102 update the hub's progress bar. 103 """ 104 mountpoints = self.storage.mountpoints.copy() 105 last_pct = -1 106 while self.pct < 100: 107 dest_size = 0 108 for mnt in mountpoints: 109 mnt_stat = iutil.eintr_retry_call(os.statvfs, iutil.getSysroot()+mnt) 110 dest_size += mnt_stat.f_frsize * (mnt_stat.f_blocks - mnt_stat.f_bfree) 111 if dest_size >= self._adj_size: 112 dest_size -= self._adj_size -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< -------- On line 109, a statvfs() is made even though "mnt" can refer to a non-mounted mount point: On line 104, "mountpoints" contains *all* the mount points, including non-mounted ones. Suggested (lazy) fix is to catch the exception and ignore: -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< -------- @@ -106,7 +106,10 @@ while self.pct < 100: dest_size = 0 for mnt in mountpoints: - mnt_stat = iutil.eintr_retry_call(os.statvfs, iutil.getSysroot()+mnt) + try: + mnt_stat = iutil.eintr_retry_call(os.statvfs, iutil.getSysroot()+mnt) + except OSError: + continue dest_size += mnt_stat.f_frsize * (mnt_stat.f_blocks - mnt_stat.f_bfree) if dest_size >= self._adj_size: dest_size -= self._adj_size -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< -------- Probably filtering on "mountpoints" should be performed instead to removed unmounted devices.