UEFI: Grub fails to download the kernel through HTTP but prints "error: ../../grub-core/net/efi/http.c:297:Fail to receive a response!" message

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux 7 and later
    • HTTP Boot
    • UEFI

Issue

  • On UEFI systems, booting through HTTP fails with the following error if the Grub timeout is changed from 5 seconds to a larger value

    error: ../../grub-core/net/efi/http.c:297:Fail to receive a response! status=105.
    error: ../../grub-core/loader/i386/efi/linux.c:333:invalid magic number.
    error: ../../grub-core/loader/i386/efi/linux.c:207:you need to load the kernel first.
    

Resolution

HTTP 1.1 with Keep alive needs to be configured on the HTTP server side.

If the HTTP server is Apache, the following stanzas need to be added in the HTTP server configuration file:

KeepAlive On
KeepAliveTimeout 600

Then the HTTP server restarted for changes to take effect.

Root Cause

The issue is expected, it's due to the HTTP connection initially opened by the EFI firmware to not be usable anymore, due to timeout.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.