Bug 2172545

Summary: Post upgrade to 6.12.2-1, (full-host-bootdisk) generated with static IP failed to boot and ends in grub prompt due to syntax error.
Product: Red Hat Satellite Reporter: Satyajit Das <sadas>
Component: ProvisioningAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED DUPLICATE QA Contact: sganar
Severity: urgent Docs Contact:
Priority: urgent    
Version: 6.12.1CC: ahumbe, j.becker, lstejska, risantam, saydas, sshtein
Target Milestone: UnspecifiedKeywords: PrioBumpGSS
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-02-23 13:52:45 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 Satyajit Das 2023-02-22 13:54:59 UTC
Description of problem:

Post upgrade to 6.12.2-1, (full-host-bootdisk) generated with static IP failed to boot on EFI firmware and ends in grub prompt due to syntax error.
As the auto-attached boot disk uses the fullhost image the same behavior is observed.


Version-Release number of selected component (if applicable):

satellite-6.12.2-1.el8sat

How reproducible:

100%

Steps to Reproduce:

1. Upgrade the satellite with the latest patches i.e satellite-6.12.2-1.el8sat
2. Create a subnet with all the required info and set the Boot Mode to static.
3. Generate fullhost image with "PXEloader=Grub2 UEFI"

Actual results:

Provisioning fails due to syntax error and ends in GRUB>


Expected results:

Fullhost image with static IP should be able to boot on EFI firmware.


Additional info:
Sharing the template info
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# This file was deployed via 'Kickstart default PXEGrub2' template

set default=0
set timeout=10

menuentry 'Kickstart default PXEGrub2' {
  linuxefi boot/red-hat-enterprise-linux-8-for-x86_64-baseos-kickstart-8-6-7-vmlinuz  BOOTIF=01-00-50-56-b4-ad-ab ks=http://satellite.example.com/unattended/provision?static=1&token=98aab8f2-0a19-40f0-a7f6-4ae4ba7f66de ip=192.168.xxx.187::192.168.xxx.1:255.255.255.0:oscar-hayne.sat.example.com::none nameserver=192.168.xxx.2 nameserver=xx.xx.5.25
  initrdefi boot/red-hat-enterprise-linux-8-for-x86_64-baseos-kickstart-8-6-7-initrd.img
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 BOOTIF=01-00-50-56-b4-ad-ab ks=http://satellite.example.com/unattended/provision?static=1&token=98aab8f2-0a19-40f0-a7f6-4ae4ba7f66de    // The issue seems to be the newly rendered syntax static=1&token.



Additional info:-

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

With the boot mode set to DHCP, the full host image on EUFI/EFI booted and provisioned successfully without any issues.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# This file was deployed via 'Kickstart default PXEGrub2' template

set default=0
set timeout=10

menuentry 'Kickstart default PXEGrub2' {
  linuxefi boot/red-hat-enterprise-linux-8-for-x86_64-baseos-kickstart-8-6-7-vmlinuz  BOOTIF=01-00-50-56-b4-df-f7 ks=http://satellite.example.com/unattended/provision?static=1 ip=192.xxx.xxx.190::192.xxx.xxx.1:xxx.255.255.0:mona-breyer.example.com::none nameserver=192.xxx.xx.2 nameserver=10.xx.x.25
  initrdefi boot/red-hat-enterprise-linux-8-for-x86_64-baseos-kickstart-8-6-7-initrd.img
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Comment 1 Jürgen Becker 2023-02-22 14:27:13 UTC
Additional Info: Encapsulating the url in quotes like this:  ks="http://satellite.example.com/unattended/provision?static=1&token=98aab8f2-0a19-40f0-a7f6-4ae4ba7f66de" would solve the issue

Comment 2 Sayan Das 2023-02-22 15:15:17 UTC
I have a feeling https://github.com/theforeman/foreman/pull/9631 was created for this issue only. 

Upstream discussion: https://community.theforeman.org/t/foreman-uefi-provisioning-grub-failure/30577 


Perhaps Leos can confirm . Looping him.

Comment 3 Leos Stejskal 2023-02-23 08:09:24 UTC
Encapsulating the URL brakes PXE+BIOS provisioning [0], the correct fix is to escape & character. 
Upstream PR [1] have been merged, and for 6.13 cherry-pick is ready for review [2].

[0] https://github.com/theforeman/foreman/pull/9477#issuecomment-1433086069
[1] https://github.com/theforeman/foreman/pull/9477
[2] https://github.com/theforeman/foreman/pull/9631

Comment 5 Brad Buckingham 2023-02-23 13:43:42 UTC
Adding needinfo based upon comment 4

Comment 6 Leos Stejskal 2023-02-23 13:52:45 UTC
Hi,
yeah I believe we can close the BZ as a duplicate,
the root cause is clearly same as in the https://bugzilla.redhat.com/show_bug.cgi?id=2168967.

*** This bug has been marked as a duplicate of bug 2168967 ***