RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1771921 - Package profiles sends too early when registering a client
Summary: Package profiles sends too early when registering a client
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: subscription-manager
Version: 7.7
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: William Poteat
QA Contact: Red Hat subscription-manager QE Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-11-13 09:09 UTC by Hao Chang Yu
Modified: 2020-09-29 19:23 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-09-29 19:22:47 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github candlepin subscription-manager pull 2251 0 None closed 1771921: Package profiles sends too early when registering a client 2021-02-17 04:49:21 UTC
Red Hat Product Errata RHBA-2020:3866 0 None None None 2020-09-29 19:23:17 UTC

Description Hao Chang Yu 2019-11-13 09:09:25 UTC
Description of problem:
When registering a client with an activation key, subscription manager sends the combined profiles before attaching the subscriptions and enable repositories. This is causing Satellite unable to calculate the applicable errata correctly because Satellite thought that no repositories are bound to the client.


Steps to Reproduce:
1. Register a host with an activation key.

# subscription-manager register --org="redhat" --activationkey="my_key"

2. Check the redhat.repo. to confirm 1 repository is already enabled.

# grep -rin "enabled = 1" /etc/yum.repos.d/redhat.repo 
91:enabled = 1


3. Check the "/var/lib/rhsm/cache/profile.json" and notice that "enabled_repos" list is empty.

{"enabled_repos": [], "modulemd": [], "rpm": [{"vendor": "Red Hat, Inc.", "name": "python-firewall", "epoch": 0, "version": "0.5.3", "release": "5.el7", "arch": "noarch"}


4. Run the following command which will re-upload the profile correctly.

# subscription-manager repos --list


5. Check the "profile.json" file again and notice that the enabled repos are uploaded by now.

{"enabled_repos": [{"baseurl": ["https://hao-satellite64.usersys.redhat.com/pulp/repos/redhat/Library/content/dist/rhel/server/7/7Server/x86_64/os"], "repositoryid": "rhel-7-server-rpms"}], "modulemd": [], "rpm": [{"vendor": "Red Hat, Inc.", "name": "python-firewall", "epoch": 0, "version": "0.5.3", "release": "5.el7", "arch": "noarch"}


Actual results:
enabled repos not uploaded

Expected results:
enabled repos is uploaded

Comment 13 Craig Donnelly 2020-06-02 11:10:33 UTC
>>> Verifying against: subscription-manager-1.24.38-1.el7 with backend Satellite 6.6.

> Showing the failure:

[root@dhcp-13-226-235 ~]# rpm -q subscription-manager
subscription-manager-1.24.23-1.el7.x86_64

[root@dhcp-13-226-235 ~]# subscription-manager register --org Red_Hat --activationkey rhel7
The system has been registered with ID: ff9af5a7-913e-4d8b-b736-264eb32c1989
The registered system name is: dhcp-13-226-235.ml17.lab.eng.rdu.redhat.com
Installed Product Current Status:
Product Name: Red Hat Enterprise Linux Server
Status:       Subscribed

[root@dhcp-13-226-235 ~]# grep -rin "enabled = 1" /etc/yum.repos.d/redhat.repo 
22:enabled = 1

[root@dhcp-13-226-235 ~]# cat /var/lib/rhsm/cache/profile.json
{"enabled_repos": [], "modulemd": [], "rpm": [{"vendor": "Red Hat, Inc."<SNIP>
>>>>>>>>>>>>>>>>> ^^

>>> Updating sub-man:

> Showing cache not present
[root@dhcp-13-226-235 yum.repos.d]# head -c 50 /var/lib/rhsm/cache/profile.json
head: cannot open ‘/var/lib/rhsm/cache/profile.json’ for reading: No such file or directory

[root@dhcp-13-226-235 yum.repos.d]# yum update subscription-manager
Loaded plugins: product-id, search-disabled-repos, subscription-manager

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


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

Resolving Dependencies
--> Running transaction check
---> Package subscription-manager.x86_64 0:1.24.23-1.el7 will be updated
---> Package subscription-manager.x86_64 0:1.24.38-1.el7 will be an update
--> Processing Dependency: subscription-manager-rhsm = 1.24.38 for package: subscription-manager-1.24.38-1.el7.x86_64
--> Running transaction check
---> Package subscription-manager-rhsm.x86_64 0:1.24.23-1.el7 will be updated
---> Package subscription-manager-rhsm.x86_64 0:1.24.38-1.el7 will be an update
--> Processing Dependency: subscription-manager-rhsm-certificates = 1.24.38-1.el7 for package: subscription-manager-rhsm-1.24.38-1.el7.x86_64
--> Running transaction check
---> Package subscription-manager-rhsm-certificates.x86_64 0:1.24.23-1.el7 will be updated
---> Package subscription-manager-rhsm-certificates.x86_64 0:1.24.38-1.el7 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================================================================
 Package                                  Arch     Version            Repository                                           Size
================================================================================================================================
Updating:
 subscription-manager                     x86_64   1.24.38-1.el7      brew-task-repo-subscription-manager-1.24.38-1.el7   1.1 M
Updating for dependencies:
 subscription-manager-rhsm                x86_64   1.24.38-1.el7      brew-task-repo-subscription-manager-1.24.38-1.el7   330 k
 subscription-manager-rhsm-certificates   x86_64   1.24.38-1.el7      brew-task-repo-subscription-manager-1.24.38-1.el7   239 k

Transaction Summary
================================================================================================================================
Upgrade  1 Package (+2 Dependent packages)

Total download size: 1.6 M
Is this ok [y/d/N]: y
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
(1/3): subscription-manager-rhsm-1.24.38-1.el7.x86_64.rpm                                                | 330 kB  00:00:00     
(2/3): subscription-manager-1.24.38-1.el7.x86_64.rpm                                                     | 1.1 MB  00:00:00     
(3/3): subscription-manager-rhsm-certificates-1.24.38-1.el7.x86_64.rpm                                   | 239 kB  00:00:00     
--------------------------------------------------------------------------------------------------------------------------------
Total                                                                                           1.9 MB/s | 1.6 MB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
  Updating   : subscription-manager-rhsm-certificates-1.24.38-1.el7.x86_64                                                  1/6 
  Updating   : subscription-manager-rhsm-1.24.38-1.el7.x86_64                                                               2/6 
  Updating   : subscription-manager-1.24.38-1.el7.x86_64                                                                    3/6 
  Cleanup    : subscription-manager-1.24.23-1.el7.x86_64                                                                    4/6 
  Cleanup    : subscription-manager-rhsm-1.24.23-1.el7.x86_64                                                               5/6 
  Cleanup    : subscription-manager-rhsm-certificates-1.24.23-1.el7.x86_64                                                  6/6 
  Verifying  : subscription-manager-1.24.38-1.el7.x86_64                                                                    1/6 
  Verifying  : subscription-manager-rhsm-certificates-1.24.38-1.el7.x86_64                                                  2/6 
  Verifying  : subscription-manager-rhsm-1.24.38-1.el7.x86_64                                                               3/6 
  Verifying  : subscription-manager-rhsm-certificates-1.24.23-1.el7.x86_64                                                  4/6 
  Verifying  : subscription-manager-rhsm-1.24.23-1.el7.x86_64                                                               5/6 
  Verifying  : subscription-manager-1.24.23-1.el7.x86_64                                                                    6/6 

Updated:
  subscription-manager.x86_64 0:1.24.38-1.el7                                                                                   

Dependency Updated:
  subscription-manager-rhsm.x86_64 0:1.24.38-1.el7         subscription-manager-rhsm-certificates.x86_64 0:1.24.38-1.el7        

Complete!
[root@dhcp-13-226-235 yum.repos.d]# subscription-manager register --org Red_Hat --activationkey rhel7
The system has been registered with ID: 545efb43-c850-4d61-8dba-4d488f231ce1
The registered system name is: dhcp-13-226-235.ml17.lab.eng.rdu.redhat.com

Installed Product Current Status:
Product Name: Red Hat Enterprise Linux Server
Status:       Subscribed

[root@dhcp-13-226-235 yum.repos.d]# grep -rin "enabled = 1" /etc/yum.repos.d/redhat.repo
22:enabled = 1

[root@dhcp-13-226-235 yum.repos.d]# head -c 200 /var/lib/rhsm/cache/profile.json
{"enabled_repos": [{"baseurl": ["https://cragsat66.usersys.redhat.com/pulp/repos/Red_Hat/Library/content/dist/rhel/server/7/7Server/x86_64/os"], "repositoryid": "rhel-7-server-rpms"}], "modulemd": [],<SNIP>

> repos are present ^

VERIFIED.

Comment 15 errata-xmlrpc 2020-09-29 19:22:47 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (subscription-manager bug fix update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:3866


Note You need to log in before you can comment on or make changes to this bug.