Subscription-manager installation via Cockpit attempts to activate RedHat subscription

If you connect to your Rocky 9 system via the Cockpit web interface, there is an option under the Applications tab to install “Subscription Manager in Cockpit”. If you do this, it might make your system think that it needs to be registered with a RedHat subscription. After that, dnf updates may fail with the following error:

Unable to read consumer identity

This system is not registered with an entitlement server. You can use subscription-manager to register.

Of course, you don’t need a subscription to run Rocky 9. It seems like a bug that Cockpit assumes that you need a subscription. To un-do this screw-up, edit the following file and change “enabled=1” to “enabled=0”:

/etc/dnf/plugins/subscription-manager.conf

Reboot after? Maybe. To prevent it from happening again, enter the following configuration change:

subscription-manager config --rhsm.auto_enable_yum_plugins=0

Also, REMOVE subscription-manager from your Cockpit application plugins.

This may answer several previous questions that have already been closed due to inactivity.

When installing the subscription manager cockpit plugin, I see this as expected:

image

Including the subscriptions page after installation.

Installing this brings in subscription-manager and subscription-manager-cockpit, the latter being needed to interact with the former.

However, installing subscription-manager has it disabled by default.

The behavior you’re describing is not typical so I’m curious as to the configuration of this system and the versions of packages it is running, as we patch subscription-manager to be disabled by default.

Thank you for your reply.

My versions are the same as yours.

I wonder what your subscription-manager config contains.

Here is mine. Note that I have set auto_enable_yum_plugins = 0, which prevents the problem from occurring. If the value is inside square brackets, then it’s the default. Note that mine is NOT, meaning I set the value myself.

root@JB-Rocky9 [ ~ ]

# subscription-manager config
[server]
   hostname = [subscription.rhsm.redhat.com]
   insecure = [0]
   no_proxy = []
   port = [443]
   prefix = [/subscription]
   proxy_hostname = []
   proxy_password = []
   proxy_port = []
   proxy_scheme = [http]
   proxy_user = []
   server_timeout = [180]

[rhsm]
   auto_enable_yum_plugins = 0
   baseurl = [https://cdn.redhat.com]
   ca_cert_dir = [/etc/rhsm/ca/]
   consumercertdir = [/etc/pki/consumer]
   entitlementcertdir = [/etc/pki/entitlement]
   full_refresh_on_yum = [0]
   inotify = [1]
   manage_repos = [1]
   package_profile_on_trans = [0]
   pluginconfdir = [/etc/rhsm/pluginconf.d]
   plugindir = [/usr/share/rhsm-plugins]
   productcertdir = [/etc/pki/product]
   progress_messages = [1]
   repo_ca_cert = /etc/rhsm/ca/redhat-uep.pem
   repomd_gpg_url = []
   report_package_profile = [1]

[rhsmcertd]
   auto_registration = [0]
   auto_registration_identity_interval = [10]
   auto_registration_interval = [1]
   autoattachinterval = [1440]
   certcheckinterval = [240]
   disable = [0]
   splay = [1]

[logging]
   default_log_level = [INFO]

[] - Default value in use

I am sorry that I could not tell you what the value was prior to me ignorantly clicking on the subscription-manager “install” button in Cockpit. Nevertheless, there are a lot of “rhsm” (RedHat) links in the config file, and perhaps the ported subscription-manager in the appstream should nullify those, as well as make sure that the auto_enable_yum_plugins is set to 0.

If my config file is an anomaly, then something strange crawled into my system without my awareness.

Something strange – I browsed two prior backups, and subscription-manager did not exist on either one. ie, the directory /etc/rhsm did not exist, but it does now. (note - that directory contains the configuration file for subscription-manager.) Thus I assume that it was created after clicking the subscription-manager install button in Cockpit. Therefore, I think it might be safe to simply uninstall subscription manager and never touch the Install button in Cockpit again.

# dnf erase subscription-manager
Dependencies resolved.
======================================================================================================================================
 Package                                   Architecture        Version                                     Repository            Size
======================================================================================================================================
Removing:
 subscription-manager                      x86_64              1.29.47.1-1.el9_7.rocky.0.1                 @baseos              3.4 M
Removing dependent packages:
 subscription-manager-cockpit              noarch              6-2.el9.rocky.0.1                           @baseos              1.2 M

Transaction Summary
======================================================================================================================================
Remove  2 Packages

Freed space: 4.6 M
Is this ok [y/N]: y
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                              1/1
  Erasing          : subscription-manager-cockpit-6-2.el9.rocky.0.1.noarch                                                        1/2
  Running scriptlet: subscription-manager-1.29.47.1-1.el9_7.rocky.0.1.x86_64                                                      2/2
Removed "/etc/systemd/system/multi-user.target.wants/rhsmcertd.service".

  Erasing          : subscription-manager-1.29.47.1-1.el9_7.rocky.0.1.x86_64                                                      2/2
warning: /etc/rhsm/rhsm.conf saved as /etc/rhsm/rhsm.conf.rpmsave
warning: /etc/dnf/plugins/subscription-manager.conf saved as /etc/dnf/plugins/subscription-manager.conf.rpmsave

  Running scriptlet: subscription-manager-1.29.47.1-1.el9_7.rocky.0.1.x86_64                                                      2/2
  Verifying        : subscription-manager-1.29.47.1-1.el9_7.rocky.0.1.x86_64                                                      1/2
  Verifying        : subscription-manager-cockpit-6-2.el9.rocky.0.1.noarch                                                        2/2

Removed:
  subscription-manager-1.29.47.1-1.el9_7.rocky.0.1.x86_64            subscription-manager-cockpit-6-2.el9.rocky.0.1.noarch

Complete!

Now the config file simply exists as /etc/rhsm/rhsm.conf.rpmsave, which is the vestigial remains of its once-active existence.

If this causes any issues I will post again. :exploding_head:

Not of mere existence, but to retain the “custom edits” you did to /etc/rhsm/rhsm.conf


dnf provides /etc/rhsm/rhsm.conf should list the package(s) that owns that file.

dnf history list subscription-manager does tell when (in which transactions) you got/updated/removed that package.