Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1243684 - Virsh client doesn't print error message when the connection is reset by server on some ocassion.
Virsh client doesn't print error message when the connection is reset by serv...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt (Show other bugs)
7.2
x86_64 Linux
unspecified Severity medium
: rc
: ---
Assigned To: Jiri Denemark
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-07-16 02:03 EDT by Fangge Jin
Modified: 2016-11-03 14:19 EDT (History)
6 users (show)

See Also:
Fixed In Version: libvirt-1.3.1-1.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-11-03 14:19:47 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)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:2577 normal SHIPPED_LIVE Moderate: libvirt security, bug fix, and enhancement update 2016-11-03 08:07:06 EDT

  None (edit)
Description Fangge Jin 2015-07-16 02:03:47 EDT
Description:
 Virsh client doesn't print error message when the connection is reset by server on some ocassion.

Version:
libvirt-1.2.17-2.el7.x86_64
qemu-kvm-rhev-2.3.0-9.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
0.Prepare two hosts: server and client.

1.On clinet:
# virsh -k0 -c qemu+ssh://10.66.6.6/system
root@10.66.6.6's password:
Welcome to virsh, the virtualization interactive terminal.

Type:  'help' for help with commands
       'quit' to quit

virsh #

2.Set iptables rule on client:
# iptables -A INPUT -s 10.66.6.6 -j DROP

3.Within 30s, issue command "list" on client, it will hang:
virsh # list

4.After 30s when the connection has been reset by server, clear iptables rule on client:
# iptables -F

5.Wait several minutes, "list" will return without error:
virsh # list
 Id    Name                           State
----------------------------------------------------

6."list" again, it will reconnect to the server and list the running domain on server.
virsh # list
root@10.66.6.6's password:
error: Reconnected to the hypervisor
 Id    Name                           State
----------------------------------------------------
 47    rhel7-3                        running
 48    rhel7-4                        running
 51    rhel7-1                        running


Actual results:
In step5, "list" return without error.

Expected results:
In step5, "list" should return with the following error:
# list
error: Failed to list domains
error: Cannot recv data: Ncat: Broken pipe.: Connection reset by peer

Additional info:
If I "list" AFTER 30s instead of within 30s in step3, "list" can return with the expected error in step5.
Comment 3 Jiri Denemark 2016-03-03 07:18:58 EST
This should be fixed upstream since v1.2.19-114-g035947e:

commit 035947eb8743306a421b3c71f26c75f749000dfc
Author:     Jiri Denemark <jdenemar@redhat.com>
AuthorDate: Tue Sep 15 16:46:07 2015 +0200
Commit:     Jiri Denemark <jdenemar@redhat.com>
CommitDate: Wed Sep 23 13:09:50 2015 +0200

    virsh: Notify users about disconnects
    
    After my "client rpc: Report proper error for keepalive disconnections"
    patch, virsh would no long print a warning when it closes a connection
    to a daemon after a keepalive timeout. Although the warning
    
        virsh # 2015-09-15 10:59:26.729+0000: 642080: info :
        libvirt version: 1.2.19
        2015-09-15 10:59:26.729+0000: 642080: warning :
        virKeepAliveTimerInternal:143 : No response from client
        0x7efdc0a46730 after 1 keepalive messages in 2 seconds
    
    was pretty ugly, it was still useful. This patch brings the useful part
    back while making it much nicer:
    
    virsh # error: Disconnected from qemu:///system due to keepalive timeout
    
    Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Comment 5 Lili Zhu 2016-09-04 09:50:08 EDT

When I execute step5, "list" does return an error:
error: Disconnected from qemu+ssh://10.66.4.117/system due to I/O error

According to your comment, it should report an error like this:
error: Disconnected from qemu:///system due to keepalive timeout


I do not know why. Could you please check whether this error is acceptable?
Comment 6 Jiri Denemark 2016-09-05 07:30:53 EDT
Yeah, both errors are OK.
Comment 7 Lili Zhu 2016-09-06 08:31:45 EDT
Reproduce with libvirt-1.2.17-13.el7_2.5.x86_64 

Verified with the packages:
libvirt-2.0.0-6.el7.x86_64

Test steps:
Steps to Reproduce:
0.Prepare two hosts: server and client.

1.On client:
# virsh -k0 -c qemu+ssh://10.66.4.117/system
root@10.66.4.117's password:
Welcome to virsh, the virtualization interactive terminal.

Type:  'help' for help with commands
       'quit' to quit

virsh #

2.Set iptables rule on client:
# iptables -A INPUT -s 10.66.4.117 -j DROP

3.Within 30s, issue command "list" on client, it will hang:
virsh # list

4.After 30s when the connection has been reset by server, clear iptables rule on client:
# iptables -F

5.Wait several minutes, 
virsh # list


Test results:
error: Disconnected from qemu+ssh://10.66.4.117/system due to I/O error

Virsh client does print error message when the connection is reset by server before the server's keepalive times out.
Comment 9 errata-xmlrpc 2016-11-03 14:19:47 EDT
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, 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://rhn.redhat.com/errata/RHSA-2016-2577.html

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