Bug 1248133 - If rhsm server gives a 401 about T&C's gui gets confused
If rhsm server gives a 401 about T&C's gui gets confused
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: subscription-manager (Show other bugs)
7.2
Unspecified Unspecified
medium Severity medium
: rc
: ---
Assigned To: candlepin-bugs
John Sefler
Lenka Spackova
:
Depends On:
Blocks: 1246123 1246125 1259988 1264318 1266790
  Show dependency treegraph
 
Reported: 2015-07-29 12:47 EDT by Adrian Likins
Modified: 2015-10-20 04:45 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Known Issue
Doc Text:
Incomplete registration in case of an error When registering a system in the Subscription Manager GUI, if the registration fails, the main registration window does not close when the user clicks "OK" on the error dialog. As a consequence, the main registration window is left open, in a state where it cannot possibly complete the task successfully. This problem occurs, for example, when the user provides invalid credentials, or auto-attach is used for registration. To work around this problem, click the "Cancel" button on the main registration window if an error occurs during the process.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-10-19 10:50:26 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
gui that has encountered a 401 response during registration (52.33 KB, image/png)
2015-10-19 11:00 EDT, John Sefler
no flags Details

  None (edit)
Description Adrian Likins 2015-07-29 12:47:37 EDT
Description of problem:
When registering from the gui, when the client looks up the users owners, if the server returns a 401 about T&CS, the gui shows a message dialog, and then becomes confused.

When making the request for the users orgs
GET /subscription/users/redhatqa/owners, subscriptions services can
respond with a 401 with content:

{"displayMessage":"You must first accept Red Hat's Terms and conditions. Please visit https://www.redhat.com/wapps/ugc . You may have to log out of and back into the  Customer Portal in order to see the terms.","requestUuid":"d3cb47cd-ce85-406f-83e5-fbd4b813c2c4"}

The gui doesn't really expect this and treats it as an exception, displays an error dialog with the message (but without making it a clickable link), and then gets stuck mid register

Version-Release number of selected component (if applicable):
1.15.7 ish
Comment 3 John Sefler 2015-09-25 12:16:15 EDT
deferring to rhel-7.3.0 due to schedule and severity
Comment 5 Adrian Likins 2015-10-19 10:37:09 EDT
Based on 7.2 code, this case seems to be handled better now (https://bugzilla.redhat.com/show_bug.cgi?id=1248133#c2 #3 is fixed).

So, I think the original issue is handled now.

Plus the original issue is a very rare/uncommon scenario that shouldn't happen in prod. So I think this can be considered fixed and ready to be closed.
Comment 7 John Sefler 2015-10-19 11:00 EDT
Created attachment 1084445 [details]
gui that has encountered a 401 response during registration

Demonstrating working version...
[root@jsefler-7 ~]# rpm -q subscription-manager-gui
subscription-manager-gui-1.15.9-15.el7.x86_64

2015-10-19 10:52:35,687 [DEBUG] subscription-manager-gui:31455 @connection.py:523 - Making request: GET /subscription/users/stage_declined/owners
2015-10-19 10:52:36,705 [DEBUG] subscription-manager-gui:31455 @connection.py:555 - Response: status=401
2015-10-19 10:52:36,708 [ERROR] subscription-manager-gui:31455 @utils.py:138 - None
Traceback (most recent call last):
  File "/usr/share/rhsm/subscription_manager/gui/registergui.py", line 1789, in _get_owner_list
    retval = self.backend.cp_provider.get_basic_auth_cp().getOwnerList(username)
  File "/usr/lib64/python2.7/site-packages/rhsm/connection.py", line 1063, in getOwnerList
    return self.conn.request_get(method)
  File "/usr/lib64/python2.7/site-packages/rhsm/connection.py", line 644, in request_get
    return self._request("GET", method)
  File "/usr/lib64/python2.7/site-packages/rhsm/connection.py", line 564, in _request
    self.validateResponse(result, request_type, handler)
  File "/usr/lib64/python2.7/site-packages/rhsm/connection.py", line 611, in validateResponse
    raise RestlibException(response['status'], error_msg, response.get('headers'))
RestlibException: You must first accept Red Hat's Terms and conditions. Please visit https://www.redhat.com/wapps/ugc . You may have to log out of and back into the  Customer Portal in order to see the terms.


See this attached screenshot that shows the warning message with a clickable OK button that when clicked will dismiss the "You must first accept Red Hat's Terms and conditions..." dialog.  Once dismissed the register dialog workflow is fully functional with a Close and Back button that work correctly.  The application is not stuck. In my QE opinion the scenario is handled gracefully in subscription-manager-gui-1.15.9-15.  This bug should not be documented as a Known Issue.

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