Bug 1297538 - 401 error after changing admin password in rhui-manager
401 error after changing admin password in rhui-manager
Status: NEW
Product: Red Hat Update Infrastructure for Cloud Providers
Classification: Red Hat
Component: Tools (Show other bugs)
3.0.0
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: RHUI Bug List
Vratislav Hutsky
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-01-11 14:39 EST by Irina Gulina
Modified: 2017-08-10 10:37 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Known Issue
Doc Text:
Changing the password requires that the user logout and log back in for features to work.
Story Points: ---
Clone Of:
Environment:
Last Closed:
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)

  None (edit)
Description Irina Gulina 2016-01-11 14:39:36 EST
Description of problem:

After changing the password of 'admin' user, the login session is active but returns 401 or unexpected error on the 'admin' commands.

Version-Release number of selected component (if applicable):
>> rpm -qa *rhui*
rhui-installer-base-0.0.24-1.el7ui.noarch
rh-rhui-tools-libs-pre.3.0.16-1.el7ui.noarch
rhui-installer-0.0.24-1.el7ui.noarch
rh-rhui-tools-pre.3.0.16-1.el7ui.noarch
rhui-default-ca-1.0-1.noarch
rh-amazon-rhui-client-2.2.118-1.el7.noarch
rh-amazon-rhui-client-rhs30-2.2.124-1.el7.noarch

How reproducible:
always, if the previous rhui-manager session was closed by 'logout'

Steps to Reproduce (I tried it with different scenarios, some of them):

0. the last rhui-manager session should be closed with 'logout' command, it's important. I didn't have this bug using 'exit'. 
1. login as admin,
2. change the admin pass (scenario II: and then in the same session try to change it several times and every time get an error "Encountered the following error during a request to Pulp: 401 - Authentication with username admin failed: invalid username or password.")
3. try to change the pass of non-existing user - get an error

"Encountered the following error during a request to Pulp: 401 - Authentication with username admin failed: invalid username or password."

4. try to change the admin pass again - get an error

"Encountered the following error during a request to Pulp: 401 - Authentication with username admin failed: invalid username or password."

5. try to 'list repositories currently managed by the RHUI' - get a non-existing error message and the traceback in logs.

>> rhui (users) => logout
>> [root@rhua ~]# rhui-manager
Previous authentication credentials could not be found. Logging into
the RHUI.

If this is the first time using the RHUI, it is recommended to change
the user's password in the User Management section of RHUI Tools.

RHUI Username: admin
RHUI Password: 123456

>> -= Red Hat Update Infrastructure Management Tool =-
.....

Press 'u', then 'p'

>> rhui (users) => p

Username: admin

New Password: qwerty
Re-enter Password: qwerty

Password successfully updated.

------------------------------------------------------------------------------

Press 'p', and try to change the pass of non-existing user

>> rhui (users) => p

Username: no_user

New Password: qwerty
Re-enter Password: qwerty

Encountered the following error during a request to Pulp: 401 - Authentication with username admin failed: invalid username or password.

Now go home screen '<', then manage repositories 'r' and then list repositories currently managed by the RHUI 'l'. Get error:

An unexpected error has occurred during the last operation.
More information can be found in /root/.rhui/rhui.log.

>> vi /root/.rhui/rhui.log
2016-01-11 13:33:15,501 - Unexpected error caught at the shell level
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/rhui/tools/shell.py", line 88, in safe_listen
    self.listen(clear=first_run)
  File "/usr/lib/python2.7/site-packages/rhui/tools/shell.py", line 122, in listen
    Shell.listen(self)
  File "/usr/lib/python2.7/site-packages/rhui/common/shell.py", line 186, in listen
    item.func(*args, **item.kwargs)
  File "/usr/lib/python2.7/site-packages/rhui/tools/screens/repo.py", line 61, in list
    redhat_repos = self.pulp.redhat_repo_list()
  File "/usr/lib/python2.7/site-packages/rhui/tools/pulp_api.py", line 248, in redhat_repo_list
    response = self.repo_group_api.repo_group(GROUP_RED_HAT)
  File "/usr/lib/python2.7/site-packages/pulp/bindings/repo_groups.py", line 93, in repo_group
    return self.server.GET(path)
  File "/usr/lib/python2.7/site-packages/pulp/bindings/server.py", line 91, in GET
    return self._request('GET', path, queries)
  File "/usr/lib/python2.7/site-packages/pulp/bindings/server.py", line 161, in _request
    self._handle_exceptions(response_code, response_body)
  File "/usr/lib/python2.7/site-packages/pulp/bindings/server.py", line 202, in _handle_exceptions
    raise code_class_mappings[response_code](response_body)
PermissionsException: RequestException: GET request on /pulp/api/v2/repo_groups/redhat/ failed with 401 - Authentication with username admin failed: invalid username or password


If to 'logout', then it's possible to login with a new 'admin' password: 'qwerty'


Additional info:
Comment 3 Irina Gulina 2016-01-11 15:01:30 EST
Used RHUI-3.0-RHEL-7-20151013.n.0-RHUI-x86_64-dvd1.iso
Comment 4 Irina Gulina 2016-06-23 10:46:33 EDT
another scenario to reproduce: 

1. login after logout,
2. change the admin pass
3. in the same sesssion try to create the repo

>> # rhui-manager
Previous authentication credentials could not be found. Logging into
the RHUI.

If this is the first time using the RHUI, it is recommended to change
the user's password in the User Management section of RHUI Tools.

RHUI Username: admin
RHUI Password: 

------------------------------------------------------------------------------
rhui (home) => u

rhui (users) => p

Username: admin

New Password: 
Re-enter Password: 

Password successfully updated.

------------------------------------------------------------------------------
rhui (users) => <
rhui (home) => r
rhui (repo) => c

Unique ID for the custom repository (alphanumerics, _, and - only):
repo1_unprotected


An unexpected error has occurred during the last operation.
More information can be found in /root/.rhui/rhui.log.

>> less /root/.rhui/rhui.log
2016-06-23 10:38:11,917 - Unexpected error caught at the shell level
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/rhui/tools/shell.py", line 88, in safe_listen
    self.listen(clear=first_run)
  File "/usr/lib/python2.7/site-packages/rhui/tools/shell.py", line 122, in listen
    Shell.listen(self)
  File "/usr/lib/python2.7/site-packages/rhui/common/shell.py", line 186, in listen
    item.func(*args, **item.kwargs)
  File "/usr/lib/python2.7/site-packages/rhui/tools/screens/repo.py", line 381, in create_custom
    existing = self.pulp.repo(id)
  File "/usr/lib/python2.7/site-packages/rhui/tools/pulp_api.py", line 154, in repo
    response = self.repo_api.repository(id)
  File "/usr/lib/python2.7/site-packages/pulp/bindings/repository.py", line 85, in repository
    return self.server.GET(path, query_parameters)
  File "/usr/lib/python2.7/site-packages/pulp/bindings/server.py", line 92, in GET
    return self._request('GET', path, queries, ignore_prefix=ignore_prefix)
  File "/usr/lib/python2.7/site-packages/pulp/bindings/server.py", line 166, in _request
    self._handle_exceptions(response_code, response_body)
  File "/usr/lib/python2.7/site-packages/pulp/bindings/server.py", line 207, in _handle_exceptions
    raise code_class_mappings[response_code](response_body)
PermissionsException: RequestException: GET request on /pulp/api/v2/repositories/repo1_unprotected/ failed with 401 - Authentication with username admin failed: invalid username or password
Comment 5 Bryan Kearney 2016-08-02 09:00:38 EDT
logging out and logging back in fixes the issue.
Comment 6 Irina Gulina 2017-03-15 11:15:39 EDT
still valid for RHUI3 GA release. 'exit/log out' and login back fixes the issue.

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