Unable to Download Bootdisk for Specific host

Problem:
We are not able to download the host based full image to provision the server.
Below are foreman version installed in my foreman server.

i have tried using API to download but i got below error.

ERF42-1542 [Foreman::Exception]: Unable to download boot file with HTTP return code 400

But in hammer command im not getting subcommand options --host in CLI. Please let me know if i have missed to enable any plugin or any configuration.

Package List

tfm-rubygem-hammer_cli_foreman_tasks-0.0.13-1.fm1_22.el7.noarch
tfm-rubygem-hammer_cli_foreman_docker-0.0.4-4.el7.noarch
tfm-rubygem-hammer_cli_foreman_bootdisk-0.3.0-1.el7.noarch
tfm-rubygem-hammer_cli_foreman-0.19.6-1.el7.noarch
tfm-rubygem-foreman-tasks-core-0.3.3-1.fm1_24.el7.noarch
tfm-rubygem-foreman-tasks-0.17.5-1.fm1_24.el7.noarch
tfm-rubygem-foreman_docker-5.0.0-2.fm1_22.el7.noarch
tfm-rubygem-foreman_bootdisk-16.0.0-1.fm1_24.el7.noarch
rubygem-foreman_maintain-0.5.1-1.el7.noarch
foreman-selinux-1.24.2-1.el7.noarch
foreman-release-1.24.2-1.el7.noarch
foreman-proxy-1.24.2-1.el7.noarch
foreman-postgresql-1.24.2-1.el7.noarch
foreman-installer-katello-1.24.2-1.el7.noarch
foreman-installer-1.24.2-1.el7.noarch
foreman-debug-1.24.2-1.el7.noarch
foreman-cli-1.24.2-1.el7.noarch
foreman-1.24.2-1.el7.noarch
foreman-proxy-1.24.2-1.el7.noarch

Expected outcome:
Subcommand --host should be enabled to download the host image.
Please let me know if i have follow any type instruction.
Foreman and Proxy versions:

1.24.2

foreman-1.24.2-1.el7.noarch
foreman-proxy-1.24.2-1.el7.noarch

Foreman and Proxy plugin versions:
1.24.2

foreman-1.24.2-1.el7.noarch
foreman-proxy-1.24.2-1.el7.noarch

Distribution and version:

CentOS 7

Other relevant data:

OUTPUT

Usage:
hammer bootdisk host [OPTIONS]

Options:
–file PATH File or device to write image to
–force Force writing to existing destination (device etc.)
–sudo Use sudo to write to device
-h, --help Print help

Helo and welcome, you need to investigate production.log and paste the error from there.

I seeing the below errors in production.log.

2020-05-27T16:13:31 [W|app|8dfea81c] Action failed
2020-05-27T16:13:31 [I|app|8dfea81c] Rendering common/500.html.erb within layouts/application
2020-05-27T16:13:31 [I|app|8dfea81c] Rendered common/500.html.erb within layouts/application (2.6ms)
2020-05-27T16:13:31 [I|app|8dfea81c] Rendered layouts/_application_content.html.erb (0.9ms)
2020-05-27T16:13:31 [I|app|8dfea81c] Rendering layouts/base.html.erb
2020-05-27T16:13:31 [I|app|8dfea81c] Rendered layouts/base.html.erb (2.6ms)
2020-05-27T16:13:31 [I|app|8dfea81c] Completed 500 Internal Server Error in 341ms (Views: 10.5ms | ActiveRecord: 81.2ms)

Please let me know if you are looking for any specific details from the server. Above message was generated when i was trying to download the image.

Can you enable debug and pastebin more info? Please format it properly.

Can you please guide me how to enable debug in foreman to troubleshoot. As Im new to the community can share formatting guide

https://theforeman.org/manuals/2.0/index.html#7.2Debugging

Markdown is used here so you can use https://www.markdownguide.org/basic-syntax#code-blocks though I’d strongly recommend the fenced style since you don’t need to indent. This makes it much easier to read.

I encounter the same error. I used tcpdump to capture the http request and this is the error message from the remote repo web server:
…mv…HTTP/1.1 400 Bad Request
Server: nginx/1.22.0
Date: Fri, 26 Aug 2022 09:37:30 GMT
Content-Type: text/html
Content-Length: 255
Connection: close

400 The plain HTTP request was sent to HTTPS port

400 Bad Request

The plain HTTP request was sent to HTTPS port
nginx/1.22.0

[myuser@foreman1 ~]$ sudo foreman-rake errors:fetch_log request_id=9d1eb70a
2022-08-26T09:24:33 [I|app|9d1eb70a] Started GET “/bootdisk/disks/full_hosts/scctermv01.info.austrocontrol.at” for 172.31.248.68 at 2022-08-26 09:24:33 +0000
2022-08-26T09:24:33 [I|app|9d1eb70a] Processing by ForemanBootdisk::DisksController#full_host as HTML
2022-08-26T09:24:33 [I|app|9d1eb70a] Parameters: {“id”=>“scctermv01.info.austrocontrol.at”}
2022-08-26T09:24:34 [I|for|9d1eb70a] Fetching https://mirror.karneval.cz/pub/linux/almalinux/9/BaseOS/x86_64/kickstart/images/pxeboot/vmlinuz
2022-08-26T09:24:34 [W|app|9d1eb70a] ERF42-4039 [Foreman::Exception]: Unable to download boot file https://mirror.karneval.cz/pub/linux/almalinux/9/BaseOS/x86_64/kickstart/images/pxeboot/vmlinuz, HTTP return code 400
2022-08-26T09:24:34 [I|app|9d1eb70a] Backtrace for ‘ERF42-4039 [Foreman::Exception]: Unable to download boot file https://mirror.karneval.cz/pub/linux/almalinux/9/BaseOS/x86_64/kickstart/images/pxeboot/vmlinuz, HTTP return code 400’ error (Foreman::Exception): ERF42-4039 [Foreman::Exception]: Unable to download boot file https://mirror.karneval.cz/pub/linux/almalinux/9/BaseOS/x86_64/kickstart/images/pxeboot/vmlinuz, HTTP return code 400
9d1eb70a | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_bootdisk-17.1.0/app/services/foreman_bootdisk/iso_generator.rb:237:in `block (3 levels) in fetch’

Workaround:
use http:// instead of https:// in the Url of the “Installation Media” associated to the OS used by the host.

1 Like