Bug 1472727 - Virt-who fail to start when configured only one hypervisor with encrypted password but no key file in '/var/lib/virt-who/'
Virt-who fail to start when configured only one hypervisor with encrypted pas...
Status: NEW
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: virt-who (Show other bugs)
7.4
x86_64 Linux
low Severity medium
: rc
: ---
Assigned To: candlepin-bugs
Eko
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-07-19 05:37 EDT by yuefliu
Modified: 2018-02-14 17:44 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
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)
Comment 3 Kevin Howell 2017-07-20 10:22:01 EDT
Dev: let's make sure virt-who prints a better error message
Comment 4 Liushihui 2017-11-09 02:13:57 EST
In virt-who-0.20.4-1.el7sat.noarch, No matter /var/lib/virt-who/key is exist or not, when configure encrypted_password to null or error value(encrypted_password= or encrypted_password=xxxx), failed to start virt-who service and error info as the following:

2017-11-09 06:53:09,370 [virtwho.config ERROR] MainProcess(26373):MainThread @config.py:init_config:1336 - Required option: "password" is missing in: "xen"
2017-11-09 06:53:09,370 [virtwho.init ERROR] MainProcess(26373):MainThread @main.py:main:139 - virt-who can't be started: no valid configuration found

Expected result:
Since configure password to null or error value(password= or password=xxxx), virt-who still can start and error info as the following. when set encrypted_password to null or wrong value, virt-who should be started normally and show the same error info
2017-11-09 07:08:42,153 [virtwho.xen ERROR] MainProcess(26417):Thread-2 @xen.py:login:118 - Unable to login to XENserver https://10.73.131.203
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/virtwho/virt/xen/xen.py", line 107, in login
    self.session.xenapi.login_with_password(self.username, self.password)
  File "/usr/lib/python2.7/site-packages/virtwho/virt/xen/XenAPI.py", line 226, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python2.7/site-packages/virtwho/virt/xen/XenAPI.py", line 122, in xenapi_request
    self._login(methodname, params)
  File "/usr/lib/python2.7/site-packages/virtwho/virt/xen/XenAPI.py", line 145, in _login
    result = _parse_result(getattr(self, 'session.%s' % method)(*params))
  File "/usr/lib/python2.7/site-packages/virtwho/virt/xen/XenAPI.py", line 200, in _parse_result
    raise Failure(result['ErrorDescription'])
Failure: ['SESSION_AUTHENTICATION_FAILED', 'root', 'Authentication failure']
2017-11-09 07:08:42,154 [virtwho.xen ERROR] MainProcess(26417):Thread-2 @virt.py:run:383 - Thread 'xen' fails with error: ['SESSION_AUTHENTICATION_FAILED', 'root', 'Authentication failure']
Comment 5 Liushihui 2017-11-09 02:16:37 EST
Please ignore comment4 since the virt-who version is wrong. update it as the following:

In virt-who-0.21.0-1.el7.noarch, No matter /var/lib/virt-who/key is exist or not, when configure encrypted_password to null or error value(encrypted_password= or encrypted_password=xxxx), failed to start virt-who service and error info as the following:

2017-11-09 06:53:09,370 [virtwho.config ERROR] MainProcess(26373):MainThread @config.py:init_config:1336 - Required option: "password" is missing in: "xen"
2017-11-09 06:53:09,370 [virtwho.init ERROR] MainProcess(26373):MainThread @main.py:main:139 - virt-who can't be started: no valid configuration found

Expected result:
Since configure password to null or error value(password= or password=xxxx), virt-who still can start and error info as the following. when set encrypted_password to null or wrong value, virt-who should be started normally and show the same error info
2017-11-09 07:08:42,153 [virtwho.xen ERROR] MainProcess(26417):Thread-2 @xen.py:login:118 - Unable to login to XENserver https://10.73.131.203
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/virtwho/virt/xen/xen.py", line 107, in login
    self.session.xenapi.login_with_password(self.username, self.password)
  File "/usr/lib/python2.7/site-packages/virtwho/virt/xen/XenAPI.py", line 226, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python2.7/site-packages/virtwho/virt/xen/XenAPI.py", line 122, in xenapi_request
    self._login(methodname, params)
  File "/usr/lib/python2.7/site-packages/virtwho/virt/xen/XenAPI.py", line 145, in _login
    result = _parse_result(getattr(self, 'session.%s' % method)(*params))
  File "/usr/lib/python2.7/site-packages/virtwho/virt/xen/XenAPI.py", line 200, in _parse_result
    raise Failure(result['ErrorDescription'])
Failure: ['SESSION_AUTHENTICATION_FAILED', 'root', 'Authentication failure']
2017-11-09 07:08:42,154 [virtwho.xen ERROR] MainProcess(26417):Thread-2 @virt.py:run:383 - Thread 'xen' fails with error: ['SESSION_AUTHENTICATION_FAILED', 'root', 'Authentication failure']

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