
This is a multipart message in MIME format. ------=_NextPart_000_00C9_01D1E746.5B825490 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable =20 I do make a mistake because I just print os.getuid() show the user root; = but os.geteuid() show the current user is still vdsm; =20 Anyway , I still don=E2=80=99t know how to debug vdsm, I cann=E2=80=99t = log in to centos with user VDSM, because I don=E2=80=99t know the passwd = of user vdsm and if I changed the password, the service vdsmd will = cann=E2=80=99t start. =20 You told me =E2=80=9Cshould follow the devel setup wiki=E2=80=9D , = what=E2=80=99s the true link of vdsm devel setup wiki ? I can=E2=80=99t = get useful information in ovirt.org or google. =20 =20 Thank you =20 =E5=8F=91=E4=BB=B6=E4=BA=BA: Michal Skrivanek = [mailto:mskrivan@redhat.com]=20 =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2016=E5=B9=B47=E6=9C=8826=E6=97=A5 = 5:00 =E6=94=B6=E4=BB=B6=E4=BA=BA: lifuqiong =E6=8A=84=E9=80=81: users; devel =E4=B8=BB=E9=A2=98: Re: [ovirt-devel] Debug vdsm 4.0.0 report error: = libvirt: XML-RPC error : Failed to connect socket to = '/var/run/libvirt/libvirt-sock': Permission denied =20 =20 On 25 Jul 2016, at 21:50, Sandro Bonazzola <sbonazzo@redhat.com> wrote: Adding some people from virt team. Il 23/Lug/2016 11:44, "lifuqiong" <lifuqiong@cncloudsec.com> ha scritto:
I debugged vdsm with PyCharm, And I logged on my Centos 7.2 with root, =
and get an error as follows:
=20
Problem:
=20
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 =3D clientIF.getInstance(irs, log, scheduler)
File "/usr/share/vdsm/clientIF.py", line 204, in getInstance
cls._instance =3D 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 =3D 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=3D10, sleep=3D0.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
=20
Investitate:
According to the traceback above, the code in libvirt.py as below, and =
os.geteuid() get =E2=80=980=E2=80=99 which shows the current user is = root; =20 vdsm is not supposed to be run under root user. For debugging you should = follow the devel setup wiki and not change a regular host.=20 Depends what you modified, it's impossible to say from what you = described....but a general advice is you simply don't do that:)
=20
def openAuth(uri, auth, flags=3D0):
#print os.geteuid()
ret =3D libvirtmod.virConnectOpenAuth(uri, auth, flags)
if ret is None:raise libvirtError('virConnectOpenAuth() failed')
return virConnect(_obj=3Dret)
=20
[root@server117 libvirt]# ll /var/run/libvirt/libvirt-sock
srwxrwx---. 1 root qemu 0 Jul 19 23:43 /var/run/libvirt/libvirt-sock
=20
According that, root should not get an Permission denied error ? But =
why?
=20
And I setenforce=3D0 , and still show Perssion denied error.
=20
What=E2=80=99s the reason? And how to solve it?
=20
Thank you.
_______________________________________________ Devel mailing list Devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/devel
------=_NextPart_000_00C9_01D1E746.5B825490 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable <html xmlns:v=3D"urn:schemas-microsoft-com:vml" = xmlns:o=3D"urn:schemas-microsoft-com:office:office" = xmlns:w=3D"urn:schemas-microsoft-com:office:word" = xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" = xmlns=3D"http://www.w3.org/TR/REC-html40"><head><meta = http-equiv=3DContent-Type content=3D"text/html; charset=3Dutf-8"><meta = name=3DGenerator content=3D"Microsoft Word 14 (filtered = medium)"><style><!-- /* Font Definitions */ @font-face {font-family:=E5=AE=8B=E4=BD=93; panose-1:2 1 6 0 3 1 1 1 1 1;} @font-face {font-family:=E5=AE=8B=E4=BD=93; panose-1:2 1 6 0 3 1 1 1 1 1;} @font-face {font-family:Calibri; panose-1:2 15 5 2 2 2 4 3 2 4;} @font-face {font-family:"\@=E5=AE=8B=E4=BD=93"; panose-1:2 1 6 0 3 1 1 1 1 1;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {margin:0cm; margin-bottom:.0001pt; font-size:12.0pt; font-family:=E5=AE=8B=E4=BD=93;} a:link, span.MsoHyperlink {mso-style-priority:99; color:blue; text-decoration:underline;} a:visited, span.MsoHyperlinkFollowed {mso-style-priority:99; color:purple; text-decoration:underline;} p {mso-style-priority:99; mso-margin-top-alt:auto; margin-right:0cm; mso-margin-bottom-alt:auto; margin-left:0cm; font-size:12.0pt; font-family:=E5=AE=8B=E4=BD=93;} span.EmailStyle18 {mso-style-type:personal-reply; font-family:"Calibri","sans-serif"; color:#1F497D;} .MsoChpDefault {mso-style-type:export-only; font-size:10.0pt;} @page WordSection1 {size:612.0pt 792.0pt; margin:72.0pt 90.0pt 72.0pt 90.0pt;} div.WordSection1 {page:WordSection1;} --></style><!--[if gte mso 9]><xml> <o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" /> </xml><![endif]--><!--[if gte mso 9]><xml> <o:shapelayout v:ext=3D"edit"> <o:idmap v:ext=3D"edit" data=3D"1" /> </o:shapelayout></xml><![endif]--></head><body lang=3DZH-CN link=3Dblue = vlink=3Dpurple><div class=3DWordSection1><p class=3DMsoNormal><span = lang=3DEN-US = style=3D'font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497= D'><o:p> </o:p></span></p><p class=3DMsoNormal><span lang=3DEN-US = style=3D'font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497= D'>I do make a mistake because I just print os.getuid() show the user = root; but os.geteuid() show the current user is still = vdsm;<o:p></o:p></span></p><p class=3DMsoNormal><span lang=3DEN-US = style=3D'font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497= D'><o:p> </o:p></span></p><p class=3DMsoNormal><span lang=3DEN-US = style=3D'font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497= D'>Anyway , I still don=E2=80=99t know how to debug vdsm, I = cann=E2=80=99t log in to centos with user VDSM, because I don=E2=80=99t = know the passwd of user vdsm and if I changed the password, the service = vdsmd will cann=E2=80=99t start.<o:p></o:p></span></p><p = class=3DMsoNormal><span lang=3DEN-US = style=3D'font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497= D'><o:p> </o:p></span></p><p class=3DMsoNormal><span lang=3DEN-US = style=3D'font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497= D'>You told me =E2=80=9C</span><span lang=3DEN-US>should follow the = devel setup wiki</span><span lang=3DEN-US = style=3D'font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497= D'>=E2=80=9D , what=E2=80=99s the true link of vdsm devel setup wiki = ?=C2=A0 I can=E2=80=99t get useful information in ovirt.org or = google.<o:p></o:p></span></p><p class=3DMsoNormal><span lang=3DEN-US = style=3D'font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497= D'><o:p> </o:p></span></p><p class=3DMsoNormal><span lang=3DEN-US = style=3D'font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497= D'><o:p> </o:p></span></p><p class=3DMsoNormal><span lang=3DEN-US = style=3D'font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497= D'>Thank you<o:p></o:p></span></p><p class=3DMsoNormal><span = lang=3DEN-US = style=3D'font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497= D'><o:p> </o:p></span></p><div><div = style=3D'border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm = 0cm 0cm'><p class=3DMsoNormal><b><span = style=3D'font-size:10.0pt'>=E5=8F=91=E4=BB=B6=E4=BA=BA<span = lang=3DEN-US>:</span></span></b><span lang=3DEN-US = style=3D'font-size:10.0pt'> Michal Skrivanek = [mailto:mskrivan@redhat.com] <br></span><b><span = style=3D'font-size:10.0pt'>=E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4<span = lang=3DEN-US>:</span></span></b><span lang=3DEN-US = style=3D'font-size:10.0pt'> 2016</span><span = style=3D'font-size:10.0pt'>=E5=B9=B4<span = lang=3DEN-US>7</span>=E6=9C=88<span lang=3DEN-US>26</span>=E6=97=A5<span = lang=3DEN-US> 5:00<br></span><b>=E6=94=B6=E4=BB=B6=E4=BA=BA<span = lang=3DEN-US>:</span></b><span lang=3DEN-US> = lifuqiong<br></span><b>=E6=8A=84=E9=80=81<span = lang=3DEN-US>:</span></b><span lang=3DEN-US> users; = devel<br></span><b>=E4=B8=BB=E9=A2=98<span = lang=3DEN-US>:</span></b><span lang=3DEN-US> Re: [ovirt-devel] Debug = vdsm 4.0.0 report error: libvirt: XML-RPC error : Failed to connect = socket to '/var/run/libvirt/libvirt-sock': Permission = denied<o:p></o:p></span></span></p></div></div><p = class=3DMsoNormal><span lang=3DEN-US><o:p> </o:p></span></p><div><p = class=3DMsoNormal><span = lang=3DEN-US><o:p> </o:p></span></p></div><div><p class=3DMsoNormal = style=3D'margin-bottom:12.0pt'><span lang=3DEN-US><br>On 25 Jul 2016, at = 21:50, Sandro Bonazzola <<a = href=3D"mailto:sbonazzo@redhat.com">sbonazzo@redhat.com</a>> = wrote:<o:p></o:p></span></p></div><blockquote = style=3D'margin-top:5.0pt;margin-bottom:5.0pt'><div><p><span = lang=3DEN-US>Adding some people from virt = team.<o:p></o:p></span></p><p><span lang=3DEN-US>Il 23/Lug/2016 11:44, = "lifuqiong" <<a = href=3D"mailto:lifuqiong@cncloudsec.com">lifuqiong@cncloudsec.com</a>>= ha scritto:<br>><br>> I debugged vdsm with PyCharm, And I logged = on my Centos 7.2 with root, and get an error as = follows:<br>><br>> <br>><br>> Problem:<br>><br>> = <br>><br>> Traceback (most recent call = last):<br>><br>> File "/usr/share/vdsm/vdsm", = line 149, in run<br>><br>> = serve_clients(log)<br>><br>> File = "/usr/share/vdsm/vdsm", line 104, in = serve_clients<br>><br>> cif =3D = clientIF.getInstance(irs, log, scheduler)<br>><br>> File = "/usr/share/vdsm/clientIF.py", line 204, in = getInstance<br>><br>> cls._instance =3D = clientIF(irs, log, scheduler)<br>><br>> File = "/usr/share/vdsm/clientIF.py", line 106, in = __init__<br>><br>> = secret.clear()<br>><br>> File = "/usr/lib/python2.7/site-packages/vdsm/virt/secret.py", line = 92, in clear<br>><br>> con =3D = libvirtconnection.get()<br>><br>> File = "/usr/lib/python2.7/site-packages/vdsm/libvirtconnection.py", = line 163, in get<br>><br>> = password)<br>><br>> File = "/usr/lib/python2.7/site-packages/vdsm/libvirtconnection.py", = line 99, in open_connection<br>><br>> return = utils.retry(libvirtOpen, timeout=3D10, sleep=3D0.2)<br>><br>> = File "/usr/lib/python2.7/site-packages/vdsm/utils.py", = line 546, in retry<br>><br>> return = func()<br>><br>> File = "/usr/lib64/python2.7/site-packages/libvirt.py", line 105, in = openAuth<br>><br>> if ret is None:raise = libvirtError('virConnectOpenAuth() failed')<br>><br>> = libvirtError: Failed to connect socket to = '/var/run/libvirt/libvirt-sock': Permission denied<br>><br>> = <br>><br>> Investitate:<br>><br>> According to the = traceback above, the code in libvirt.py as below, and os.geteuid() = get =E2=80=980=E2=80=99 which shows the current user is = root;<o:p></o:p></span></p></div></blockquote><div><p = class=3DMsoNormal><span = lang=3DEN-US><o:p> </o:p></span></p></div><p = class=3DMsoNormal><span lang=3DEN-US>vdsm is not supposed to be run = under root user. For debugging you should follow the devel setup wiki = and not change a regular host. <o:p></o:p></span></p><div><p = class=3DMsoNormal><span lang=3DEN-US>Depends what you modified, it's = impossible to say from what you described....but a general advice is you = simply don't do that:)<br><br><o:p></o:p></span></p><div><p><span = lang=3DEN-US>><br>> <br>><br>> def openAuth(uri, auth, = flags=3D0):<br>><br>> = #print = os.geteuid()<br>><br>> ret =3D = libvirtmod.virConnectOpenAuth(uri, auth, flags)<br>><br>> = if ret is None:raise = libvirtError('virConnectOpenAuth() failed')<br>><br>> return = virConnect(_obj=3Dret)<br>><br>> <br>><br>> = [root@server117 libvirt]# ll = /var/run/libvirt/libvirt-sock<br>><br>> srwxrwx---. 1 root qemu 0 = Jul 19 23:43 /var/run/libvirt/libvirt-sock<br>><br>> = <br>><br>> According that, root should not get an Permission = denied error ? But why?<br>><br>> <br>><br>> And I = setenforce=3D0 , and still show Perssion denied error.<br>><br>> = <br>><br>> What=E2=80=99s the reason? And how to solve = it?<br>><br>> <br>><br>> Thank = you.<br>><br>><br>> = _______________________________________________<br>> Devel mailing = list<br>> <a = href=3D"mailto:Devel@ovirt.org">Devel@ovirt.org</a><br>> <a = href=3D"http://lists.ovirt.org/mailman/listinfo/devel">http://lists.ovirt= .org/mailman/listinfo/devel</a><o:p></o:p></span></p></div></div></div></= body></html> ------=_NextPart_000_00C9_01D1E746.5B825490--