Bug 2063112 - imgbased fails to handle grub config on CentOS Stream 9
Summary: imgbased fails to handle grub config on CentOS Stream 9
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: imgbased
Classification: oVirt
Component: General
Version: 1.2.24
Hardware: Unspecified
OS: Unspecified
unspecified
urgent
Target Milestone: ovirt-4.5.1
: ---
Assignee: Lev Veyde
QA Contact: Sandro Bonazzola
URL:
Whiteboard:
Depends On:
Blocks: oVirt_on_CentOS_Stream_9_Hosts
TreeView+ depends on / blocked
 
Reported: 2022-03-11 10:04 UTC by Sandro Bonazzola
Modified: 2022-05-03 07:54 UTC (History)
12 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-05-03 07:54:06 UTC
oVirt Team: Node
Embargoed:
sbonazzo: ovirt-4.5?
lsvaty: blocker-


Attachments (Terms of Use)
grub config from /mnt/sysimage/boot/grub2 (2.47 KB, application/gzip)
2022-03-11 10:13 UTC, Sandro Bonazzola
no flags Details
grub entries (620 bytes, application/gzip)
2022-03-11 10:20 UTC, Sandro Bonazzola
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github oVirt imgbased pull 11 0 None open Fixed grubby output parsing (crash on el9) 2022-03-11 16:50:46 UTC
Red Hat Issue Tracker RHV-45092 0 None None None 2022-03-11 10:13:57 UTC

Description Sandro Bonazzola 2022-03-11 10:04:39 UTC
Description of problem:

oVirt Node based on CentOS Stream 9 fails to install.
Anaconda display the following error:

There was an error running the kickstart script at line 5.  This is a fatal error and installation will be aborted.  The details of this error are:

2022-03-11 09:53:53,214 [INFO] (MainThread) Trying to create a manageable base from '/'
2022-03-11 09:53:53,521 [INFO] (MainThread) Initial base will be <Base ovirt-node-ng-4.5.1-0.20220311.0 [] />
2022-03-11 09:53:53,521 [INFO] (MainThread) Initial layer will be <Layer ovirt-node-ng-4.5.1-0.20220311.0+1 />
2022-03-11 09:53:53,521 [INFO] (MainThread) Creating an initial base <Base ovirt-node-ng-4.5.1-0.20220311.0 [] /> for <LV 'onn/root' />
2022-03-11 09:53:54,116 [INFO] (MainThread) Creating initial layer <Layer ovirt-node-ng-4.5.1-0.20220311.0+1 /> for initial base
2022-03-11 09:53:54,116 [INFO] (MainThread) Adding a new layer after <Base ovirt-node-ng-4.5.1-0.20220311.0 [] />
2022-03-11 09:53:54,116 [INFO] (MainThread) Adding a new layer after <Base ovirt-node-ng-4.5.1-0.20220311.0 [] />
2022-03-11 09:53:54,116 [INFO] (MainThread) New layer will be: <Layer ovirt-node-ng-4.5.1-0.20220311.0+1 />
2022-03-11 09:53:55,298 [ERROR] (MainThread) The root volume does not look like an image
2022-03-11 09:53:55,749 [INFO] (migrate_etc) Verifying stream compatability
2022-03-11 09:53:55,752 [INFO] (migrate_etc) Migrating /etc (from <LV 'onn/ovirt-node-ng-4.5.1-0.20220311.0+1' />)
2022-03-11 09:53:55,820 [INFO] (migrate_etc) Configuring versionlock for /dev/onn/ovirt-node-ng-4.5.1-0.20220311.0+1
2022-03-11 09:53:55,955 [INFO] (migrate_etc) Migrating /root
2022-03-11 09:53:55,955 [INFO] (fix_systemd_services) Syncing systemd levels
2022-03-11 09:53:58,459 [INFO] (MainThread) No SCAP evaluation found, skipping
2022-03-11 09:53:58,613 [INFO] (MainThread) Adjusting mount and boot related points
2022-03-11 09:53:58,905 [INFO] (MainThread) Not reinstalling RPMs during system installation
2022-03-11 09:53:59,059 [INFO] (MainThread) Updating default/grub of new layer
2022-03-11 09:53:59,064 [INFO] (MainThread) Updating fstab of new layer
2022-03-11 09:54:06,696 [INFO] (MainThread) Copying kfiles for ovirt-node-ng-4.5.1-0.20220311.0 to /boot/ovirt-node-ng-4.5.1-0.20220311.0+1...
2022-03-11 09:54:06,730 [INFO] (MainThread) Adding bootloader entry ovirt-node-ng-4.5.1-0.20220311.0 (/boot/ovirt-node-ng-4.5.1-0.20220311.0+1/vmlinuz-5.14.0-70.el9.x86_64, /boot/ovirt-node-ng-4.5.1-0.20220311.0+1/initramfs-5.14.0-70.el9.x86_64.img)
2022-03-11 09:54:06,766 [INFO] (MainThread) Removing other boot entries
2022-03-11 09:54:06,897 [ERROR] (MainThread) Failed to update OS
Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/imgbased/plugins/osupdater.py", line 264, in migrate_boot
    adjust_mounts_and_boot(imgbase, new_lv, previous_layer_lv)
  File "/usr/lib/python3.9/site-packages/imgbased/plugins/osupdater.py", line 1047, in adjust_mounts_and_boot
    BootSetupHandler(
  File "/usr/lib/python3.9/site-packages/imgbased/bootsetup.py", line 104, in setup
    b.remove_other_entries()
  File "/usr/lib/python3.9/site-packages/imgbased/bootloader.py", line 406, in remove_other_entries
    return self.bootloader.remove_other_entries()
  File "/usr/lib/python3.9/site-packages/imgbased/bootloader.py", line 355, in remove_other_entries
    self._remove_entry(e)
  File "/usr/lib/python3.9/site-packages/imgbased/bootloader.py", line 251, in _remove_entry
    os.unlink(entry.bls_conf_path())
  File "/usr/lib/python3.9/site-packages/imgbased/bootloader.py", line 186, in bls_conf_path
    raise RuntimeError("Missing bls id for %s" % self)
RuntimeError: Missing bls id for <imgbased.bootloader.Grubby.GrubbyEntry object at 0x7fd724b0e910>
Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/imgbased/plugins/osupdater.py", line 264, in migrate_boot
    adjust_mounts_and_boot(imgbase, new_lv, previous_layer_lv)
  File "/usr/lib/python3.9/site-packages/imgbased/plugins/osupdater.py", line 1047, in adjust_mounts_and_boot
    BootSetupHandler(
  File "/usr/lib/python3.9/site-packages/imgbased/bootsetup.py", line 104, in setup
    b.remove_other_entries()
  File "/usr/lib/python3.9/site-packages/imgbased/bootloader.py", line 406, in remove_other_entries
    return self.bootloader.remove_other_entries()
  File "/usr/lib/python3.9/site-packages/imgbased/bootloader.py", line 355, in remove_other_entries
    self._remove_entry(e)
  File "/usr/lib/python3.9/site-packages/imgbased/bootloader.py", line 251, in _remove_entry
    os.unlink(entry.bls_conf_path())
  File "/usr/lib/python3.9/site-packages/imgbased/bootloader.py", line 186, in bls_conf_path
    raise RuntimeError("Missing bls id for %s" % self)
RuntimeError: Missing bls id for <imgbased.bootloader.Grubby.GrubbyEntry object at 0x7fd724b0e910>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib64/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib64/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/usr/lib/python3.9/site-packages/imgbased/__main__.py", line 53, in <module>
    CliApplication()
  File "/usr/lib/python3.9/site-packages/imgbased/__init__.py", line 82, in CliApplication
    app.hooks.emit("post-arg-parse", args)
  File "/usr/lib/python3.9/site-packages/imgbased/hooks.py", line 120, in emit
    cb(self.context, *args)
  File "/usr/lib/python3.9/site-packages/imgbased/plugins/core.py", line 171, in post_argparse
    layout.initialize(args.source, args.init_nvr)
  File "/usr/lib/python3.9/site-packages/imgbased/plugins/core.py", line 216, in initialize
    self.app.imgbase.init_layout_from(source, init_nvr)
  File "/usr/lib/python3.9/site-packages/imgbased/imgbase.py", line 314, in init_layout_from
    self.add_layer(initial_base, new_layer)
  File "/usr/lib/python3.9/site-packages/imgbased/imgbase.py", line 213, in add_layer
    self.hooks.emit("new-layer-added", prev_lv, new_lv)
  File "/usr/lib/python3.9/site-packages/imgbased/hooks.py", line 120, in emit
    cb(self.context, *args)
  File "/usr/lib/python3.9/site-packages/imgbased/plugins/osupdater.py", line 119, in on_new_layer
    migrate_boot(imgbase, new_lv, previous_layer_lv)
  File "/usr/lib/python3.9/site-packages/imgbased/plugins/osupdater.py", line 268, in migrate_boot
    raise BootSetupError()
imgbased.plugins.osupdater.BootSetupError


It seems to be the same issue causing https://github.com/oVirt/ovirt-node-ng-image/issues/26 which I'm going to close as duplicate of this bug.

Comment 1 Sandro Bonazzola 2022-03-11 10:13:49 UTC
Created attachment 1865395 [details]
grub config from /mnt/sysimage/boot/grub2

Comment 2 Sandro Bonazzola 2022-03-11 10:20:55 UTC
Created attachment 1865397 [details]
grub entries

Comment 3 Lev Veyde 2022-05-03 07:53:42 UTC
The issue is not reproducible with the latest CentOS 9 Stream, nor the latest nightly ovirt-node-ng-installer (https://resources.ovirt.org/repos/ovirt/github-ci/ovirt-node-ng-image/ovirt-node-ng-installer-4.5.1-2022050214.el9.iso).


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