Bug 2187599 - 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".
Summary: Provisioning a baremetal physical machine using Full Host Image is failing on...
Keywords:
Status: VERIFIED
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Provisioning
Version: 6.12.0
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: 6.14.0
Assignee: Oleh Fedorenko
QA Contact: sganar
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-04-18 05:58 UTC by Anand Jambhulkar
Modified: 2023-06-30 19:08 UTC (History)
5 users (show)

Fixed In Version: foreman-3.3.0.21
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker SAT-17254 0 None None None 2023-04-20 14:20:02 UTC
Red Hat Knowledge Base (Solution) 7008208 0 None None None 2023-04-18 06:12:35 UTC

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.


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