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.
Bug 1826760 - Anaconda dies when installing using "liveimg" and a mount point is specified with "noauto"
Summary: Anaconda dies when installing using "liveimg" and a mount point is specified ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: anaconda
Version: 8.1
Hardware: All
OS: Linux
low
high
Target Milestone: rc
: 8.0
Assignee: Vendula Poncova
QA Contact: Release Test Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-04-22 13:54 UTC by Renaud Métrich
Modified: 2022-11-08 09:36 UTC (History)
8 users (show)

Fixed In Version: anaconda-33.16.7.4-1.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-11-08 09:17:10 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RTT-4493 0 None None None 2022-05-13 16:44:03 UTC
Red Hat Issue Tracker RTT-4494 0 None None None 2022-05-13 16:44:08 UTC
Red Hat Issue Tracker RTT-4495 0 None None None 2022-05-13 16:44:11 UTC
Red Hat Product Errata RHBA-2022:7462 0 None None None 2022-11-08 09:17:39 UTC

Description Renaud Métrich 2020-04-22 13:54:13 UTC
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.

Comment 18 Jan Stodola 2022-06-08 13:09:35 UTC
Checked that anaconda-33.16.7.4-1.el8 is in nightly compose RHEL-8.7.0-20220608.0

Moving to VERIFIED

Comment 22 errata-xmlrpc 2022-11-08 09:17:10 UTC
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


Note You need to log in before you can comment on or make changes to this bug.