Red Hat Bugzilla – Bug 768473
import libvirt prints "WARNING: no socket to connect to"
Last modified: 2012-01-18 21:19:47 EST
When using the python library for libvirt it prints a warning when you import libvirt. I tracked it down to the libvirtmod binary module.
Importing a module should not print anything.
You didn't mention what version of libvirt you're using, but I see no warning when I import libvirt using a fully updated F16. Can you retry this with a fully updated F16 and if it reproduces, provide the warning message, the version of the libvirt and python packages and a trivial example script (maybe that's as simple as 'import libvirt').
whoops, sorry about that. Ends up I had libvirt-python installed, but didn't have virtualization setup on the machine.
Re-opening - I reproduced it. The culprit is that the libvirt testsuite invokes virsh with a super-restricted environment (_just_ LANG=C and nothing else, not even PATH), and gnutls_global_init() doesn't like that.
#0 write () at ../sysdeps/unix/syscall-template.S:82
#1 0x00007ffff3784f63 in _IO_new_file_write (f=0x7ffff3abe160,
data=0x7fffffffae30, n=33) at fileops.c:1289
#2 0x00007ffff3784e2a in new_do_write (fp=0x7ffff3abe160,
data=0x7fffffffae30 "WARNING: no socket to connect to\n\003", to_do=33)
#3 0x00007ffff37858de in _IO_new_file_xsputn (n=33, data=<optimized out>,
f=0x7ffff3abe160) at fileops.c:1383
#4 _IO_new_file_xsputn (f=0x7ffff3abe160, data=<optimized out>, n=33)
#5 0x00007ffff375a236 in buffered_vfprintf (s=0x7ffff3abe160,
format=<optimized out>, args=<optimized out>) at vfprintf.c:2228
#6 0x00007ffff375563e in _IO_vfprintf_internal (s=0x7ffff3abe160,
format=0x7fffee636f6f "%s\n", ap=0x7fffffffd5a8) at vfprintf.c:1256
#7 0x00007ffff381296b in ___fprintf_chk (fp=0x7ffff3abe160, flag=1,
format=<optimized out>) at fprintf_chk.c:37
#8 0x00007fffee634e32 in ?? () from /usr/lib64/pkcs11/gnome-keyring-pkcs11.so
#9 0x00007fffee634f06 in ?? () from /usr/lib64/pkcs11/gnome-keyring-pkcs11.so
#10 0x00007fffee62dd71 in ?? () from /usr/lib64/pkcs11/gnome-keyring-pkcs11.so
#11 0x00007fffee62e22e in ?? () from /usr/lib64/pkcs11/gnome-keyring-pkcs11.so
#12 0x00007ffff23a9b97 in initialize_module_unlocked_reentrant (mod=0x663b90)
#13 initialize_module_unlocked_reentrant (mod=0x663b90) at modules.c:503
#14 0x00007ffff23aa085 in _p11_kit_initialize_registered_unlocked_reentrant ()
#15 0x00007ffff23aa74d in p11_kit_initialize_registered () at modules.c:736
#16 0x00007ffff6113495 in initialize_automatic_p11_kit () at pkcs11.c:442
#17 gnutls_pkcs11_init (flags=<optimized out>, deprecated_config_file=0x0)
#18 0x00007ffff60fd032 in gnutls_global_init () at gnutls_global.c:252
#19 0x00007ffff79ce9a8 in virNetTLSInit () at rpc/virnettlscontext.c:1432
#20 0x00007ffff7952e24 in virInitialize () at libvirt.c:412
#21 0x0000000000435de1 in main (argc=4, argv=0x7fffffffe018) at virsh.c:18663
*** This bug has been marked as a duplicate of bug 782725 ***