After upgrading to Foreman 3.1.2 and Katello 4.3 from Foreman 2.5.2, the Smart Proxies cannot find host groups via the API when registering a host.
Successful registration via bootstrap.py script
Foreman and Proxy versions:
Foreman 3.1.2 and Katello 4.3.0-1
Foreman and Proxy plugin versions:
Foreman Proxy 3.1.2-1
Distribution and version:
Other relevant data:
When registering via the bootstrap.py script, we get a 404 Not Found error back
An error occurred: HTTP Error 404: Not Found
error: HTTP Error 404: Not Found
But if I try to use curl to query the Foreman server directly, I get a proper response. However when querying any of my Smart Proxies, I get the 404 Not Found error.
March 15, 2022, 8:01am
Can you try editing
/etc/rhsm/rhsm.conf and setting
We have recently consolidated ports a bit, and this might be fallout from this.
March 15, 2022, 11:00am
Okay, I can reproduce this on latest nightly.
The change in
Fixes #33863 - Allow registration through content proxy via port 443 · theforeman/puppet-foreman_proxy_content@76e2a68 · GitHub did set
443 unconditionally, which is fine for RHSM, as the same commit also configures a reverse proxy on
smartproxy:443/rhsm to map to
However, this breaks bootstrap as it expects (wrongfully, but it does) to be able to talk the the API on the same port as RHSM (which isn’t true anymore):
"""Helper function to get the server port from Subscription Manager."""
configparser = SafeConfigParser()
return configparser.get('server', 'port')
except: # noqa: E722, pylint:disable=bare-except
I’m glad I’m not going completely mental trying to figure out what’s going on.
Whenever I change the port = 443 to port = 8443 in /etc/rhsm/rhsm.conf though, something in the bootstrap.py process switches it back to 443 (I’m guessing the installation of the SSL certificate from the smart proxy) and I still run into the 404 Error.
March 16, 2022, 7:44am
Right… Well, then I am afraid you just got promoted to be my guinea pig to test some auto-detection code in bootstrap.py
I’ll try to cook up a patch later today and post here for you to test.
March 16, 2022, 9:12am
@evgeni I deployed the updated bootstrap.py to a test server which I then used to register against my Foreman 3.1.x Smart Proxy. I first tested with the “old” bootstrap.py script just to make sure the 404 Error is still present, which it was.
I then used the updated bootstrap.py script that I pulled down off GitHub and ran it with the same options as the previous failed attempt and it went fully through the registration process for the host, so your changes look good.
March 17, 2022, 8:42am
Thanks, merged the PR and released a 1.7.8.
Packaging for nightly is at
Release katello-client-bootstrap 1.7.8 by evgeni · Pull Request #7722 · theforeman/foreman-packaging · GitHub and once merged I’ll make sure to backport it to older, supported Katello releases.