Bug 1215064

Summary: kernel-rt postinst script fails
Product: [SUSE Linux Enterprise Real Time Extension] SUSE Linux Enterprise Real Time 15 SP5 Reporter: Martin Doucha <martin.doucha>
Component: OtherAssignee: E-mail List <screening-team-bugs>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Major    
Priority: P1 - Urgent CC: felix.niederwanger, martin.doucha, martin.wilck, meissner, msuchanek, snwint
Version: unspecified   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: openQA Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: Installation of SM30861

Comment 1 Michal Suchanek 2023-09-06 10:16:22 UTC
The scripts are in suse-module-tools, this is not a kernel change.
Comment 2 Michal Suchanek 2023-09-06 10:19:21 UTC
Can you provide full log of succesful and failing run, especially used packages?
Comment 3 Michal Suchanek 2023-09-06 10:33:50 UTC
The most likely candidates to watch for are perl-Bootloader and suse-module-tools.
Comment 4 Martin Doucha 2023-09-06 11:41:01 UTC
(In reply to Michal Suchanek from comment #2)
> Can you provide full log of succesful and failing run, especially used
> packages?

Successful kernel-rt install last month:
https://openqa.suse.de/tests/11692265#step/update_kernel/70
full console log: https://openqa.suse.de/tests/11692265/logfile?filename=serial_terminal.txt

suse-module-tools-15.4.16-150400.3.8.1.x86_64
perl-Bootloader-0.939-150400.3.3.1.x86_64


Failed kernel-rt install yesterday (same kernel version as above):
https://openqa.suse.de/tests/12009239#step/update_kernel/59
full console log: https://openqa.suse.de/tests/12009239/logfile?filename=serial_terminal.txt

suse-module-tools-15.4.16-150400.3.8.1.x86_64
perl-Bootloader-0.944-150400.3.6.1.x86_64
Comment 5 Marcus Meissner 2023-09-06 11:47:19 UTC
would say perl-bootloader.
Comment 6 Martin Wilck 2023-09-06 18:42:25 UTC
s-m-t 15.4.16 has been released in February, perl-Bootloader 0.944 in July.

Error message is:

Usage: bootloader_entry add|remove kernel-flavor kernel-version kernel-image initrd-file
Add or remove kernel images to boot config.
warning: %post(kernel-rt-5.14.21-150400.15.46.1.x86_64) scriptlet failed, exit status 1

The error message is generated in the bootloader_entry script here:

if($program eq 'bootloader_entry') {
  if($ARGV[0] =~ /^(add|remove)$/ && @ARGV == 5) {
    push @todo, [ "$ARGV[0]-kernel", @ARGV[2..4] ]
  }
  else {
    bootloader_entry_usage 1;
  }
}

The problem is the "@ARGV == 5" test, because for the "rt" flavor, the kernel scriptlets pass 6 arguments to the bootloader_entry call:

                        /usr/lib/bootloader/bootloader_entry \
                            add \
                            "$flavor" \
                            "$kernelrelease"-"$flavor" \
                            "$image"-"$kernelrelease"-"$flavor" \
                            $initrd \
                            $default || script_rc=$?

Where "$default" is "force-default" for the rt flavor and empty for all other flavors.
Comment 7 Steffen Winterfeldt 2023-09-07 08:38:43 UTC
Yes, that should be '@ARGV >= 5'. I'll prepare a patch.
Comment 8 Steffen Winterfeldt 2023-09-07 08:48:47 UTC
fix in TW:

https://github.com/openSUSE/perl-bootloader/pull/156
Comment 9 Steffen Winterfeldt 2023-09-07 17:08:58 UTC
fix for SLE15:

https://github.com/openSUSE/perl-bootloader/pull/157
Comment 12 Maintenance Automation 2023-09-18 20:30:19 UTC
SUSE-RU-2023:3663-1: An update that has one fix can now be installed.

Category: recommended (important)
Bug References: 1215064
Sources used:
openSUSE Leap 15.4 (src): perl-Bootloader-0.945-150400.3.9.1
openSUSE Leap 15.5 (src): perl-Bootloader-0.945-150400.3.9.1
SUSE Linux Enterprise Micro for Rancher 5.3 (src): perl-Bootloader-0.945-150400.3.9.1
SUSE Linux Enterprise Micro 5.3 (src): perl-Bootloader-0.945-150400.3.9.1
SUSE Linux Enterprise Micro for Rancher 5.4 (src): perl-Bootloader-0.945-150400.3.9.1
SUSE Linux Enterprise Micro 5.4 (src): perl-Bootloader-0.945-150400.3.9.1
Basesystem Module 15-SP4 (src): perl-Bootloader-0.945-150400.3.9.1
Basesystem Module 15-SP5 (src): perl-Bootloader-0.945-150400.3.9.1
Development Tools Module 15-SP4 (src): perl-Bootloader-0.945-150400.3.9.1
Development Tools Module 15-SP5 (src): perl-Bootloader-0.945-150400.3.9.1

NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.
Comment 14 Felix Niederwanger 2023-10-04 13:19:25 UTC
*** Bug 1215900 has been marked as a duplicate of this bug. ***
Comment 15 Felix Niederwanger 2023-10-04 13:22:37 UTC
Created attachment 869911 [details]
Installation of SM30861

Reopening issue, as this is again present when installing https://smelt.suse.de/incident/30861/

See e.g. https://openqa.suse.de/tests/12367705#step/install_updates/223

To be sure, I tried this now in a fresh SLEM 5.5 RT VM. The VM is updated and when only installing the update from http://download.suse.de/ibs/SUSE:/Maintenance:/30861/SUSE_Updates_SLE-Micro_5.5_x86_64/ I get:

> Usage: bootloader_entry add|remove kernel-flavor kernel-version kernel-image initrd-file
> Add or remove kernel images to boot config.
> CA enrolled. Skip /etc/uefi/certs/76B6A6A0.crt
> warning: %post(kernel-rt-5.14.21-150500.13.18.1.x86_64) scriptlet failed, exit status 1
> ...
> Option --remove-kernel not available for grub2-efi.
> done]
> Executing %posttrans script 'kernel-rt-5.14.21-150500.13.18.1.x86_64.rpm' [...done]

I'm attaching a full log of me updating the SLEM 5.5 VM, then adding the incident in question, running `transactional-update up` and running into the described issue.
Comment 16 Felix Niederwanger 2023-10-04 13:23:03 UTC
Reopening because of https://openqa.suse.de/tests/12367705#step/install_updates/223
Comment 17 Michal Suchanek 2023-10-04 14:11:05 UTC
What is the perl-Bootloader version on the test system?

I do not see that in the test assets.
Comment 18 Steffen Winterfeldt 2023-10-04 14:15:34 UTC
Do you have perl-Bootloader-0.945 installed (see comment 12)?

If so, please attach /var/log/pbl.log.
Comment 19 Felix Niederwanger 2023-10-05 07:00:37 UTC
> i | perl-Bootloader | package | 0.944-150400.3.6.1 | x86_64 | SLE-Micro-5.5-Pool

Nope, the 0.944-150400.3.6.1 version is installed. This is SLEM 5.5 GMC and as far as I can see there is no update currently in the queue, otherwise we wouldn't see the error in openQA

If this is a problem, we need to act quickly as the GMC is about to be shipped.
Comment 20 Steffen Winterfeldt 2023-10-05 10:54:01 UTC
The fix has been released in the products mentioned in comment 12.

If you need it integrated in some GMC this bug should be assigned to the
release manager of that product to make a decision.

Nothing I can help with.
Comment 21 Marcus Meissner 2023-10-05 11:01:19 UTC
i rereleased the update for SLE Micro 5.5 and Leap Micro 5.5.

tersting looks good so far.
Comment 22 Maintenance Automation 2023-10-05 12:29:32 UTC
SUSE-RU-2023:3663-2: An update that has one fix can now be installed.

Category: recommended (important)
Bug References: 1215064
Sources used:
SUSE Linux Enterprise Micro 5.5 (src): perl-Bootloader-0.945-150400.3.9.1

NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.
Comment 23 Felix Niederwanger 2023-10-05 13:48:04 UTC
Problem appears to be resolved, see https://openqa.suse.de/tests/12384705 and https://openqa.suse.de/tests/12386121.

Thanks!
Comment 24 Maintenance Automation 2023-10-30 08:30:01 UTC
SUSE-RU-2023:4237-1: An update that has one fix can now be installed.

Category: recommended (moderate)
Bug References: 1215064
Sources used:
openSUSE Leap 15.3 (src): perl-Bootloader-0.945-150300.3.12.1
SUSE Linux Enterprise High Performance Computing ESPOS 15 SP3 (src): perl-Bootloader-0.945-150300.3.12.1
SUSE Linux Enterprise High Performance Computing LTSS 15 SP3 (src): perl-Bootloader-0.945-150300.3.12.1
SUSE Linux Enterprise Server 15 SP3 LTSS 15-SP3 (src): perl-Bootloader-0.945-150300.3.12.1
SUSE Linux Enterprise Server for SAP Applications 15 SP3 (src): perl-Bootloader-0.945-150300.3.12.1
SUSE Manager Proxy 4.2 (src): perl-Bootloader-0.945-150300.3.12.1
SUSE Manager Retail Branch Server 4.2 (src): perl-Bootloader-0.945-150300.3.12.1
SUSE Manager Server 4.2 (src): perl-Bootloader-0.945-150300.3.12.1
SUSE Enterprise Storage 7.1 (src): perl-Bootloader-0.945-150300.3.12.1
SUSE Linux Enterprise Micro 5.1 (src): perl-Bootloader-0.945-150300.3.12.1
SUSE Linux Enterprise Micro 5.2 (src): perl-Bootloader-0.945-150300.3.12.1
SUSE Linux Enterprise Micro for Rancher 5.2 (src): perl-Bootloader-0.945-150300.3.12.1

NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.
Comment 26 Maintenance Automation 2024-03-14 12:30:00 UTC
SUSE-RU-2024:0883-1: An update that has two fixes can now be installed.

Category: recommended (moderate)
Bug References: 1215064, 1218842
Sources used:
SUSE Linux Enterprise High Performance Computing 12 SP5 (src): perl-Bootloader-0.946-3.6.2
SUSE Linux Enterprise Server 12 SP5 (src): perl-Bootloader-0.946-3.6.2
SUSE Linux Enterprise Server for SAP Applications 12 SP5 (src): perl-Bootloader-0.946-3.6.2

NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.