Unable to register Debian based distros

Problem: Go into Foreman > Hosts > Register Host. Select OS (Ubuntu or Debian, in this case), select the activation key, and click Generate. Copy the curl command and run it as root on the host. Deb based systems are giving the error E: Unable to locate package subscription-manager
‘/etc/rhsm/rhsm.conf’ not found, cannot configure subscription-manager.

Running this on RHEL is working; the registration runs and the host shows up in the Foreman interface.

Expected outcome: In Foreman 3.4 when we were testing Foreman, this worked without issue and would register Ubuntu and Debian systems properly. Now that we have rebuilt Foreman on the latest version (3.10), it is giving the subscription-manager error.

Foreman and Proxy versions: Foreman 3.10

Foreman and Proxy plugin versions: Katello 4.12

Distribution and version:
Ubuntu 20, 22, and 24. Debian 11 and 12. LinuxMint 21

Other relevant data:

Hi there!

the Debian and Ubuntu Subscription Manager packages are provided by Atix on oss.atix.de

The fast way to register is also directly documented in their repo: Debian

But in full detail when wanting to register with the global host registration workflow it’s also documented on the Foreman docs page and even more detailed, downstream on the Orcharhino docs page

Hope that helps!


Thanks for that information on the Atix packages; I did find a post discussing that from a few years ago but was hoping that was an option, but not necessary. Is using the subscription manager from Atix the only or recommended way forward for the recent releases of Foreman?

What caused or necessitated the changes between 3.4 and 3.10 that it worked in 3.4 but no longer works in 3.10 out of the box on Debian based systems? The Atix packages are not required for registration on the Foreman 3.4 platform; I had a snapshot of that still and loaded that up, and can confirm registration worked on a clean out of the box Ubuntu install without the need for any additional installs or setup.

We liked that it worked out of the box previously, and we would rather not rely on a 3rd party solution to get it working on the majority of our systems (we’re about 95% Ubuntu machines) it possible.

I’m surprised it ever worked without an additional repo, because as far as I know Debian, Ubuntu and also OpenSUSE/SLE never shipped the subscription manager, which is already necessary to join machines to Katello (at least as long as I remember).

SLE packages once were built directly but the upstream project but that part got orphaned some time, and so Atix thankfully took over the task to build it themselves for their customers, but also putting it on the open web for everyone else.

And 3.4 isn’t even that far away, even the global registration docs already mention this path back then :thinking:
So yeah it has been already a long time like that, really don’t know how it could have worked back then without the repo from Atix.

Or, are you talking about configuration managed systems without managing the repo part?
That worked and still works without the extra repository.

I don’t need to manage repositories as I won’t be locally mirroring any repos.

It appears the script being curled from the Foreman server in 3.4 ended with if redhat-release file exists, run the register_katello_host function; else run the register_host function. If I added the if and else for that in the script that is downloaded for 3.10, I get farther and it runs the register_host function. I’m not the best programmer, but it seems the register_host function is still defined in the 3.10 script, but is not called upon. This may be a different default behavior in the Foreman settings itself between the versions that’s building that script that is curled.

If I add the repo and install the subscription-manager, it appears to be working.

1 Like

Okay now I see what’s going on, I actually never used a Foreman installation without the whole repo management part.

Indeed it looks like the new global host registration way does not allow hosts to just be registered without the content management.
Or this is my assumption would need to get out a new Foreman system without Katello installed to check.

Got it, it looks like we will use the ATIX subscription-manager package in that case. While we aren’t using Katello and the content management functions currently, we set up Foreman with it in case we wanted to use it in the future to not have to rebuild the setup if we chose to use it in the future. A case of have it and not need it instead of need it and not have it. :smiley:

The only thing now is that machines are registering but giving:
curl: (7) Failed to connect to FOREMAN-URL port 80 after 6 ms: Connection refused
Host [test-ubuntu22] successfully configured, but failed to set built status.

However, if I am reading docs and other posts correctly, this is primarily used for provisioning checks to phone back that the host provisioned and is ready for use; it is not crucial for already built hosts that are just being registered, and the built status should change on its own after about 4 hours after registration.

Looking a bit more, it looks like as soon as you install the Katello part, it requires you to configure that during the whole registration part (might be something to improve, hope you don’t mind if I tag you here Leos @lstejska ) :thinking:

There is also a deep dive video mentioned, which mentions this very briefly :slight_smile:

Hm yeah there is a phone home part in the host-init script but port 80 is a bit weird, as this normally runs all via 443.
Could be as you say it :slight_smile:

1 Like

In Settings > Provisioning, the Unattended URL defaults (or did for me) to http, which would cause it to use port 80. Changing it to https resolved that last issue, and likely changed it to using 443 as part of that. Although it’s not actually provisioning the host, it appears the config template that is downloaded as part of the registration pulls settings and config items from the Provisioning Settings.