Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1704670

Summary: can't subscribe system via the Cockpit web console
Product: Red Hat Enterprise Linux 8 Reporter: Andreas Nilsson <anilsson>
Component: subscription-managerAssignee: candlepin-bugs
Status: CLOSED DUPLICATE QA Contact: Red Hat subscription-manager QE Team <rhsm-qe>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: ---CC: csnyder, jscotka, klember, mpitt, redakkan
Target Milestone: rcKeywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-04-01 09:06:37 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:
Attachments:
Description Flags
subscription-manager-cockpit screenshot
none
gnome-control-center screenshot none

Description Andreas Nilsson 2019-04-30 10:21:03 UTC
Description of problem:

Just subscribing a system to customer portal with username and password doesn't work any more.

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

Cockpit 185 on RHEL 8.0

How reproducible:

Steps to Reproduce:
1. Go to Subscriptions
2. Fill in Username and Password

Actual results:

HTTP error (400 - Bad Request): You must specify an organization for new units.

Expected results:

That it would successfully subscribe the system.

Comment 1 Andreas Nilsson 2019-04-30 10:37:43 UTC
Subscribing using the CLI on the same system works as expected

sudo subscription-manager register

Comment 2 Chris Snyder 2019-05-02 15:42:18 UTC
Can we please see the /var/log/rhsm/rhsm.log from the reproducer?

Comment 3 Chris Snyder 2019-05-02 15:45:57 UTC
When did this last work for you? Was it with an older version of Cockpit?

Comment 5 Andreas Nilsson 2019-05-08 19:59:28 UTC
Yes, it was working in cockpit in the past, but I can't remember the exact version and if it was the new or the old subscription UI.

Comment 7 Andreas Nilsson 2019-05-08 20:14:48 UTC
Here is my /var/log/rhsm/rhsm.log from a fresh RHEL 8.0 image I just downloaded off the customer portal:

2019-04-04 04:46:14,908 [INFO] dnf:2685:MainThread @connection.py:924 - Connection built: host=subscription.rhsm.redhat.com port=443 handler=/subscription auth=identity_cert ca_dir=/etc/rhsm/ca/ insecure=False                                    
2019-04-04 04:46:14,912 [INFO] dnf:2685:MainThread @repolib.py:464 - repos updated: Repo updates                                                                                                                                                     
                                                                                                                                                                                                                                                     
Total repo updates: 0                                                                                                                                                                                                                                
Updated                                                                                                                                                                                                                                              
    <NONE>                                                                                                                                                                                                                                           
Added (new)                                                                                                                                                                                                                                          
    <NONE>                                                                                                                                                                                                                                           
Deleted                                                                                                                                                                                                                                              
    <NONE>                                                                                                                                                                                                                                           
2019-04-04 04:46:16,480 [WARNING] dnf:2685:MainThread @logutil.py:142 - logging already initialized                                                                                                                                                  
2019-04-04 04:46:16,482 [ERROR] dnf:2685:MainThread @product-id.py:198 - Unable to read cache: /var/lib/rhsm/cache/productid_repo_mapping.json                                                                                                       
2019-04-04 04:46:16,482 [ERROR] dnf:2685:MainThread @product-id.py:199 - [Errno 2] No such file or directory: '/var/lib/rhsm/cache/productid_repo_mapping.json'                                                                                      
Traceback (most recent call last):                                                                                                                                                                                                                   
  File "/usr/lib/python3.6/site-packages/dnf-plugins/product-id.py", line 193, in __read_cache_file                                                                                                                                                  
    with open(file_name) as file:                                                                                                                                                                                                                    
FileNotFoundError: [Errno 2] No such file or directory: '/var/lib/rhsm/cache/productid_repo_mapping.json'                                                                                                                                            
2019-04-04 04:46:16,631 [ERROR] dnf:2685:MainThread @product-id.py:198 - Unable to read cache: /var/lib/rhsm/cache/package_repo_mapping.json                                                                                                         
2019-04-04 04:46:16,632 [ERROR] dnf:2685:MainThread @product-id.py:199 - [Errno 2] No such file or directory: '/var/lib/rhsm/cache/package_repo_mapping.json'                                                                                        
Traceback (most recent call last):                                                                                                                                                                                                                   
  File "/usr/lib/python3.6/site-packages/dnf-plugins/product-id.py", line 193, in __read_cache_file                                                                                                                                                  
    with open(file_name) as file:                                                                                                                                                                                                                    
FileNotFoundError: [Errno 2] No such file or directory: '/var/lib/rhsm/cache/package_repo_mapping.json'                                                                                                                                              
2019-04-04 04:46:17,678 [INFO] dnf:2690:MainThread @connection.py:924 - Connection built: host=subscription.rhsm.redhat.com port=443 handler=/subscription auth=identity_cert ca_dir=/etc/rhsm/ca/ insecure=False                                    
2019-04-04 04:46:17,680 [INFO] dnf:2690:MainThread @repolib.py:464 - repos updated: Repo updates                                                                                                                                                     
                                                                                                                                                                                                                                                     
Total repo updates: 0                                                                                                                                                                                                                                
Updated                                                                                                                                                                                                                                              
    <NONE>                                                                                                                                                                                                                                           
Added (new)                                                                                                                                                                                                                                          
    <NONE>                                                                                                                                                                                                                                           
Deleted                                                                                                                                                                                                                                              
    <NONE>                                                                                                                                                                                                                                           
2019-04-04 04:46:20,816 [WARNING] dnf:2690:MainThread @logutil.py:142 - logging already initialized                                                                                                                                                  
2019-04-04 04:46:20,817 [ERROR] dnf:2690:MainThread @product-id.py:198 - Unable to read cache: /var/lib/rhsm/cache/productid_repo_mapping.json                                                                                                       
2019-04-04 04:46:20,818 [ERROR] dnf:2690:MainThread @product-id.py:199 - [Errno 2] No such file or directory: '/var/lib/rhsm/cache/productid_repo_mapping.json'                                                                                      
Traceback (most recent call last):                                                                                                                                                                                                                   
  File "/usr/lib/python3.6/site-packages/dnf-plugins/product-id.py", line 193, in __read_cache_file                                                                                                                                                  
    with open(file_name) as file:                                                                                                                                                                                                                    
FileNotFoundError: [Errno 2] No such file or directory: '/var/lib/rhsm/cache/productid_repo_mapping.json'                                                                                                                                            
2019-05-08 14:30:02,138 [INFO] rhsmd:1081:MainThread @rhsm_d.py:280 - rhsmd started                                                                                                                                                                  
2019-05-08 14:30:02,138 [INFO] rhsmd:1081:MainThread @rhsm_d.py:311 - logging subscription status to syslog                                                                                                                                          
2019-05-08 14:30:02,204 [INFO] rhsmd:1081:MainThread @rhsm_d.py:273 - rhsmd: In order for Subscription Manager to provide your system with updates, your system must be registered with the Customer Portal. Please enter your Red Hat login to ensur
e your system is up-to-date.                                                                                                                                                                                                                         
2019-05-08 15:56:18,696 [INFO] rhsmd:1089:MainThread @rhsm_d.py:280 - rhsmd started                                                                                                                                                                  
2019-05-08 16:10:50,380 [INFO] rhsmd:2670:MainThread @rhsm_d.py:280 - rhsmd started

Comment 15 Andreas Nilsson 2020-03-17 12:16:05 UTC
Have not encountered this for a very long time now, so assuming this bug got fixed somehow.
Closing. Will open a new bug if I run into similar issues again.

Comment 16 Andreas Nilsson 2020-03-27 14:47:54 UTC
I ran into this again today on the RHEL 8.2 Beta. March 10, 2020 build.
Apparently the same thing occurs in GNOME System Settings (gnome-control-center package).

#dnf info gnome-control-center
version: 3.28.2
release: 19.el8
source:  gnome-control-center-3.28.2-19.el8.src.rpm

#dnf info subscription-manager-cockpit
Version      : 1.26.14
Release      : 1.el8
Source       : subscription-manager-1.26.14-1.el8.src.rpm

Comment 17 Andreas Nilsson 2020-03-27 14:49:29 UTC
Created attachment 1674089 [details]
subscription-manager-cockpit screenshot

Comment 18 Andreas Nilsson 2020-03-27 14:50:13 UTC
Created attachment 1674090 [details]
gnome-control-center screenshot

Comment 19 Andreas Nilsson 2020-03-27 14:52:12 UTC
But, like before running
#subscription-manager register
from the CLI still works...

The only thing the subscription-manager-cockpit code and gnome-control-center have in common is that they both use the same dbus calls, so maybe that's that?
I would assume subscription-manager CLI tools doesn't use that.

Comment 21 Rehana 2020-04-01 09:06:37 UTC
Hi Andreas,
Thanks for opening the bug and joining our meeting on Tuesday. Based on the discussion we had on Tuesday's call , for cockpit related observation on comment 17 there is an open bug 1753236 for the same. Also as we mentioned in the call, our team is not responsible for the gnome-control-center functionality, please track the observation with maintainers of gnome-control-center.

*** This bug has been marked as a duplicate of bug 1753236 ***