Bug 1815624

Summary: When in Simple Content Access mode, subscription-manager should not complain that subscriptions aren't attached
Product: Red Hat Enterprise Linux 8 Reporter: Rich Jerrido <rjerrido>
Component: subscription-managerAssignee: William Poteat <wpoteat>
Status: CLOSED ERRATA QA Contact: Red Hat subscription-manager QE Team <rhsm-qe>
Severity: high Docs Contact:
Priority: medium    
Version: 8.4CC: jhnidek, jsefler, ktordeur, redakkan, swachira, wpoteat
Target Milestone: rcKeywords: Triaged
Target Release: 8.3   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1831104 (view as bug list) Environment:
Last Closed: 2020-11-04 01:39:09 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1825061, 1831104    

Description Rich Jerrido 2020-03-20 18:36:08 UTC
Description of problem:


When in Simple Content Access mode, subscription-manager should not complain that subscriptions aren't attached. 



How reproducible:
100%



Steps to Reproduce:
1. Configure your organization to use org_environment mode
2. register a node with subscription-manager. 
3. do not attach a subscription and enable one or more repos


Actual results:

When running yum commands you get:

This system is registered with an entitlement server, but is not receiving updates. You can use subscription-manager to assign subscriptions

Version-Release number of selected component (if applicable):
all

Expected results:
No such output as it is confusing to users. 

Additional info:

Comment 3 Rehana 2020-06-19 08:53:21 UTC
Reproducing the old behaviour on RHEL 8.2 :
==========================================

Against Local candlepin deployment 

# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 3.1.13-1
subscription management rules: 5.40
subscription-manager: 1.26.16-1.el8

1. Register system to simple content access mode enabled org 
#  subscription-manager register --serverurl=https://****:8443/candlepin --username=admin --org=snowwhite
Registering to: ansible-candlepin.usersys.redhat.com:8443/candlepin
Password: 
The system has been registered with ID: 72299397-9ae9-4867-93b5-1fb1ba952b99
The registered system name is: ibm-x3650m4-01-vm-08.ibm2.lab.eng.bos.redhat.com

# ll /etc/pki/entitlement/
total 12
-rw-r--r--. 1 root root 3243 Jun 19 04:43 1361574765309874438-key.pem
-rw-r--r--. 1 root root 5638 Jun 19 04:43 1361574765309874438.pem

# subscription-manager status
+-------------------------------------------+
   System Status Details
+-------------------------------------------+
Overall Status: Disabled
Content Access Mode is set to Organization/Environment Access. This host has access to content, regardless of subscription status.

System Purpose Status: Disabled

2. Enable a repo
# mv /etc/yum.repos.d/beaker-* /home/test
# subscription-manager repos --enable=37060-content-label

3. Execute yum repolist 
# yum repolist
Updating Subscription Management repositories.
This system is registered to Red Hat Subscription Management, but is not receiving updates. You can use subscription-manager to assign subscriptions.  -->> Notice the message 
repo id                       repo name
37060-content-label          37060-content

Verifying on RHEL 8.3 system
=============================

# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 3.1.13-1
subscription management rules: 5.40
subscription-manager: 1.27.6-1.el8

# rpm -qa subscr* --changelog | grep 1815624 -A1
- 1815624: When in Simple Content Access mode, subscription-manager should not
  complain that subscriptions aren't attached (wpoteat)

1. Register system to simple content access mode enabled org 

# subscription-manager register --serverurl=https://***:8443/candlepin --username=admin --org=snowwhite
Registering to: ansible-candlepin.usersys.redhat.com:8443/candlepin
Password: 
The system has been registered with ID: 8350b068-f497-4b72-9020-6397f66c8814
The registered system name is: ibm-x3650m4-01-vm-06.ibm2.lab.eng.bos.redhat.com

[root@ibm-x3650m4-01-vm-06 ~]# ll /etc/pki/entitlement/
total 12
-rw-r--r--. 1 root root 3243 Jun 19 04:33 4313939388961022403-key.pem
-rw-r--r--. 1 root root 5638 Jun 19 04:33 4313939388961022403.pem

# subscription-manager status
+-------------------------------------------+
   System Status Details
+-------------------------------------------+
Overall Status: Disabled
Content Access Mode is set to Simple Content Access. This host has access to content, regardless of subscription status.

System Purpose Status: Disabled

2. Enable a repo
# mv /etc/yum.repos.d/beaker-* /home/test/
# subscription-manager repos --enable=37060-content-label
Repository '37060-content-label' is enabled for this system.

3. Execute yum repolist 
# yum repolist
Updating Subscription Management repositories.
repo id                           repo name
37060-content-label             37060-content

^^ Notice with the fix, the message "This system is registered to Red Hat Subscription Management, but is not receiving updates. You can use subscription-manager to assign subscriptions." NO LONGER APPEAR.

Based on the above observations moving the bug to Verified.

Comment 6 errata-xmlrpc 2020-11-04 01:39:09 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 and enhancement 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:4460