Subscription-manager repos fails with JSON error

Problem:
Running subscription-manager repos returns no repositories, even though they are set up in Foreman:

# subscription-manager repos
This system has no repositories available through subscriptions.

The system is registered and has active subscriptions. /var/log/rhsm/rhsm.log shows the following error:

NoneType: None
2022-11-01 13:22:56,635 [ERROR] subscription-manager:1639974:MainThread @azure.py:145 - Unable to decode Azure API versions: the JSON object must be str, bytes or bytearray, not 'NoneType'
2022-11-01 13:22:57,547 [WARNING] subscription-manager:1639974:MainThread @dmiinfo.py:130 - Error reading system DMI information: # SMBIOS implementations newer than version 2.7 are not
# fully supported by this version of dmidecode.

I’m not sure how to interpret this or what to do with the information.

Expected outcome:

subscription-manager repos show enabled repositories.

Foreman and Proxy versions:

Foreman 3.2.1

Foreman and Proxy plugin versions:

Distribution and version:

Foreman server: CentOS 7.9
Client: Alma Linux 8.6

Hi @guertin

Which version of subscription-manager is installed on the client? I can send the error to the team that manages that package once I hear back from you.

This is subscription-manager 1.28.29 running on Alma Linux 8.6. We have many Alma 8 clients with the same version, and they all show the same behavior.

Interestingly, we also have a bunch of CentOS 7 clients running subscription-manager 1.24.51 that also report This system has no repositories available through subscriptions, but they do not show any errors in /var/log/rhsm/rhsm.log, so perhaps the error is unrelated to the problem of repositories not showing up.