Bug 1702753

Summary: subscription-manager cockpit: registration via cockpit to an org with "contentAccessMode"="org_environment" is broken
Product: Red Hat Enterprise Linux 7 Reporter: Shwetha Kallesh <skallesh>
Component: subscription-managerAssignee: Jiri Hnidek <jhnidek>
Status: CLOSED ERRATA QA Contact: Red Hat subscription-manager QE Team <rhsm-qe>
Severity: medium Docs Contact:
Priority: high    
Version: 7.7CC: csnyder, jhnidek, jsefler, redakkan, wpoteat
Target Milestone: rcKeywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1703148 (view as bug list) Environment:
Last Closed: 2020-09-29 19:22:40 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: 1703148    
Bug Blocks:    
Attachments:
Description Flags
Error dialog while registering to org_environment mode owner
none
System is registered successfully via cockpit to an org with content_Access_mode set to org_environment
none
Ignoring request for auto-attach is now displayed after system is registered via cockpit none

Description Shwetha Kallesh 2019-04-24 16:41:24 UTC
Created attachment 1558303 [details]
Error dialog while registering to org_environment mode owner

Description of problem:
subscription-manager cockpit: registration via cockpit to an org with "contentAccessMode"="org_environment" is broken

Version-Release number of selected component (if applicable):
[root@kvm-02-guest05 ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 2.3.17-1
subscription management rules: 5.35
subscription-manager: 1.24.4-1.el7


How reproducible:


Steps to Reproduce:
1.set owner/org to content access mode
root@ibm-x3650m4-01-vm-15 ~]# curl --stderr /dev/null --insecure --user admin:admin --request PUT --data '{"contentAccessMode":"org_environment"}' --header 'accept: application/json' --header 'content-type: application/json' https://shwetha-candlepin.usersys.redhat.com:8443/candlepin/owners/snowwhite
{
  "created" : "2019-04-24T11:57:03+0000",
  "updated" : "2019-04-24T12:11:17+0000",
  "id" : "8acce3476a4f3497016a4f34d65b0002",
  "key" : "snowwhite",
  "displayName" : "Snow White",
  "parentOwner" : null,
  "contentPrefix" : null,
  "defaultServiceLevel" : null,
  "upstreamConsumer" : null,
  "logLevel" : null,
  "autobindDisabled" : false,
  "contentAccessMode" : "org_environment",
  "contentAccessModeList" : "entitlement,org_environment",
  "lastRefreshed" : "2019-04-24T12:00:41+0000",
  "href" : "/owners/snowwhite"
}

2.register system via cockpit to the org snowwhite whose contentaccessMode = org_environment


Actual results:
System is actually registered but an error message is displayed as seen in the attachment

Expected results:
system should register successfully and exit the register dialogue and an another error dialog with message "HTTP error code 400: Ignoring request to auto-attach. It is disabled for org "snowwhite"." should be displyed to user

Additional info:

Comment 4 Shwetha Kallesh 2020-04-16 12:48:41 UTC
Created attachment 1679362 [details]
System is registered successfully via cockpit to an org with content_Access_mode set to org_environment

[root@hpe-dl380pgen8-02-vm-15 ~]# curl --stderr /dev/null --insecure --user admin:admin --request PUT --data '{"contentAccessMode":"org_environment"}' --header 'accept: application/json' --header 'content-type: application/json' https://10.70.35.0:8443/candlepin/owners/snowwhite
{
  "created" : "2020-04-16T10:29:37+0000",
  "updated" : "2020-04-16T11:50:48+0000",
  "id" : "8ac6a38071828911017182896e8d0002",
  "key" : "snowwhite",
  "displayName" : "Snow White",
  "parentOwner" : null,
  "contentPrefix" : null,
  "defaultServiceLevel" : null,
  "upstreamConsumer" : null,
  "logLevel" : null,
  "autobindDisabled" : false,
  "autobindHypervisorDisabled" : false,
  "contentAccessMode" : "org_environment",
  "contentAccessModeList" : "entitlement,org_environment",
  "lastRefreshed" : "2020-04-16T10:34:17+0000",
  "href" : "/owners/snowwhite"
}

Comment 5 Shwetha Kallesh 2020-04-16 13:55:01 UTC
Created attachment 1679387 [details]
Ignoring request for auto-attach is now displayed after system is registered via cockpit

Moving bug to verified

[root@hpe-dl380pgen8-02-vm-15 ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 3.1.9-1
subscription management rules: 5.39
subscription-manager: 1.24.32

Comment 7 errata-xmlrpc 2020-09-29 19:22:40 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