[ovirt-users] Debug vdsm 4.0.0 report error: libvirt: XML-RPC error : Failed to connect socket to '/var/run/libvirt/libvirt-sock': Permission denied

lifuqiong lifuqiong at cncloudsec.com
Sat Jul 23 09:39:00 UTC 2016


I debugged vdsm with PyCharm, And I logged on my Centos 7.2 with root,  and
get an error as follows:

 

Problem:

 

Traceback (most recent call last):

  File "/usr/share/vdsm/vdsm", line 149, in run

    serve_clients(log)

  File "/usr/share/vdsm/vdsm", line 104, in serve_clients

    cif = clientIF.getInstance(irs, log, scheduler)

  File "/usr/share/vdsm/clientIF.py", line 204, in getInstance

    cls._instance = clientIF(irs, log, scheduler)

  File "/usr/share/vdsm/clientIF.py", line 106, in __init__

    secret.clear()

  File "/usr/lib/python2.7/site-packages/vdsm/virt/secret.py", line 92, in
clear

    con = libvirtconnection.get()

  File "/usr/lib/python2.7/site-packages/vdsm/libvirtconnection.py", line
163, in get

    password)

  File "/usr/lib/python2.7/site-packages/vdsm/libvirtconnection.py", line
99, in open_connection

    return utils.retry(libvirtOpen, timeout=10, sleep=0.2)

  File "/usr/lib/python2.7/site-packages/vdsm/utils.py", line 546, in retry

    return func()

  File "/usr/lib64/python2.7/site-packages/libvirt.py", line 105, in
openAuth

    if ret is None:raise libvirtError('virConnectOpenAuth() failed')

libvirtError: Failed to connect socket to '/var/run/libvirt/libvirt-sock':
Permission denied

 

Investitate:

According to the traceback above, the code in libvirt.py as below, and
os.geteuid() get '0' which shows the current user is root;

 

def openAuth(uri, auth, flags=0):

         #print os.geteuid()

    ret = libvirtmod.virConnectOpenAuth(uri, auth, flags)

    if ret is None:raise libvirtError('virConnectOpenAuth() failed')

return virConnect(_obj=ret)

 

[root at server117 libvirt]# ll /var/run/libvirt/libvirt-sock

srwxrwx---. 1 root qemu 0 Jul 19 23:43 /var/run/libvirt/libvirt-sock

 

According that, root should not get an Permission denied error ? But why?

 

And I setenforce=0 , and still show Perssion denied error.

 

What's the reason? And how to solve it?

 

Thank you.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ovirt.org/pipermail/users/attachments/20160723/03b98a63/attachment-0001.html>


More information about the Users mailing list