We are running Foreman 3.19.1 / Katello 4.21.0 with RHEL hosts. We do not use Foreman provisioning facilities, but register existing hosts with Foreman.
We are encountering an issue when attempting to re-register an already registered host using the standard curl | bash command generated via the Foreman Web UI (Hosts β Register Host).
The initial registration of a previously unknown host works perfectly. However, running the registration command a second time on the same host fails at the very final step when reporting the build status to the /unattended/built endpoint with a 404 error.
Registration Command Used
curl 'https://smartproxy.query.local.consul.example.com:9090/register?activation_keys=rhel9-dev&download_utility=curl&force=true&location_id=3&organization_id=1&update_packages=false' \
--header 'Authorization: Bearer <TOKEN>' | bash
The following error can be seen in /var/log/foreman/production.log:
2026-08-16T21:46:18 [I|app|0d492957] Started GET "/unattended/built?token=[redacted]&url=http%3A%2F%2Fsmartproxy1.example.com%3A8000" for 192.168.0.3 at 2026-08-16 21:46:18 +0300
2026-08-16T21:46:18 [I|app|0d492957] Processing by UnattendedController#built as TEXT
2026-08-16T21:46:18 [I|app|0d492957] Parameters: {"token"=>"[redacted]", "url"=>"http://smartproxy1.example.com:8000", "unattended"=>{}}
2026-08-16T21:46:18 [E|app|0d492957] unattended: unable to find a host that matches the request from 192.168.0.3. Search paths: token: [redacted]
2026-08-16T21:46:18 [I|app|0d492957] Rendered text template (Duration: 0.0ms | Allocations: 2)
2026-08-16T21:46:18 [I|app|0d492957] Completed 404 Not Found in 11ms (Views: 2.9ms | ActiveRecord: 3.1ms | Allocations: 2792)
Tracing back a second earlier revealed that it cannot enter a build state.
2026-08-16T21:46:17 [I|app|62b051d1] Started POST "/register?url=https%3A%2F%2Fsmartproxy.query.local.consul.example.com%3A9090" for
192.168.0.3 at 2026-08-16 21:46:17 +0300
2026-08-16T21:46:17 [I|app|62b051d1] Processing by Api::V2::RegistrationController#host as HTML
2026-08-16T21:46:17 [I|app|62b051d1] Parameters: {"uuid"=>"f16f901d-878c-4973-a0e2-39fe9b4f8bfa", "host"=>{"build"=>"false", "organization_id
"=>"1", "location_id"=>"3"}, "update_packages"=>"false", "url"=>"https://smartproxy.query.local.consul.example.com:9090"}
2026-08-16T21:46:17 [I|app|62b051d1] Authorized user admin(Admin User)
2026-08-16T21:46:17 [I|aud|62b051d1] Parameter (371) destroy event on name host_update_packages
2026-08-16T21:46:17 [I|aud|62b051d1] Parameter (371) destroy event on value false
2026-08-16T21:46:17 [I|aud|62b051d1] Parameter (371) destroy event on reference_id 343
2026-08-16T21:46:17 [I|aud|62b051d1] Parameter (371) destroy event on hidden_value false
2026-08-16T21:46:17 [I|aud|62b051d1] Parameter (371) destroy event on key_type boolean
2026-08-16T21:46:17 [I|aud|62b051d1] Parameter (372) create event on name host_update_packages
2026-08-16T21:46:17 [I|aud|62b051d1] Parameter (372) create event on value false
2026-08-16T21:46:17 [I|aud|62b051d1] Parameter (372) create event on reference_id 343
2026-08-16T21:46:17 [I|aud|62b051d1] Parameter (372) create event on hidden_value false
2026-08-16T21:46:17 [I|aud|62b051d1] Parameter (372) create event on key_type boolean
2026-08-16T21:46:17 [W|app|62b051d1] Not queueing Host::Managed: ["Host parameters is invalid"]
2026-08-16T21:46:17 [W|app|62b051d1] Not queueing Host::Managed: ["Host parameters is invalid"]
2026-08-16T21:46:17 [W|app|62b051d1] Not queueing Host::Managed: ["Host parameters is invalid"]
2026-08-16T21:46:17 [W|app|62b051d1] Set build failed: #<ActiveModel::Errors [#<ActiveModel::Error attribute=host_parameters, type=invalid, opt
ions={:value=>#<ActiveRecord::Associations::CollectionProxy [#<HostParameter id: 371, name: "host_update_packages", value: [FILTERED], referenc
e_id: 343, created_at: "2026-08-16 18:45:49.792499000 +0000", updated_at: "2026-08-16 18:45:49.792499000 +0000", type: "HostParameter", priorit
y: 70, hidden_value: [FILTERED], key_type: "boolean", searchable_value: [FILTERED]>]>}>]>
It attempts to destroy and recreate the host_update_packages boolean parameter, and then complains that this parameter is invalid.
Workarounds Found
We can successfully re-register the host if we do either of the following:
-
Manually delete the
host_update_packagesparameter from the host in the Foreman UI before running the command. -
Manually strip out the
&update_packages=falseargument from the generatedcurlURL.
Because the Foreman UI automatically appends the &update_packages argument to the generated registration string by default, this effectively breaks re-registration out-of-the-box for existing hosts.
Is this a known bug, or is there a configuration adjustment we are missing?