Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite 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 "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. 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 "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-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 2187599

Summary: Provisioning a baremetal physical machine using Full Host Image is failing on Red Hat Satellite 6.12 with the error - "error:/../../grub-core.script/lexer.c:352:syntax error".
Product: Red Hat Satellite Reporter: Anand Jambhulkar <ajambhul>
Component: ProvisioningAssignee: Oleh Fedorenko <ofedoren>
Status: CLOSED ERRATA QA Contact: sganar
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.12.0CC: lstejska, sadas, sganar, shwsingh, sshtein
Target Milestone: 6.14.0Keywords: Regression, Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: foreman-3.3.0.21 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2242913 (view as bug list) Environment:
Last Closed: 2023-11-08 14:19:08 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 Anand Jambhulkar 2023-04-18 05:58:18 UTC
Description of problem:
----------------------

After upgrading the Satellite Server from version 6.10 to 6.12, provisioning a Baremetal Cisco UCSX-210C-M6 using Full Host Image is failing since the host can't boot from the ISO.

The actual error that the customer gets is as follows - 

error:/../../grub-core.script/lexer.c:352:syntax error.
error:/../../grub-core.script/lexer.c:352:Incorrect command.
error:/../../grub-core.script/lexer.c:352:syntax error.



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

Red Hat Satellite 6.12



Actual results:
--------------

Provisioning a Baremetal Cisco UCSX-210C-M6 using Full Host Image is fails.



Expected results:
----------------

Provisioning a Baremetal Cisco UCSX-210C-M6 using Full Host Image should be successful.



Additional info:
---------------

The provisioning was working as expected on Red Hat Satellite 6.10.

Thus, this might be a regression bug.

Provisioning fails with the error given in the problem description.



Following is the ISO structure which is generated on Satellite 6.12 and Satellite 6.10 -



Satellite 6.12 - NOT working
--------------

 menuentry 'Foreman Bootdisk' {
  linuxefi /BOOT/S_KICKSTART_8_6_7859_VMLINUZ  BOOTIF=01-00-25-b5-76-a0-24 ks=http://sddvvrba378.612w.bns:8000/unattended/provision?static=1&token=4a39e689-5f17-441c-9572-1ef893f0fcae ip=10.92.101.25::10.92.101.1:255.255.255.192:sdpsvrbi827.scglobal.ad.scotiacapital.com::none nameserver=172.20.90.10 nameserver=172.22.1.30
  initrdefi /BOOT/ICKSTART_8_6_7859_INITRD_IMG
}



Satellite 6.10 - It was working:
--------------
 menuentry 'Foreman Bootdisk' {
  linuxefi /BOOT/S_KICKSTART_8_6_7859_VMLINUZ ks=http://sddvvrba378.612w.bns:8000/unattended/provision?token=2974687b-db75-48ae-9107-4a8e4a084d2b  BOOTIF=01-00-25-b5-76-a0-23 kssendmac ks.sendmac inst.ks.sendmac ip=10.92.101.24::10.92.101.1:255.255.255.192:sdpsvrbi826.scglobal.ad.scotiacapital.com::none nameserver=172.20.90.10 nameserver=172.22.1.30
  initrdefi /BOOT/ICKSTART_8_6_7859_INITRD_IMG
}




In the Satellite 6.12 ISO structure, notice the presence of ampersand (&) in the URL in between static=1 and token=4a39... as follows -> static=1&token=4a39.

In the Satellite 6.10 ISO structure, ampersand (&) is not present. 

The presence of this ampersand (&) is causing the issue as, Grub2 requires the ampersand "&" to be escaped or full argument to be quoted, as shown in the examples below - 


Original URL (failing) -
----------------------

	inst.ks=http://myserver.example.com/kickstarts/provision?token=someUUID&static=yes


Quoted URL -
----------


	inst.ks="http://myserver.example.com/kickstarts/provision?token=someUUID&static=yes"

		OR

	inst.ks='http://myserver.example.com/kickstarts/provision?token=someUUID&static=yes'



Escaped ampersand "&" -
---------------------


	inst.ks=http://myserver.example.com/kickstarts/provision?token=someUUID\&static=yes



- In grub, the & character without an escape is considered a word separation meta-character.

- In order to process the & as part of the URL and not a meta-character, it must be escaped or quoted.



Refer the following KCS article for additional details - 

	https://access.redhat.com/solutions/6810791

Comment 4 sganar 2023-05-31 12:25:55 UTC
Verified.

Tested on Satellite 6.14.0 Snap 1

Steps followed:

1. Configure the satellite for provisioning
2. Use the full host image of the created host to boot the host.

Observation: No issues were observed while booting the system, and provisioning is successful.

Comment 7 errata-xmlrpc 2023-11-08 14:19:08 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 (Important: Satellite 6.14 security and bug fix 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/RHSA-2023:6818