Bug 1380147

Summary: vdsClient should print user friendly errors instead of tracebacks
Product: Red Hat Enterprise Virtualization Manager Reporter: Shivraj <shipatil>
Component: vdsmAssignee: Dan Kenigsberg <danken>
Status: CLOSED WONTFIX QA Contact: sefi litmanovich <slitmano>
Severity: high Docs Contact:
Priority: high    
Version: 3.6.8CC: bazulay, gklein, lsurette, mgoldboi, michal.skrivanek, srevivo, ycui, ykaul, ylavi
Target Milestone: ---   
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: 2016-11-30 16:12:21 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Integration RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Shivraj 2016-09-28 18:56:21 UTC
Description of problem:

# hosted-engine --add-console-password --password=FOO
Unexpected exception

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

rhevm-3.6.8.1-0.1.el6
Red Hat Enterprise Linux Server release 7.2 (Maipo)

How reproducible:


Steps to Reproduce:
1.Install Red Hat Enterprise Linux Server release 7.2 (Maipo)
2.hosted-engine --add-console-password --password=FOO
3.

Actual results:
cannot set he vm console password

Expected results:
should work

Additional info:
no additional output

Comment 1 Sandro Bonazzola 2016-10-04 09:33:28 UTC
(In reply to Shivraj from comment #0)

> Expected results:
> should work

Just to clarify, 'should work' here means to avoid to show a traceback when the command fails to connect to the qemu process for setting the console password, printing a clean error message.

Comment 2 Sandro Bonazzola 2016-10-04 09:46:34 UTC
hosted-engine --add-console-password --password=FOO
just call:

vdsClient -s localhost setVmTicket "${vmid}" "${pass}" 120

So the traceback is generated by vdsClient.
Changing the component to vdsm.

Comment 3 Sandro Bonazzola 2016-10-04 09:49:13 UTC
Example of traceback:

# hosted-engine --add-console-password --password=FOO
Traceback (most recent call last):
  File "/usr/share/vdsm/vdsClient.py", line 3001, in <module>
    code, message = commands[command][0](commandArgs)
  File "/usr/share/vdsm/vdsClient.py", line 480, in do_setVmTicket
    params))
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1233, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1587, in __request
    verbose=self.__verbose
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1273, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1303, in single_request
    response = h.getresponse(buffering=True)
  File "/usr/lib64/python2.7/httplib.py", line 1089, in getresponse
    response.begin()
  File "/usr/lib64/python2.7/httplib.py", line 444, in begin
    version, status, reason = self._read_status()
  File "/usr/lib64/python2.7/httplib.py", line 400, in _read_status
    line = self.fp.readline(_MAXLINE + 1)
  File "/usr/lib64/python2.7/socket.py", line 476, in readline
    data = self._sock.recv(self._rbufsize)
error: [Errno 104] Connection reset by peer

Moving to virt team.

Comment 4 Sandro Bonazzola 2016-10-04 09:49:44 UTC
Package: vdsm-4.17.35-1.el7ev.noarch

Comment 7 Michal Skrivanek 2016-10-12 09:44:01 UTC
it works for normal VMs, so this is either a timing issue (e.g. requesting it when the VM is not in the right state), or the VM is not "registered" in vdsm it is not known and the request won't go through) - you should not mix managing the HE VM directly and through vdsm. 

To see if it is indeed the case I would suggest to check that such VM is listed in "list" output and then try setVmTicket.

Comment 8 Sandro Bonazzola 2016-10-13 08:15:25 UTC
(In reply to Michal Skrivanek from comment #7)
> it works for normal VMs, so this is either a timing issue (e.g. requesting
> it when the VM is not in the right state), or the VM is not "registered" in
> vdsm it is not known and the request won't go through) - you should not mix
> managing the HE VM directly and through vdsm. 
> 
> To see if it is indeed the case I would suggest to check that such VM is
> listed in "list" output and then try setVmTicket.

Not sure why this bug has been moved back to integration.
We're not maintaining vdsClient code and here the only issue is that vdsClient writes a traceback instead of a user friendly error.

Comment 9 Michal Skrivanek 2016-10-13 08:42:53 UTC
because it is an integration issue. As noted in comment #8 it is either timing or wrong usage (to try to set a ticket at certain time). Each tool works ok on its own. Plus vdsClient is deprecated and unlikely to get a fix unless it is a security one.

So my suggestion would be to close this without a fix, or invest time to improve error reporting(or when you can/cannot set console) in hosted-engine tool, or remove that code and switch to serial console access only which is supposedly a bit more suitable for HE VM, and doesn't require further dependencies to access it.