[Pkg-libvirt-maintainers] Bug#659860: virt-manager: seems to connect via qemu+ssh but closes connection immediately again

Martin Steigerwald ms at teamix.de
Tue Feb 14 10:40:05 UTC 2012


Package: virt-manager
Version: 0.9.1-1
Severity: important

Dear Maintainer,

I installed QEMU+KVM+libvirt-bin onto a server with Debian Wheezy.
I tried to access this server with virt-manager from my workstation
using key based SSH authentification without need to enter key
password due to running SSH agent.

When I try to connect to the server it shows that it connects but
then very quickly says it is not connected again.

virt-manager --debug shows:

2012-02-14 11:14:27,190 (connect:108): Showing open connection
2012-02-14 11:14:45,471 (connect:350): Generate URI=qemu+ssh://root@frisbie.of.teamix.net/system, auto=False
2012-02-14 11:14:45,472 (connect:103): Closing open connection
2012-02-14 11:14:45,479 (manager:171): Showing manager
2012-02-14 11:14:45,482 (connection:991): Scheduling background open thread for qemu+ssh://root@frisbie.of.teamix.net/system
2012-02-14 11:14:45,483 (connection:1177): Background 'open connection' thread is running
2012-02-14 11:14:45,712 (connection:1227): Background open thread complete, scheduling notify
2012-02-14 11:14:45,717 (connection:1232): Notifying open result
2012-02-14 11:14:45,722 (cli:83): Uncaught exception:
Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/manager.py", line 665, in _connect_error
    if conn.is_remote() and re.search(r"nc: .* -- 'U'", details):
UnboundLocalError: local variable 'details' referenced before assignment

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/manager.py", line 665, in _connect_error
    if conn.is_remote() and re.search(r"nc: .* -- 'U'", details):
UnboundLocalError: local variable 'details' referenced before assignment


When I try again I get:

2012-02-14 11:15:41,505 (connection:991): Scheduling background open thread for qemu+ssh://root@frisbie.of.teamix.net/system
2012-02-14 11:15:41,506 (connection:1177): Background 'open connection' thread is running
2012-02-14 11:15:41,623 (connection:1227): Background open thread complete, scheduling notify
2012-02-14 11:15:41,624 (connection:1232): Notifying open result
2012-02-14 11:15:41,627 (cli:83): Uncaught exception:
Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/manager.py", line 665, in _connect_error
    if conn.is_remote() and re.search(r"nc: .* -- 'U'", details):
UnboundLocalError: local variable 'details' referenced before assignment

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/manager.py", line 665, in _connect_error
    if conn.is_remote() and re.search(r"nc: .* -- 'U'", details):
UnboundLocalError: local variable 'details' referenced before assignment


Expected results:

virt-manager connects to the server or if it can't gives a meaningful
error message.


Regarding those netcat.openbsd bug reports that are probably related I
do have netcat.openbsd on my workstation and the server:

mango:~# LANG=C update-alternatives --display nc
nc - auto mode
  link currently points to /bin/nc.openbsd
/bin/nc.openbsd - priority 50
  slave nc.1.gz: /usr/share/man/man1/nc_openbsd.1.gz
  slave netcat: /bin/nc.openbsd
  slave netcat.1.gz: /usr/share/man/man1/nc_openbsd.1.gz
/bin/nc.traditional - priority 10
  slave nc.1.gz: /usr/share/man/man1/nc.traditional.1.gz
  slave netcat: /bin/nc.traditional
  slave netcat.1.gz: /usr/share/man/man1/nc.traditional.1.gz
Current 'best' version is '/bin/nc.openbsd'.

root at frisbie:~# LANG=C update-alternatives --display nc
nc - auto mode
  link currently points to /bin/nc.openbsd
/bin/nc.openbsd - priority 50
  slave nc.1.gz: /usr/share/man/man1/nc_openbsd.1.gz
  slave netcat: /bin/nc.openbsd
  slave netcat.1.gz: /usr/share/man/man1/nc_openbsd.1.gz
/bin/nc.traditional - priority 10
  slave nc.1.gz: /usr/share/man/man1/nc.traditional.1.gz
  slave netcat: /bin/nc.traditional
  slave netcat.1.gz: /usr/share/man/man1/nc.traditional.1.gz
Current 'best' version is '/bin/nc.openbsd'.


Opening an SSH connection to the server works without password due
to SSH agent:

ms at mango:~> ssh root at frisbie
Linux frisbie 3.2.0-1-amd64 #1 SMP Sun Feb 5 15:17:15 UTC 2012 x86_64
[…]
Last login: Tue Feb 14 10:34:07 2012 from mango.of.teamix.net
root at frisbie:~#

libvirtd is running there:

root at frisbie:~# ps aux | grep libvirt | grep -v grep
root      1403  0.0  0.0 264532  6628 ?        Sl   09:30   0:00 /usr/sbin/libvirtd -d


Aside the non-working functionality there seems to be a programming
error in "/usr/share/virt-manager/virtManager/manager.py" in function
connect_error, line 665 that might cause that I do not see an error
message. See the debug output above. Maybe thats the main bug here,
feel free to retitle as needed.

Ah, this seems to be in a check for some netcat arguments:

 664             hints = []
 665             if conn.is_remote() and re.search(r"nc: .* -- 'U'", details):
 666                 hints.append(
 667                     _("\n - The remote netcat understands the '-U' option"))


So maybe this is actually a dupe of some of the netcat related bugs.
Feel free to merge if so.

Okay, when I fix this by moving some source lines around, I get the following
error message:

Unable to connect to libvirt:

Cannot recv data: Value too large for defined data typeVerify that:
 - The 'libvirtd' daemon has been started

Unable to connect to libvirt:

Cannot recv data: Value too large for defined data type

Libvirt URI is: qemu+ssh://root@frisbie.of.teamix.net/system

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/connection.py", line 1185, in _open_thread
    self.vmm = self._try_open()
  File "/usr/share/virt-manager/virtManager/connection.py", line 1167, in _try_open
    flags)
  File "/usr/lib/python2.7/dist-packages/libvirt.py", line 102, in openAuth
    if ret is None:raise libvirtError('virConnectOpenAuth() failed')
libvirtError: Cannot recv data: Value too large for defined data type


On the console I have:

2012-02-14 11:33:19,911 (connection:991): Scheduling background open thread for qemu+ssh://root@frisbie.of.teamix.net/system
2012-02-14 11:33:19,914 (connection:1177): Background 'open connection' thread is running
2012-02-14 11:33:20,031 (connection:1227): Background open thread complete, scheduling notify
2012-02-14 11:33:20,032 (connection:1232): Notifying open result
2012-02-14 11:33:20,035 (error:80): dialog message: Unable to connect to libvirt:

Cannot recv data: Value too large for defined data typeVerify that:
 - The 'libvirtd' daemon has been started : Unable to connect to libvirt:

Cannot recv data: Value too large for defined data typeVerify that:
 - The 'libvirtd' daemon has been started

Unable to connect to libvirt:

Cannot recv data: Value too large for defined data type

Libvirt URI is: qemu+ssh://root@frisbie.of.teamix.net/system

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/connection.py", line 1185, in _open_thread
    self.vmm = self._try_open()
  File "/usr/share/virt-manager/virtManager/connection.py", line 1167, in _try_open
    flags)
  File "/usr/lib/python2.7/dist-packages/libvirt.py", line 102, in openAuth
    if ret is None:raise libvirtError('virConnectOpenAuth() failed')
libvirtError: Cannot recv data: Value too large for defined data type


So there seems to be another programming error.

So these are at least two bugs:
- local variable not defined on in
  /usr/share/virt-manager/virtManager/manager.py on line 665
  (I will attach a patch for this.)

- value too large bug in /usr/lib/python2.7/dist-packages/libvirt.py

Can you split my bug report into two as needed?


Thanks,
Martin

-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (500, 'testing'), (450, 'unstable'), (110, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 3.2.0-1-686-pae (SMP w/2 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages virt-manager depends on:
ii  gconf2                   2.32.4-1
ii  librsvg2-common          2.34.2-2
ii  python                   2.7.2-10
ii  python-dbus              0.84.0-3
ii  python-glade2            2.24.0-2
ii  python-gnome2            2.28.1-3
ii  python-gtk-vnc           0.5.0-3
ii  python-gtk2              2.24.0-2
ii  python-ipy               1:0.75-1
ii  python-libvirt           0.9.8-2
ii  python-spice-client-gtk  0.7-3
ii  python-support           1.0.14
ii  python-urlgrabber        3.9.1-4
ii  python-vte               1:0.28.2-4
ii  virtinst                 0.600.1-1

Versions of packages virt-manager recommends:
ii  gnome-icon-theme  3.2.1.2-1
ii  libvirt-bin       0.9.8-2

Versions of packages virt-manager suggests:
ii  gnome-keyring        3.2.2-2
ii  hal                  0.5.14-7
ii  python-gnomekeyring  2.32.0-4+b2
ii  python-guestfs       <none>
ii  ssh-askpass          <none>
ii  virt-viewer          0.4.2-1

-- no debconf information
-------------- next part --------------
A non-text attachment was scrubbed...
Name: manager.py-unbound-local-variable-fix.patch
Type: text/x-diff
Size: 1000 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-libvirt-maintainers/attachments/20120214/dbb47bf2/attachment-0001.patch>


More information about the Pkg-libvirt-maintainers mailing list