Grub2 network boot installation starts with dash character

provisioning

#1

Problem:
Grub2 (/grub2/grubx64.efi) network boot installation starts with dash and goes no further by install Ubuntu 18.04.
Foreman-katello OS is Centos 7.5.

Expected outcome:

Foreman and Proxy versions:

foreman-1.18.3
foreman-proxy-1.18.3
katello-3.7.1-1

Foreman and Proxy plugin versions:

Other relevant data:
[e.g. logs from Foreman and/or the Proxy, modified templates, commands issued, etc]
(for logs, surround with three back-ticks to get proper formatting, e.g.)

logs

#2

By booting i get the message:
Downloading NBP file…
NBP file downloaded successfully.

And after that dash character.

My /grub2/grub.cfg file:
insmod regexp

set net_pxe_mac=$net_default_mac
regexp --set=1:m1 --set=2:m2 --set=3:m3 --set=4:m4 --set=5:m5 --set=6:m6 ‘^([0-9a-f]{1,2}):([0-9a-f]{1,2}):([0-9a-f]{1,2}):([0-9a-f]{1,2}):([0-9a-f]{1,2}):([0-9a-f]{1,2})’ “$net_default_mac”
mac_dashed=${m1}-${m2}-${m3}-${m4}-${m5}-${m6}

mac_configfile=$prefix/grub.cfg-01-$mac_dashed
source “$mac_configfile”


#3

RHEL 7.4 provisioning with uefi (grub2) has no problem only Ubuntu.


#4

Provide any kind of useful information, logs from tftp server, screenshot of the failure.


#5

proxy.log:

I, [2018-11-22T15:55:31.262175 15144496]  INFO -- : 10.12.81.86 - - [22/Nov/2018:15:55:31 +0100] "POST /tftp/PXELinux/b8:85:84:aa:47:3b HTTP/1.1" 200 - 0.0016

I, [2018-11-22T15:55:31.299134 15144496]  INFO -- : 10.12.81.86 - - [22/Nov/2018:15:55:31 +0100] "POST /tftp/PXEGrub2/b8:85:84:aa:47:3b HTTP/1.1" 200 - 0.0012

I, [2018-11-22T15:55:31.336682 15144496]  INFO -- : 10.12.81.86 - - [22/Nov/2018:15:55:31 +0100] "POST /tftp/PXEGrub/b8:85:84:aa:47:3b HTTP/1.1" 200 - 0.0023

E, [2018-11-22T15:55:31.348100 15144496] ERROR -- : Attempt to remove nonexistent client autosign for clientxxxxx.lan
I, [2018-11-22T15:55:31.348443 15144496]  INFO -- : 10.12.81.86 - - [22/Nov/2018:15:55:31 +0100] "DELETE /puppet/ca/autosign/clientxxxxx.lan HTTP/1.1" 404 81 0.0008

I, [2018-11-22T15:55:36.538351 15144496]  INFO -- : 10.12.81.86 - - [22/Nov/2018:15:55:36 +0100] "GET /features HTTP/1.1" 200 70 0.0004

I, [2018-11-22T15:55:36.597973 15144496]  INFO -- : 10.12.81.86 - - [22/Nov/2018:15:55:36 +0100] "GET /pulp/status/puppet HTTP/1.1" 200 58 0.0004

I, [2018-11-22T15:55:36.650767 15144496]  INFO -- : 10.12.81.86 - - [22/Nov/2018:15:55:36 +0100] "GET /features HTTP/1.1" 200 70 0.0005

I, [2018-11-22T15:55:36.711390 15144496]  INFO -- : 10.12.81.86 - - [22/Nov/2018:15:55:36 +0100] "GET /ssh/pubkey HTTP/1.1" 200 425 0.0004

I, [2018-11-22T15:55:36.764490 15144496]  INFO -- : 10.12.81.86 - - [22/Nov/2018:15:55:36 +0100] "GET /features HTTP/1.1" 200 70 0.0004

I, [2018-11-22T15:55:38.816009 15144496]  INFO -- : 10.12.81.86 - - [22/Nov/2018:15:55:38 +0100] "POST /tftp/PXELinux/b8:85:84:aa:47:3b HTTP/1.1" 200 - 0.0010

I, [2018-11-22T15:55:38.897152 15144496]  INFO -- : 10.12.81.86 - - [22/Nov/2018:15:55:38 +0100] "POST /tftp/PXEGrub2/b8:85:84:aa:47:3b HTTP/1.1" 200 - 0.0013

I, [2018-11-22T15:55:38.923762 15144496]  INFO -- : 10.12.81.86 - - [22/Nov/2018:15:55:38 +0100] "POST /tftp/fetch_boot_file HTTP/1.1" 200 - 0.0034

I, [2018-11-22T15:55:38.933835 15144496]  INFO -- : 10.12.81.86 - - [22/Nov/2018:15:55:38 +0100] "POST /tftp/fetch_boot_file HTTP/1.1" 200 - 0.0008

Do you need any other log?


#6

You haven’t provided what I asked for. Logs from TFTP server.

The picture shows a top-left corner of a black screen. What is that again?

Also use formatting buttons in the edit dialog to format logs properly.

You will need more effort in order to solve the problem, or buy one of many commercial offerings where you can say “come and fix this”.


#7

Hello…thanks for reply. I am sorry but i can not find the tftp log file, can you tell me please where to find it.
The picture is shown the the provisioning output on the Monitor…dash character in the right corner.
Sorry again…but i do not realy know what you mean with “formatting buttons in the edit dialog to format logs properly”?
First i had Foreman 18.02 and the installation did not work so i updated it to 18.03 and the same problem again. I have restarted the installation so that foreman created a new grubx64.efi in /var/lib/tftpboot/grub2. I have reconfigured the grub.cfg in /var/lib/tftpboot/grub2/ like you sed in some other posts. I have deleted the grub.cfg-01-xxxx and start the build more then 1 time. I set the the dhcp file name to grub2/grubx64.efi and /grub2/grubx64.efi. All of that didnt work for Ubuntu provisioning so i hoped some of you could help. :slight_smile:


#8

i don’t know which tftp server are you using but generally /var/log/messages on RH will be fine.


#9

Thanks…i hope that this is the right log:

Nov 22 15:56:08 atgrzsl2838 in.tftpd[4048]: RRQ from 10.12.19.37 filename grub2/grubx64.efi
Nov 22 15:56:08 atgrzsl2838 in.tftpd[4048]: Error code 8: User aborted the transfer
Nov 22 15:56:08 atgrzsl2838 in.tftpd[4071]: RRQ from 10.12.19.37 filename grub2/grubx64.efi
Nov 22 15:56:08 atgrzsl2838 in.tftpd[4071]: Client 10.12.19.37 finished grub2/grubx64.efi
Nov 22 15:56:13 atgrzsl2838 in.tftpd[4099]: RRQ from 10.12.19.37 filename /grub2/grub.cfg-01-b8-85-84-aa-47-3b
Nov 22 15:56:13 atgrzsl2838 in.tftpd[4099]: Client 10.12.19.37 finished /grub2/grub.cfg-01-b8-85-84-aa-47-3b
Nov 22 15:56:13 atgrzsl2838 in.tftpd[4100]: RRQ from 10.12.19.37 filename grub2/x86_64-efi/command.lst
Nov 22 15:56:13 atgrzsl2838 in.tftpd[4100]: Client 10.12.19.37 File not found grub2/x86_64-efi/command.lst
Nov 22 15:56:13 atgrzsl2838 in.tftpd[4101]: RRQ from 10.12.19.37 filename grub2/x86_64-efi/fs.lst
Nov 22 15:56:13 atgrzsl2838 in.tftpd[4101]: Client 10.12.19.37 File not found grub2/x86_64-efi/fs.lst
Nov 22 15:56:13 atgrzsl2838 in.tftpd[4102]: RRQ from 10.12.19.37 filename grub2/x86_64-efi/crypto.lst
Nov 22 15:56:13 atgrzsl2838 in.tftpd[4102]: Client 10.12.19.37 File not found grub2/x86_64-efi/crypto.lst
Nov 22 15:56:13 atgrzsl2838 in.tftpd[4103]: RRQ from 10.12.19.37 filename grub2/x86_64-efi/terminal.lst
Nov 22 15:56:13 atgrzsl2838 in.tftpd[4103]: Client 10.12.19.37 File not found grub2/x86_64-efi/terminal.lst
Nov 22 15:56:13 atgrzsl2838 in.tftpd[4104]: RRQ from 10.12.19.37 filename /grub2/grub.cfg-01-b8-85-84-aa-47-3b
Nov 22 15:56:13 atgrzsl2838 in.tftpd[4104]: Client 10.12.19.37 finished /grub2/grub.cfg-01-b8-85-84-aa-47-3b
Nov 22 15:56:13 atgrzsl2838 in.tftpd[4105]: RRQ from 10.12.19.37 filename /grub2/grub.cfg-01-b8-85-84-aa-47-3b
Nov 22 15:56:13 atgrzsl2838 in.tftpd[4105]: Client 10.12.19.37 finished /grub2/grub.cfg-01-b8-85-84-aa-47-3b
Nov 22 15:56:13 atgrzsl2838 in.tftpd[4106]: RRQ from 10.12.19.37 filename /grub2/grub.cfg-01-b8-85-84-aa-47-3b
Nov 22 15:56:13 atgrzsl2838 in.tftpd[4106]: Client 10.12.19.37 finished /grub2/grub.cfg-01-b8-85-84-aa-47-3b
Nov 22 15:56:13 atgrzsl2838 in.tftpd[4107]: RRQ from 10.12.19.37 filename /grub2/grub.cfg-01-b8-85-84-aa-47-3b
Nov 22 15:56:13 atgrzsl2838 in.tftpd[4107]: Client 10.12.19.37 finished /grub2/grub.cfg-01-b8-85-84-aa-47-3b
Nov 22 15:56:13 atgrzsl2838 in.tftpd[4108]: RRQ from 10.12.19.37 filename /grub2/grub.cfg-01-b8-85-84-aa-47-3b
Nov 22 15:56:13 atgrzsl2838 in.tftpd[4108]: Client 10.12.19.37 finished /grub2/grub.cfg-01-b8-85-84-aa-47-3b
Nov 22 15:56:13 atgrzsl2838 in.tftpd[4109]: RRQ from 10.12.19.37 filename /grub2/grub.cfg-01-b8-85-84-aa-47-3b
Nov 22 15:56:13 atgrzsl2838 in.tftpd[4109]: Client 10.12.19.37 finished /grub2/grub.cfg-01-b8-85-84-aa-47-3b
Nov 22 15:56:13 atgrzsl2838 in.tftpd[4111]: RRQ from 10.12.19.37 filename /grub2/grub.cfg-01-b8-85-84-aa-47-3b
Nov 22 15:56:13 atgrzsl2838 in.tftpd[4111]: Client 10.12.19.37 finished /grub2/grub.cfg-01-b8-85-84-aa-47-3b
Nov 22 15:56:13 atgrzsl2838 in.tftpd[4112]: RRQ from 10.12.19.37 filename /grub2/grub.cfg-01-b8-85-84-aa-47-3b
Nov 22 15:56:13 atgrzsl2838 in.tftpd[4112]: Client 10.12.19.37 finished /grub2/grub.cfg-01-b8-85-84-aa-47-3b

#10

I have upgraded foreman to 19.1 and am getting the same message in log file by provisioning Ubuntu with UEFI (File not found…):

Nov 22 15:56:13 atgrzsl2838 in.tftpd[4100]: Client 10.12.19.37 File not found grub2/x86_64-efi/command.lst
Nov 22 15:56:13 atgrzsl2838 in.tftpd[4101]: RRQ from 10.12.19.37 filename grub2/x86_64-efi/fs.lst
Nov 22 15:56:13 atgrzsl2838 in.tftpd[4101]: Client 10.12.19.37 File not found grub2/x86_64-efi/fs.lst
Nov 22 15:56:13 atgrzsl2838 in.tftpd[4102]: RRQ from 10.12.19.37 filename grub2/x86_64-efi/crypto.lst
Nov 22 15:56:13 atgrzsl2838 in.tftpd[4102]: Client 10.12.19.37 File not found grub2/x86_64-efi/crypto.lst
Nov 22 15:56:13 atgrzsl2838 in.tftpd[4103]: RRQ from 10.12.19.37 filename grub2/x86_64-efi/terminal.lst
Nov 22 15:56:13 atgrzsl2838 in.tftpd[4103]: Client 10.12.19.37 File not found grub2/x86_64-efi/terminal.lst
Nov 22 15:56:13 atgrzsl2838 in.tftpd[4104]: RRQ from 10.12.19.37 filename /grub2/grub.cfg-01-b8-85-84-aa-47-3b
Nov 22 15:56:13 atgrzsl2838 in.tftpd[4104]: Client 10.12.19.37 finished /grub2/grub.cfg-01-b8-85-84-aa-47-3b
Nov 22 15:56:13 atgrzsl2838 in.tftpd[4105]: RRQ from 10.12.19.37 filename /grub2/grub.cfg-01-b8-85-84-aa-47-3b


#11

Does anybody know what has to be changed that provisioning findes those files and starts to install?


#12

There is no Foreman 19.1, perhaps you mean 1.19.1? You need to give correct and useful information if you can get anywhere.

It looks like the TFTP client is trying to grab one single file but it fails. TFTP is a UDP-based protocol and when packets do not reach its destination the client tries over and over again. Therefore my wild guess is - you have a firewall or NAT in between the client and TFTP server. This won’t work (it is possible to get TFTP working behind NAT with some effort and kernel modules).


#13

Yes, sory i mean 1.19.1…
Thanks for your replay.
The question is why it is working with PXELinux BIOS for all OS and Grub2 UEFI is working with RHEL. The problem is only with Grub2 UEFI Ubuntu?
If the TFTP client can get the PXELinux BIOS for Ubuntu why can he not get the Grub2 UEFI…the installation media source is the same?


#14

Red Hat grub2 is patched with this automatic loading of configuration via MAC address. Ubuntu/Debian build cannot do that as upstream does not have this implemented. That’s the reason why we offer this “trick” to find the file:

  1. Can you try to change this line:

    configfile=/grub2/grub.cfg-01-$mac
    

to

   configfile=grub2/grub.cfg-01-$mac

And try again?

  1. What’s actually in the /grub2/grub.cfg-01-b8-85-84-aa-47-3b file that fails to load? Isn’t it an empty file or something with wrong permissions?

#15

Hi…thanks again for your reply. I have first changed the PXEGrub2 global default like you sad and then the /var/lib/tftpboot/grub2/grub.cfg on Foreman…but getting the same message.

grub2]# cat grub.cfg-01-d4-be-d9-6d-88-84



default=local
timeout=20

# On Debian/Ubuntu grub2 does not have patch for loading MAC-based configs. Also due to bug
# in RHEL 7.4 files are loaded with an extra ":" character at the end. This workarounds both
# cases, make sure "regexp.mod" file is present on the TFTP. For more info see:
# https://bugzilla.redhat.com/show_bug.cgi?id=1370642#c70
insmod regexp
regexp --set=1:m1 --set=2:m2 --set=3:m3 --set=4:m4 --set=5:m5 --set=6:m6 '^([0-9a-f]{1,2})\:([0-9a-f]{1,2})\:([0-9a-f]{1,2})\:([0-9a-f]{1,2})\:([0-9a-f]{1,2})\:([0-9a-f]{1,2})' "$net_default_mac"
mac=${m1}-${m2}-${m3}-${m4}-${m5}-${m6}
configfile=grub2/grub.cfg-01-$mac
source "$configfile"


menuentry 'Chainload Grub2 EFI from ESP' --id local {
  unset root
  echo Chainloading Grub2 EFI from ESP, available devices:
  ls
  echo -n "Probing ESP partition ... "
  search --file --no-floppy --set=root /EFI/BOOT/BOOTX64.EFI
  echo found $root
  sleep 2
  if [ -f ($root)/EFI/BOOT/grubx64.efi ]; then
    chainloader ($root)/EFI/BOOT/grubx64.efi

  elif [ -f ($root)/EFI/fedora/grubx64.efi ]; then
    chainloader ($root)/EFI/fedora/grubx64.efi

  elif [ -f ($root)/EFI/redhat/grubx64.efi ]; then
    chainloader ($root)/EFI/redhat/grubx64.efi

  elif [ -f ($root)/EFI/centos/grubx64.efi ]; then
    chainloader ($root)/EFI/centos/grubx64.efi

  elif [ -f ($root)/EFI/debian/grubx64.efi ]; then
    chainloader ($root)/EFI/debian/grubx64.efi

  elif [ -f ($root)/EFI/ubuntu/grubx64.efi ]; then
    chainloader ($root)/EFI/ubuntu/grubx64.efi

  elif [ -f ($root)/EFI/sles/grubx64.efi ]; then
    chainloader ($root)/EFI/sles/grubx64.efi

  elif [ -f ($root)/EFI/opensuse/grubx64.efi ]; then
    chainloader ($root)/EFI/opensuse/grubx64.efi

  elif [ -f ($root)/EFI/Microsoft/grubx64.efi ]; then
    chainloader ($root)/EFI/Microsoft/grubx64.efi

  elif [ -f ($root)/EFI/EFI/grubx64.efi ]; then
    chainloader ($root)/EFI/EFI/grubx64.efi
    else
    echo File grubx64.efi not found on ESP.
    echo Update 'pxegrub2_chainload' paths array with:
    ls ($root)/EFI
    echo The system will halt in 2 minutes or
    echo press ESC to halt immediately.
    sleep -i 120
    halt --no-apm
  fi
}

menuentry 'Chainload into BIOS bootloader on first disk' --id local_chain_hd0 {
  set root=(hd0,0)
  chainloader +1
}

menuentry 'Chainload into BIOS bootloader on second disk' --id local_chain_hd1 {
  set root=(hd1,0)
  chainloader +1
}


menuentry 'Foreman Discovery Image' --id discovery {
  linuxefi boot/fdi-image/vmlinuz0 rootflags=loop root=live:/fdi.iso rootfstype=auto ro rd.live.image acpi=force rd.luks=0 rd.md=0 rd.dm=0 rd.lvm=0 rd.bootif=0 rd.neednet=0 nomodeset proxy.url=https://proxy.lan proxy.type=foreman BOOTIF=01-$mac
  initrdefi boot/fdi-image/initrd0.img
}

#16

Permissions:
-rw-r–r-- 1 foreman-proxy foreman-proxy 2777 Dec 11 08:54 grub.cfg-01-d4-be-d9-6d-88-84


#17

Last idea - grab grub2 from CentOS 7 and try with that (grubx64.efi).