-
-
Notifications
You must be signed in to change notification settings - Fork 648
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cobbler sync error when distro kernel value is an HTTP url without an IP address #3664
Comments
The line in |
I think the change that is causing the issue is in tftpgen.py on line 777, which was introduced in a pull request a few months ago. In 3.3.3 the kernel path was just taken as is, and in 3.3.4 an additional check was added and the call to the parse_grub_remote_file function. |
@rdswett it would be cool if you could link the PR. In any case I will see what I can do about your bug in the coming weeks. |
Git claims it is this one #3477, thanks for looking into it! |
@tpw56j if you have the time I would be thrilled if you could take a look at this bug. |
I tested.
Correct grub menu with loading via http:
But using the hostname does result in an error:
Maybe we should remove the IP address check in grub.py? |
Hm... I am not 100% sure if that is the right way as we rebuild the URL for remote boot purposes. As such having a valid hostname or IP is desirable in my eyes. |
Describe the bug
Generating a grub boot menu with a kernel set to an http path with a hostname causes an error.
When updating to version 3.3.4 from 3.3.3, cobbler sync started throwing errors about invalid remote file formats, and will no longer generate a grub menu if the kernel value of a defined distro is set to an http URL with a hostname instead of an IP address. A hostname is valid in grub, assuming your DHCP server provides a nameserver to the client.
This seems intentional as parse_grub_remote_file in grub.py uses netaddr.valid_ipv4() and valid_ipv6().
Steps to reproduce
Expected behavior
Cobbler sync should work and a valid grub menu should be produced and made available for PXE clients
Cobbler version
Cobbler 3.3.4
source: ?, ?
build time: Mon Feb 26 00:00:00 2024
This is the version from EPEL for el9
Operating system
Rocky 9
Cobbler log
The system is air gapped from the network but the stack trace in cobbler.log is essentially:
tftpgen.py line 640
tftpgen.py line 778
grub.py line 33
Raises ValueError("Invalid remote file format %s\n is not a valid IP address" % (file_location, server))
Screenshots
N/A
Additional information
In this environment we locally mirror Rocky 9 repos and host them with an Apache HTTP server that uses a virtual host to serve out repos. This HTTP server has several functions and due to the way httpd configs are loaded, putting an IP address in the cobbler config doesn't work. There are, of course, work arounds to get the repos served off the IP address but this seems like a regression as it was working with the most previous version of cobbler and broke when we updated to 3.3.4
The text was updated successfully, but these errors were encountered: