Curl url malformed during initrd and vmlinux tftp copy

Problem:
The TFTP copying of vmlinux and initrd fails with . Target URL is validated muliple times with curl and wget manually, so the file is really downloadable. The source is an extracted OL8full ISO to /var/www/html/pub on the same foreman/katello host. Please see attached LOG File.

Expected outcome:
vmlinux and initrd are put into /var/lib/tftp/boot

Foreman and Proxy versions:
Foreman: 3.5.2
Katello: 4.7.3

Foreman and Proxy plugin versions:

Distribution and version:
OracleLinux 8.7

Other relevant data:

/var/log/foreman-proxy/proxy.log

2023-03-20T09:19:01 3543f6af [I] Finished POST /tftp/fetch_boot_file with 200 (0.67 ms)
2023-03-20T09:19:01 3543f6af [I] [1164514] Started task /usr/bin/curl\ --silent\ --show-error\ --connect-timeout\ 10\ --retry\ 3\ --retry-delay\ 10\ --max-time\ 3600\ --remote-time\ --time-cond\ file\ /var/lib/tftpboot/boot/oraclelinux-8-iso-local-7jET8gzdRF9B-vmlinuz\ --write-out\ Task\ done,\ result:\ \%\{http_code\},\ size\ downloaded:\ \%\{size_download\}b,\ speed:\ \%\{speed_download\}b/s,\ time:\ \%\{time_total\}ms\ --output\ /var/lib/tftpboot/boot/oraclelinux-8-iso-local-7jET8gzdRF9B-vmlinuz\ --location\ http://katello.test.tools/pub/OracleLinux8_ISO/BaseOS/images/pxeboot/vmlinuz
2023-03-20T09:19:01 3543f6af [I] Started POST /tftp/fetch_boot_file
2023-03-20T09:19:01 3543f6af [I] Finished POST /tftp/fetch_boot_file with 200 (1.68 ms)
2023-03-20T09:19:01 3543f6af [I] [1164518] Started task /usr/bin/curl\ --silent\ --show-error\ --connect-timeout\ 10\ --retry\ 3\ --retry-delay\ 10\ --max-time\ 3600\ --remote-time\ --time-cond\ file\ /var/lib/tftpboot/boot/oraclelinux-8-iso-local-7jET8gzdRF9B-initrd.img\ --write-out\ Task\ done,\ result:\ \%\{http_code\},\ size\ downloaded:\ \%\{size_download\}b,\ speed:\ \%\{speed_download\}b/s,\ time:\ \%\{time_total\}ms\ --output\ /var/lib/tftpboot/boot/oraclelinux-8-iso-local-7jET8gzdRF9B-initrd.img\ --location\ http://katello.test.tools/pub/OracleLinux8_ISO/BaseOS/images/pxeboot/initrd.img
2023-03-20T09:19:01 3543f6af [W] [1164514] curl: (3) <url> malformed
2023-03-20T09:19:02 3543f6af [W] [1164518] curl: (3) <url> malformed

had the same on rhel87 and reverted this one;

1 Like

I am a bit confused, according to the bugtracker the “file” segment in --time-cond is missing, but its there. Fixed version should be 3.5.2 which is mine too.
Even if i delete the files in /var/lib/tftp/boot they are not downloaded again.
Not sure if thats really related.

try your curl from the proxy.log manually and see what happens

/usr/bin/curl --silent --show-error --connect-timeout 10 --retry 3 --retry-delay 10 --max-time 3600 --remote-time --time-cond file /var/lib/tftpboot/boot/oraclelinux-8-iso-local-7jET8gzdRF9B-initrd.img --output /var/lib/tftpboot/boot/oraclelinux-8-iso-local-7jET8gzdRF9B-initrd.img --location http://katello.test.tools/pub/OracleLinux8_ISO/BaseOS/images/pxeboot/initrd.img
curl: (3) <url> malformed

no surprise here

and now try with removing the file option from --time-cond…

ah you reverted the fix. sorry misread that in the first place.
seems they introduced a new bug you are correct thanks.

are they aware already? if not i open a new issue there

Don’t think so.

Revert fix: Fixes #36209 - tftp initrd/vmlinux generation: curl malformed by stejskalleos · Pull Request #861 · theforeman/smart-proxy · GitHub