Skip to content

UEFI PXE boot fails after upgrading to 1.5.10.2149 — HTTP-to-HTTPS redirect causes “Permission denied” with older iPXE binary #978

Description

@RogerioKoglin

UEFI PXE boot fails after upgrading to 1.5.10.2149 — HTTP-to-HTTPS redirect causes "Permission denied" with older iPXE binary

Summary

After upgrading FOG from 1.5.10.1903 to 1.5.10.2149, UEFI PXE boot stopped working on at least one client.

The binaries generated by the new installer did not boot correctly on the affected machine. After restoring the previous /tftpboot binaries, the client successfully loaded ipxe.efi, but iPXE failed when chaining to FOG with:

Permission denied

The issue was resolved only after restoring an Apache rewrite exception that allows /fog/service/ endpoints to remain accessible over HTTP.

I would like to understand whether this is:

  1. A bug or regression in FOG 1.5.10.2149;
  2. An incorrect DHCP/PXE configuration on my side;
  3. A compatibility limitation in the affected clients' UEFI firmware;
  4. Or an unsupported configuration because HTTPS is now expected for the entire iPXE flow.

Environment

  • FOG server type: Normal/Master server
  • Previous FOG version: 1.5.10.1903
  • Current FOG version: 1.5.10.2149
  • Previous database schema: 274
  • Current database schema: 277
  • Operating system: Debian GNU/Linux 13 (Trixie)
  • Kernel: 6.12.100+deb13-amd64
  • Apache: 2.4.68
  • PHP: 8.4, using PHP-FPM
  • MariaDB: 11.8.6
  • TFTP server: tftpd-hpa
  • DHCP server: External; FOG does not provide DHCP
  • FOG server address: <FOG_SERVER_IP>
  • FOG hostname: <FOG_HOSTNAME>
  • Network interface: bond0, 802.3ad/LACP with four 1 Gbps interfaces
  • Client boot mode: UEFI
  • DHCP boot file used for the affected client: ipxe.efi

The external DHCP server provides the FOG server address as the next server/option 66 and ipxe.efi as the UEFI boot filename/option 67.

Upgrade procedure

The server operating system was fully upgraded before updating FOG.

FOG was then upgraded from a clean checkout of the official stable branch:

Version: 1.5.10.2149
Schema: 277
Commit: df82a454981637c82ce84c869ee676947ba7c44a

The installer completed successfully, updated the database, rebuilt the iPXE binaries, and restarted all FOG services.

After the upgrade:

  • Apache was active;
  • MariaDB was active;
  • TFTP was active;
  • NFS was active;
  • All FOG services were active;
  • systemctl --failed reported no failed units;
  • ipxe.efi could be downloaded successfully over TFTP;
  • File and directory permissions were correct.

Initial behavior with the newly generated binaries

The installer rebuilt all PXE binaries. Their hashes changed compared with the pre-upgrade files, including:

  • ipxe.efi
  • snponly.efi
  • snp.efi
  • intel.efi
  • realtek.efi
  • undionly.kpxe

On the affected UEFI machine, the newly generated ipxe.efi did not complete the boot process. From the client's perspective, it appeared that ipxe.efi could not be loaded or executed correctly.

I restored /tftpboot from the backup created immediately before the upgrade.

The restored UEFI binary identifies itself as:

iPXE/1.21.1+ (g5de5d)

After restoring it, the client loaded iPXE but failed with:

Permission denied

TFTP and filesystem validation

The TFTP path and files had the following permissions:

drwxr-xr-x 755 fogproject:fogproject /tftpboot
-rw-r--r-- 644 fogproject:fogproject /tftpboot/ipxe.efi
-rw-r--r-- 644 fogproject:fogproject /tftpboot/default.ipxe

The following binaries were downloaded successfully through TFTP, and the downloaded hashes matched the files on disk:

ipxe.efi
snponly.efi
undionly.kpxe

Therefore, the Permission denied message was not caused by Unix permissions or TFTP access.

Certificate validation

I also restored and validated the pre-upgrade FOG certificates.

The following checks passed:

  • The FOG CA was valid;
  • The server certificate was signed by that CA;
  • The server certificate matched the private key;
  • The server IP address was present in the certificate SAN;
  • The FOG hostname was present in the certificate SAN;
  • The certificate was within its validity period;
  • A TLS connection using the FOG CA verified successfully;
  • Apache configuration validation returned Syntax OK.

Example:

openssl verify -CAfile ca.cert.pem srvpublic.crt
srvpublic.crt: OK

A curl request using the FOG CA, without disabling TLS verification, also succeeded.

Relevant default.ipxe behavior

The restored default.ipxe chains to FOG over HTTP:

#!ipxe
set arch ${buildarch}
params
param mac0 ${net0/mac}
param arch ${arch}
param platform ${platform}
param product ${product}
param manufacturer ${product}
param ipxever ${version}
param filename ${filename}
param sysuuid ${uuid}
chain http://<FOG_SERVER_IP>/fog/service/ipxe/boot.php##params

Apache behavior after the upgrade

After the upgrade, the port 80 virtual host contained:

RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
RewriteRule .* - [F]
RewriteRule /management/other/ca.cert.der$ - [L]
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}/$1 [R,L]

The affected client repeatedly produced this Apache access log entry:

<FOG_SERVER_IP>:80 <CLIENT_IP> - - "POST /fog/service/ipxe/boot.php HTTP/1.1" 302 ... "iPXE/1.21.1+ (g5de5d)"

There was no subsequent HTTPS request from that iPXE client.

From the client side, the result was:

Permission denied

Testing the same endpoint confirmed that Apache returned an HTTP 302 redirect:

POST http://<FOG_SERVER_IP>/fog/service/ipxe/boot.php
HTTP/1.1 302 Found
Location: https://<FOG_SERVER_IP>//fog/service/ipxe/boot.php

Notice that the generated redirect also contained a double slash before fog:

https://<FOG_SERVER_IP>//fog/service/ipxe/boot.php

I do not know whether the double slash is relevant to iPXE, but it may be worth checking.

Pre-upgrade Apache configuration

Before the upgrade, the port 80 virtual host had an additional condition:

RewriteCond %{REQUEST_URI} !^/fog/service/
RewriteCond %{HTTPS} off
RewriteRule ^/?(.*)$ https://%{HTTP_HOST}/$1 [R,L]

This prevented requests under /fog/service/ from being redirected to HTTPS.

The FOG installer replaced the virtual host and removed that condition.

Workaround

Restoring the pre-upgrade rewrite condition resolved the problem:

RewriteCond %{REQUEST_URI} !^/fog/service/
RewriteCond %{HTTPS} off
RewriteRule ^/?(.*)$ https://%{HTTP_HOST}/$1 [R,L]

After reloading Apache, the same iPXE request returned:

HTTP/1.1 200 OK

The response began correctly with:

#!ipxe
set fog-ip <FOG_SERVER_IP>
set fog-webroot fog

The client then booted successfully.

The FOG management interface remains available over HTTPS.

Questions

  1. Is redirecting /fog/service/ipxe/boot.php from HTTP to HTTPS the intended behavior in FOG 1.5.10.2149?

  2. Should the current stable installer preserve or generate an HTTP exception for /fog/service/ or /fog/service/ipxe/?

  3. Is an older iPXE build such as iPXE/1.21.1+ (g5de5d) expected to follow this HTTP-to-HTTPS redirect?

  4. Does FOG now require clients to use only the newly generated iPXE 2.x binaries for HTTPS boot?

  5. For UEFI clients, should external DHCP provide ipxe.efi, snponly.efi, or another binary?

  6. Could this indicate a UEFI compatibility problem with the newly generated ipxe.efi rather than an Apache configuration problem?

  7. Should the redirect rule use the following form to avoid the double slash?

    RewriteRule ^/?(.*)$ https://%{HTTP_HOST}/$1 [R,L]

    Instead of:

    RewriteRule (.*) https://%{HTTP_HOST}/$1 [R,L]
  8. Is excluding the entire /fog/service/ path from HTTPS redirection considered safe and supported, or should the exception be limited to /fog/service/ipxe/?

Additional observation

Before restoring the old binaries, Apache recorded successful HTTPS requests from the newer iPXE build:

iPXE/2.0.0+ (g766fa)
POST /fog/service/ipxe/boot.php HTTP/1.1 200
GET /fog/service/ipxe/bg.png HTTP/1.1 200

This suggests that the newer binary can use HTTPS successfully, while the older 1.21.1 binary fails after the HTTP redirect.

However, the newer ipxe.efi did not boot correctly on the affected UEFI client, which is why I restored the older binary.

I can provide packet captures, complete Apache virtual host files, iPXE screenshots, and hashes of the generated binaries if needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions