Bug 1827911

Summary: livemedia-creator (that calls anaconda) is broken in mock
Product: Red Hat Enterprise Linux 8 Reporter: Igor Raits <igor.raits>
Component: loraxAssignee: Brian Lane <bcl>
Status: CLOSED ERRATA QA Contact: Release Test Team <release-test-team-automation>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.1CC: bcl, jkonecny, jstodola, pzatko
Target Milestone: rc   
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: lorax-28.14.45-1.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-11-04 02:46:06 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 Igor Raits 2020-04-25 12:51:42 UTC
Description of problem:
When running livemedia-creator (from lorax) in chroot environment (mock), anaconda fails with "ValueError: new value non-existent xfs filesystem is not valid as a default fs type anaconda".

Version-Release number of selected component (if applicable):
anaconda-core-29.19.1.13-1.el8.x86_64
python3-blivet-3.1.0-17.el8.noarch
lorax-28.14.30-1.el8.x86_64

How reproducible:


Steps to Reproduce:
0. Get some simple kickstart file which would install OS.
1. mock -r epel-8-x86_64 --init
2. mock -r epel-8-x86_64 --install lorax-lmc-novirt
3. mock -r epel-8-x86_64 --copyin ./test.ks /root/
4. mock -r epel-8-x86_64 --enable-network --chroot -- livemedia-creator --no-virt --make-disk --ks /root/test.ks

Actual results:
INFO: Running in chroot: ['livemedia-creator', '--no-virt', '--make-disk', '--ks', '/root/gdc-co8.ks']
Start: chroot ['livemedia-creator', '--no-virt', '--make-disk', '--ks', '/root/gdc-co8.ks']
2020-04-25 14:47:15,957: livemedia-creator v28.14.30-1
2020-04-25 14:47:15,957: selinux is Disabled
2020-04-25 14:47:16,053: disk_img = /var/tmp/lmc-disk-te6zkq_0.img
2020-04-25 14:47:16,053: Using disk size of 3002MiB
2020-04-25 14:47:16,055: Running anaconda.
2020-04-25 14:47:18,913: Starting installer, one moment...
2020-04-25 14:47:18,913: terminal size detection failed, using default width
2020-04-25 14:47:18,913: anaconda 29.19.1.13-1.el8 for Linux 8 (pre-release) started.
2020-04-25 14:47:18,913: 14:47:18 Not asking for VNC because of an automated install
2020-04-25 14:47:18,913: 14:47:18 Not asking for VNC because we don't have Xvnc
2020-04-25 14:47:18,984: Traceback (most recent call last):
2020-04-25 14:47:18,984: File "/usr/sbin/anaconda", line 640, in <module>
2020-04-25 14:47:18,984: display.setup_display(anaconda, opts, addon_paths=addon_paths)
2020-04-25 14:47:18,985: File "/usr/lib64/python3.6/site-packages/pyanaconda/display.py", line 335, in setup_display
2020-04-25 14:47:18,985: anaconda.initInterface(addon_paths=addon_paths)
2020-04-25 14:47:18,985: File "/usr/lib64/python3.6/site-packages/pyanaconda/anaconda.py", line 394, in initInterface
2020-04-25 14:47:18,985: self._intf = TextUserInterface(self.storage, self.payload,
2020-04-25 14:47:18,985: File "/usr/lib64/python3.6/site-packages/pyanaconda/anaconda.py", line 199, in storage
2020-04-25 14:47:18,985: self._set_default_fstype(self._storage)
2020-04-25 14:47:18,985: File "/usr/lib64/python3.6/site-packages/pyanaconda/anaconda.py", line 310, in _set_default_fstype
2020-04-25 14:47:18,985: storage.set_default_fstype(fstype)
2020-04-25 14:47:18,985: File "/usr/lib/python3.6/site-packages/blivet/threads.py", line 53, in run_with_lock
2020-04-25 14:47:18,985: return m(*args, **kwargs)
2020-04-25 14:47:18,985: File "/usr/lib/python3.6/site-packages/blivet/blivet.py", line 1070, in set_default_fstype
2020-04-25 14:47:18,985: self._check_valid_fstype(newtype)
2020-04-25 14:47:18,985: File "/usr/lib/python3.6/site-packages/blivet/threads.py", line 53, in run_with_lock
2020-04-25 14:47:18,986: return m(*args, **kwargs)
2020-04-25 14:47:18,986: File "/usr/lib/python3.6/site-packages/blivet/blivet.py", line 1055, in _check_valid_fstype
2020-04-25 14:47:18,986: raise ValueError("new value %s is not valid as a default fs type" % newtype)
2020-04-25 14:47:18,986: ValueError: new value xfs is not valid as a default fs type
2020-04-25 14:47:19,110: Running anaconda failed: process '['anaconda', '--kickstart', '/root/gdc-co8.ks', '--cmdline', '--loglevel', 'debug', '--image', '/var/tmp/lmc-disk-te6zkq_0.img', '--remotelog', '127.0.0.1:60935']' exited with status 1

Expected results:
…
2020-04-25 14:48:04,301: Starting automated install......
2020-04-25 14:48:04,301: Generating updated storage configuration
2020-04-25 14:48:04,302: Checking storage configuration...
2020-04-25 14:48:04,302: You have not specified a swap partition. Although not strictly required in all cases, it will significantly improve performance for most installations.
…

Additional info:
Running absolutely same command without chroot works just fine and produces and image.

I have tried systemd-nspawn and "old" chroot, but no luck.

While this can be bug somewhere in lorax or mock, I think this is the appropriate place to report this issue.

I don't know why this fails since this does not boot any VM or anything like that.

Comment 1 Jiri Konecny 2020-04-26 11:51:34 UTC
This issue is most often happening because you are mixing vmlinuz and stage2 environment from a different builds. If I'm not mistaken this is exactly what you are doing because of running mock with your kernel. This bug is more about question what is a recommended way to run LMC in a mock and that is the question more suitet to LMC maintainer than Anaconda.

Switching components to find the solution.

Comment 2 Brian Lane 2020-04-27 16:07:25 UTC
Try installing anaconda-install-env-deps, they moved the libblockdev-plugins-all requirement into it so depending on what's installed you can end up with it missing some of the modules.

Comment 3 Brian Lane 2020-04-27 17:46:24 UTC
Oh, I see. You are trying to make a partitioned disk. You can't do that inside mock since anaconda uses device-mapper, and device-mapper+anaconda doesn't work inside a mock. You can make an iso or a fsimage in the mock, or you can run a virt install inside the mock to do a partitioned disk install (I think -- I haven't actually tested that case).

OTOH I think I need to add anaconda-install-env-deps to the requirements for lorax-lmc-novirt so I'm leaving this open to handle that.

Comment 4 Brian Lane 2020-04-27 17:54:58 UTC
https://github.com/weldr/lorax/pull/1003

Comment 14 errata-xmlrpc 2020-11-04 02:46:06 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 (lorax 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-2020:4662