Hide Forgot
Description of problem: Yes, manual changes to the /etc/yum.repos.d/redhat.repo should persist, but not after a user has unsubscribed or unregistered or re-registered. In the scenario demonstrated below... 1. user registers 2. subscribes to a pool 3. edits the enabled flag of a newly granted repo in the redhat.repo file 4. observes in that the manual edit is indeed reflected in subscription-manager repos --list 5. observes in that the manual edit is indeed reflected in yum repolist enabled 6. unsubscribes from all entitlements 7. unregisters 8. observes subscription-manager repos --list is now empty 9. DOES NOT TRIGGER A YUM TRANSACTION, BUT NOTICES THE redhat.repo IS DIRTY 10. registers again 11. subscribes to same pool in step 2 12. runs subscription-manager repos --list BANG! The repos list still reflects the manual edit from step 4 (which should have been obliterated by the unsubscribe in step 6 as well as the unregister in step 7 as well as the new register in step 10. The fundamental problem is that the contents of /etc/yum.repos.d/redhat.repo were never wiped clean by a yum transaction between step 6 thru 10. Version-Release number of selected component (if applicable): [root@jsefler-r63-server ~]# rpm -q subscription-manager subscription-manager-0.99.8-1.git.13.1ecb596.el6.x86_64 [root@jsefler-r63-server ~]# rpm -q python-rhsm python-rhsm-0.99.4-1.git.0.893878e.el6.noarch How reproducible: Steps to Reproduce: NOTICE THAT MY certFrequency=240 IS HIGH SO THAT AN AUTOMATIC REFRESH WILL NOT AFFECT THIS TEST... [root@jsefler-r63-server ~]# grep -i frequency /etc/rhsm/rhsm.conf # Frequency of certificate refresh (in minutes): certFrequency=240 # Frequency of autoheal check (1440 min = 1 day): healFrequency = 1440 STEP 1... [root@jsefler-r63-server ~]# subscription-manager register --username testuser1 --password password --org admin --force The system with UUID 8796fb1f-0a18-4b7c-8591-728a38bad5a6 has been unregistered The system has been registered with id: a47f33b3-9dde-4cde-83f1-438d0b5cb7fb [root@jsefler-r63-server ~]# subscription-manager repos --list The system is not entitled to use any repositories. [root@jsefler-r63-server ~]# yum repolist enabled Loaded plugins: product-id, refresh-packagekit, rhnplugin, security, subscription-manager Updating certificate-based repositories. There was an error parsing the RHN proxy settings. RHN Satellite or RHN Classic support will be disabled. repolist: 0 STEP 2... [root@jsefler-r63-server ~]# subscription-manager list --avail | grep awesomeos-server-basic-me -B1 -A5 ProductName: Awesome OS Server Basic (multi-entitlement) ProductId: awesomeos-server-basic-me PoolId: 8a90f81435ace4270135ace53d460294 Quantity: 10 Multi-Entitlement: Yes Expires: 03/21/2013 MachineType: physical -- ProductName: Awesome OS Server Basic (multi-entitlement) ProductId: awesomeos-server-basic-me PoolId: 8a90f81435ace4270135ace53cfd0288 Quantity: 5 Multi-Entitlement: Yes Expires: 03/21/2013 MachineType: physical [root@jsefler-r63-server ~]# subscription-manager subscribe --pool 8a90f81435ace4270135ace53d460294 Successfully consumed a subscription from the pool with id 8a90f81435ace4270135ace53d460294. [root@jsefler-r63-server ~]# subscription-manager repos --list +----------------------------------------------------------+ Entitled Repositories in /etc/yum.repos.d/redhat.repo +----------------------------------------------------------+ RepoName: never-enabled-content RepoId: never-enabled-content RepoUrl: https://cdn.redhat.com/foo/path/never Enabled: 0 RepoName: always-enabled-content RepoId: always-enabled-content RepoUrl: https://cdn.redhat.com/foo/path/always Enabled: 1 RepoName: content RepoId: content-label RepoUrl: https://cdn.redhat.com/foo/path Enabled: 1 [root@jsefler-r63-server ~]# yum repolist enabled Loaded plugins: product-id, refresh-packagekit, rhnplugin, security, subscription-manager Updating certificate-based repositories. There was an error parsing the RHN proxy settings. RHN Satellite or RHN Classic support will be disabled. https://cdn.redhat.com/foo/path/always/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 403" Trying other mirror. repo id repo name status always-enabled-content always-enabled-content 0 content-label content 0 repolist: 0 STEP 3... [root@jsefler-r63-server ~]# sed -i "/\[always-enabled-content\]/,/\[/ s/^enabled\s*=.*/enabled=false/" /etc/yum.repos.d/redhat.repo STEP 4... [root@jsefler-r63-server ~]# subscription-manager repos --list +----------------------------------------------------------+ Entitled Repositories in /etc/yum.repos.d/redhat.repo +----------------------------------------------------------+ RepoName: never-enabled-content RepoId: never-enabled-content RepoUrl: https://cdn.redhat.com/foo/path/never Enabled: 0 RepoName: always-enabled-content RepoId: always-enabled-content RepoUrl: https://cdn.redhat.com/foo/path/always Enabled: false RepoName: content RepoId: content-label RepoUrl: https://cdn.redhat.com/foo/path Enabled: 1 STEP 5... [root@jsefler-r63-server ~]# yum repolist enabled Loaded plugins: product-id, refresh-packagekit, rhnplugin, security, subscription-manager Updating certificate-based repositories. There was an error parsing the RHN proxy settings. RHN Satellite or RHN Classic support will be disabled. https://cdn.redhat.com/foo/path/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 403" Trying other mirror. repo id repo name status content-label content 0 repolist: 0 STEP 6... [root@jsefler-r63-server ~]# subscription-manager unsubscribe --all [root@jsefler-r63-server ~]# subscription-manager repos --list The system is not entitled to use any repositories. STEP 7... [root@jsefler-r63-server ~]# subscription-manager unregister System has been un-registered. STEP 8... [root@jsefler-r63-server ~]# subscription-manager repos --list The system is not entitled to use any repositories. STEP 9... WITHOUT RUNNING A YUM TRANSACTION, NOTICE THE redhat.repo IS STILL DIRTY [root@jsefler-r63-server ~]# cat /etc/yum.repos.d/redhat.repo # # Certificate-Based Repositories # Managed by (rhsm) subscription-manager # # If this file is empty and this system is subscribed consider # a "yum repolist" to refresh available repos # [content-label] name = content baseurl = https://cdn.redhat.com/foo/path enabled = 1 gpgcheck = 1 gpgkey = https://cdn.redhat.com/foo/path/gpg/ sslverify = 1 sslcacert = /etc/rhsm/ca/redhat-uep.pem sslclientkey = /etc/pki/entitlement/9195373692866632040-key.pem sslclientcert = /etc/pki/entitlement/9195373692866632040.pem metadata_expire = 0 [always-enabled-content] name = always-enabled-content baseurl = https://cdn.redhat.com/foo/path/always enabled = false gpgcheck = 1 gpgkey = https://cdn.redhat.com/foo/path/always/gpg sslverify = 1 sslcacert = /etc/rhsm/ca/redhat-uep.pem sslclientkey = /etc/pki/entitlement/9195373692866632040-key.pem sslclientcert = /etc/pki/entitlement/9195373692866632040.pem metadata_expire = 200 [never-enabled-content] name = never-enabled-content baseurl = https://cdn.redhat.com/foo/path/never enabled = 0 gpgcheck = 1 gpgkey = https://cdn.redhat.com/foo/path/never/gpg sslverify = 1 sslcacert = /etc/rhsm/ca/redhat-uep.pem sslclientkey = /etc/pki/entitlement/9195373692866632040-key.pem sslclientcert = /etc/pki/entitlement/9195373692866632040.pem metadata_expire = 600 STEP 10... [root@jsefler-r63-server ~]# subscription-manager register --username testuser1 --password password --org admin The system has been registered with id: b4f06eec-9816-40f1-bb6e-f143b1abf601 STEP 11... [root@jsefler-r63-server ~]# subscription-manager subscribe --pool 8a90f81435ace4270135ace53d460294 Successfully consumed a subscription from the pool with id 8a90f81435ace4270135ace53d460294. STEP 12... [root@jsefler-r63-server ~]# subscription-manager repos --list +----------------------------------------------------------+ Entitled Repositories in /etc/yum.repos.d/redhat.repo +----------------------------------------------------------+ RepoName: never-enabled-content RepoId: never-enabled-content RepoUrl: https://cdn.redhat.com/foo/path/never Enabled: 0 RepoName: always-enabled-content RepoId: always-enabled-content RepoUrl: https://cdn.redhat.com/foo/path/always Enabled: false RepoName: content RepoId: content-label RepoUrl: https://cdn.redhat.com/foo/path Enabled: 1 [root@jsefler-r63-server ~]# yum repolist enabled Loaded plugins: product-id, refresh-packagekit, rhnplugin, security, subscription-manager Updating certificate-based repositories. There was an error parsing the RHN proxy settings. RHN Satellite or RHN Classic support will be disabled. https://cdn.redhat.com/foo/path/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 403" Trying other mirror. repo id repo name status content-label content 0 repolist: 0 [root@jsefler-r63-server ~]# ^^^ BANG! THE ENABLED FLAG OF THE always-enabled-content REPO STILL SHOWS THE ORIGINAL MANUAL EDIT OF THE redhat.repo FILE. One could argue that since the user manually edited the redhat.repo, then the sticky value is correct. However, I would argue that the three events (unsubscribe --all, unregister, register) should each have wiped out all manual edits to the redhat.repo so as to prevent this situation from happening at all.
On unregister, the issue seems to be that all the code to update repo's etc (repolib, certlib, and friends) fails when there is no consumer cert. unregister command catches all exceptions and stops if it catches anything, so nothing get's done for updating these repo's on unregister. Working on patch.
1b5abbd9 master 0.99.8+
Moving to verified. RPM used: [root@dhcp201-162 ~]# rpm -qa | grep subscription-manager subscription-manager-migration-0.99.8-1.git.22.c4b5c6a.el6.x86_64 subscription-manager-gnome-0.99.8-1.git.22.c4b5c6a.el6.x86_64 subscription-manager-firstboot-0.99.8-1.git.22.c4b5c6a.el6.x86_64 subscription-manager-debuginfo-0.99.8-1.el6.x86_64 subscription-manager-0.99.8-1.git.22.c4b5c6a.el6.x86_64 [root@dhcp201-162 ~]# sed -i "/\[always-enabled-content\]/,/\[/s/^enabled\s*=.*/enabled=false/" /etc/yum.repos.d/redhat.repo [root@dhcp201-162 ~]# subscription-manager repos --list +----------------------------------------------------------+ Entitled Repositories in /etc/yum.repos.d/redhat.repo +----------------------------------------------------------+ RepoName: never-enabled-content RepoId: never-enabled-content RepoUrl: https://cdn.redhat.com/foo/path/never Enabled: 0 RepoName: always-enabled-content RepoId: always-enabled-content RepoUrl: https://cdn.redhat.com/foo/path/always Enabled: false RepoName: content RepoId: content-label RepoUrl: https://cdn.redhat.com/foo/path Enabled: 1 [root@dhcp201-162 ~]# yum repolist enabled Loaded plugins: product-id, refresh-packagekit, rhnplugin, security, subscription-manager Updating certificate-based repositories. https://cdn.redhat.com/foo/path/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 403" Trying other mirror. repo id repo name status beaker-HighAvailability beaker-HighAvailability 52 beaker-LoadBalancer beaker-LoadBalancer 2 beaker-ResilientStorage beaker-ResilientStorage 58 beaker-ScalableFileSystem beaker-ScalableFileSystem 7 beaker-Server beaker-Server 3,529 content-label content 0 rhel-x86_64-server-6 Red Hat Enterprise Linux Server (v. 6 for 64-bit x86_64) 0 repolist: 3,648 [root@dhcp201-162 ~]# subscription-manager unsubscribe --all [root@dhcp201-162 ~]# [root@dhcp201-162 ~]# subscription-manager repos --list The system is not entitled to use any repositories. [root@dhcp201-162 ~]# subscription-manager unregister System has been un-registered. [root@dhcp201-162 ~]# [root@dhcp201-162 ~]# subscription-manager repos --list The system is not entitled to use any repositories. [root@dhcp201-162 ~]# cat /etc/yum.repos.d/redhat.repo # # Certificate-Based Repositories # Managed by (rhsm) subscription-manager # # If this file is empty and this system is subscribed consider # a "yum repolist" to refresh available repos # [root@dhcp201-162 ~]# subscription-manager register --username testuser1 WARNING This system has already been registered with RHN using RHN Classic technology. The tool you are using is attempting to re-register using RHN Certificate-Based technology. Red Hat recommends (except in a few cases) that customers only register with RHN once. To learn more about RHN registration and technologies please consult this Knowledge Base Article: https://access.redhat.com/kb/docs/DOC-45563 Password: User interrupted process. [root@dhcp201-162 ~]# subscription-manager register --username testuser1 --password password --org admin WARNING This system has already been registered with RHN using RHN Classic technology. The tool you are using is attempting to re-register using RHN Certificate-Based technology. Red Hat recommends (except in a few cases) that customers only register with RHN once. To learn more about RHN registration and technologies please consult this Knowledge Base Article: https://access.redhat.com/kb/docs/DOC-45563 The system has been registered with id: 8c73b972-2df5-4ff0-99a8-dc6e794cc697 [root@dhcp201-162 ~]# subscription-manager subscribe --pool Usage: subscription-manager subscribe [OPTIONS] subscription-manager: error: --pool option requires an argument [root@dhcp201-162 ~]# subscription-manager subscribe --pool 0000000035c785b40135c78688ea0289 Successfully consumed a subscription from the pool with id 0000000035c785b40135c78688ea0289. [root@dhcp201-162 ~]# subscription-manager repos --list +----------------------------------------------------------+ Entitled Repositories in /etc/yum.repos.d/redhat.repo +----------------------------------------------------------+ RepoName: never-enabled-content RepoId: never-enabled-content RepoUrl: https://cdn.redhat.com/foo/path/never Enabled: 0 RepoName: always-enabled-content RepoId: always-enabled-content RepoUrl: https://cdn.redhat.com/foo/path/always Enabled: 1 RepoName: content RepoId: content-label RepoUrl: https://cdn.redhat.com/foo/path Enabled: 1 [root@dhcp201-162 ~]# yum repolist enabled Loaded plugins: product-id, refresh-packagekit, rhnplugin, security, subscription-manager Updating certificate-based repositories. https://cdn.redhat.com/foo/path/always/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 403" Trying other mirror. repo id repo name status always-enabled-content always-enabled-content 0 beaker-HighAvailability beaker-HighAvailability 0 beaker-LoadBalancer beaker-LoadBalancer 0 beaker-ResilientStorage beaker-ResilientStorage 0 beaker-ScalableFileSystem beaker-ScalableFileSystem 0 beaker-Server beaker-Server 0 content-label content 0 rhel-x86_64-server-6 Red Hat Enterprise Linux Server (v. 6 for 64-bit x86_64) 0 repolist: 0
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, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2012-0804.html