
--Apple-Mail=_3CB844CF-51EF-43B2-815F-81DB2C6581E5 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8
On 26 Jul 2016, at 08:50, lifuqiong <lifuqiong@cncloudsec.com> wrote: =20 =20 On 26 Jul 2016, at 08:02, lifuqiong <lifuqiong@cncloudsec.com = <mailto:lifuqiong@cncloudsec.com>> wrote: =20 =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 the vdsm account is intentionally disabled for interactive login =20 =20 =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 <http://ovirt.org/> or google. =20 http://www.ovirt.org/develop/developer-guide/vdsm/developers/ = <http://www.ovirt.org/develop/developer-guide/vdsm/developers/> has tips = how to build from source and what packages are needed Anything specific you=E2=80=99re troubleshooting? =20 I do build the source from this instruction , but I want to = set breakpoint to view each step and variable value to understand the = vdsm=E2=80=99s code using python IDE such as Pycharm ,=20 =20 You know that we can implement this debug requirement in ovirt engine = easily, but I can=E2=80=99t implement local debug in vdsm easily, = because vdsm didn=E2=80=99t allow root to run or debug. =20 Is there any debug instruction ?
=20 Thank you Mark =20 Thanks, michal =20 =20 =20 =20 Thank you =20 =E5=8F=91=E4=BB=B6=E4=BA=BA: Michal Skrivanek = [mailto:mskrivan@redhat.com <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: =
=20 =20 =20 On 25 Jul 2016, at 21:50, Sandro Bonazzola <sbonazzo@redhat.com = <mailto:sbonazzo@redhat.com>> wrote: =20 Adding some people from virt team. Il 23/Lug/2016 11:44, "lifuqiong" <lifuqiong@cncloudsec.com = <mailto: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", =
password)
File "/usr/lib/python2.7/site-packages/vdsm/libvirtconnection.py", =
I don=E2=80=99t think it=E2=80=99s possible to debug it from PyCharm, or = any IDE for that matter, easily.=20 It=E2=80=99s a multithreaded application, you can=E2=80=99t really set a = breakpoint without affecting other functionality since some of the = threads need to keep running Best advice is to add a debugging/logging code in places you need, = printing variables you=E2=80=99re interested in. Thanks, michal libvirt: XML-RPC error : Failed to connect socket to = '/var/run/libvirt/libvirt-sock': Permission denied line 163, in get 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 =20
=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 <mailto:Devel@ovirt.org> http://lists.ovirt.org/mailman/listinfo/devel =
--Apple-Mail=_3CB844CF-51EF-43B2-815F-81DB2C6581E5 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 <html><head><meta http-equiv=3D"Content-Type" content=3D"text/html = charset=3Dutf-8"></head><body style=3D"word-wrap: break-word; = -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" = class=3D""><br class=3D""><div><blockquote type=3D"cite" class=3D""><div = class=3D"">On 26 Jul 2016, at 08:50, lifuqiong <<a = href=3D"mailto:lifuqiong@cncloudsec.com" = class=3D"">lifuqiong@cncloudsec.com</a>> wrote:</div><br = class=3D"Apple-interchange-newline"><div class=3D""><div = class=3D"WordSection1" style=3D"page: WordSection1; font-family: = Helvetica; font-size: 12px; font-style: normal; font-variant-caps: = normal; font-weight: normal; letter-spacing: normal; orphans: auto; = text-align: start; text-indent: 0px; text-transform: none; white-space: = normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: = 0px;"><div style=3D"margin: 0cm 0cm 0.0001pt; font-size: 12pt; = font-family: =E5=AE=8B=E4=BD=93;" class=3D""><span lang=3D"EN-US" = class=3D""><o:p class=3D""> </o:p></span></div><div = class=3D""><blockquote style=3D"margin-top: 5pt; margin-bottom: 5pt;" = class=3D""><div class=3D""><div style=3D"margin: 0cm 0cm 0.0001pt; = font-size: 12pt; font-family: =E5=AE=8B=E4=BD=93;" class=3D""><span = lang=3D"EN-US" class=3D"">On 26 Jul 2016, at 08:02, lifuqiong <<a = href=3D"mailto:lifuqiong@cncloudsec.com" style=3D"color: purple; = text-decoration: underline;" class=3D"">lifuqiong@cncloudsec.com</a>> = wrote:<o:p class=3D""></o:p></span></div></div><div style=3D"margin: 0cm = 0cm 0.0001pt; font-size: 12pt; font-family: =E5=AE=8B=E4=BD=93;" = class=3D""><span lang=3D"EN-US" class=3D""><o:p = class=3D""> </o:p></span></div><div class=3D""><div class=3D""><div = style=3D"margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: = =E5=AE=8B=E4=BD=93;" class=3D""><span lang=3D"EN-US" style=3D"font-size: = 10.5pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" = class=3D""> </span><span lang=3D"EN-US" class=3D""><o:p = class=3D""></o:p></span></div></div><div class=3D""><div style=3D"margin: = 0cm 0cm 0.0001pt; font-size: 12pt; font-family: =E5=AE=8B=E4=BD=93;" = class=3D""><span lang=3D"EN-US" style=3D"font-size: 10.5pt; font-family: = Calibri, sans-serif; color: rgb(31, 73, 125);" class=3D"">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;</span><span = lang=3D"EN-US" class=3D""><o:p class=3D""></o:p></span></div></div><div = class=3D""><div style=3D"margin: 0cm 0cm 0.0001pt; font-size: 12pt; = font-family: =E5=AE=8B=E4=BD=93;" class=3D""><span lang=3D"EN-US" = style=3D"font-size: 10.5pt; font-family: Calibri, sans-serif; color: = rgb(31, 73, 125);" class=3D""> </span><span lang=3D"EN-US" = class=3D""><o:p class=3D""></o:p></span></div></div><div class=3D""><div = style=3D"margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: = =E5=AE=8B=E4=BD=93;" class=3D""><span lang=3D"EN-US" style=3D"font-size: = 10.5pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" = class=3D"">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.</span><span lang=3D"EN-US" = class=3D""><o:p = class=3D""></o:p></span></div></div></div></blockquote><div = class=3D""><div style=3D"margin: 0cm 0cm 0.0001pt; font-size: 12pt; = font-family: =E5=AE=8B=E4=BD=93;" class=3D""><span lang=3D"EN-US" = class=3D""><o:p class=3D""> </o:p></span></div></div><div = style=3D"margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: = =E5=AE=8B=E4=BD=93;" class=3D""><span lang=3D"EN-US" class=3D"">the vdsm = account is intentionally disabled for interactive login<o:p = class=3D""></o:p></span></div></div><div class=3D""><div style=3D"margin: = 0cm 0cm 0.0001pt; font-size: 12pt; font-family: =E5=AE=8B=E4=BD=93;" = class=3D""><span lang=3D"EN-US" class=3D""><br class=3D""><br = class=3D""><o:p class=3D""></o:p></span></div><div class=3D""><div = class=3D""><div style=3D"margin: 0cm 0cm 0.0001pt; font-size: 12pt; = font-family: =E5=AE=8B=E4=BD=93;" class=3D""><span lang=3D"EN-US" = style=3D"font-size: 10.5pt; font-family: Calibri, sans-serif; color: = rgb(31, 73, 125);" class=3D""> </span><span lang=3D"EN-US" = class=3D""><o:p class=3D""></o:p></span></div></div><div class=3D""><div = style=3D"margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: = =E5=AE=8B=E4=BD=93;" class=3D""><span lang=3D"EN-US" style=3D"font-size: = 10.5pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" = class=3D"">You told me =E2=80=9C</span><span lang=3D"EN-US" = class=3D"">should follow the devel setup wiki</span><span lang=3D"EN-US" = style=3D"font-size: 10.5pt; font-family: Calibri, sans-serif; color: = rgb(31, 73, 125);" class=3D"">=E2=80=9D , what=E2=80=99s the true link = of vdsm devel setup wiki ? I can=E2=80=99t get useful information = in<span class=3D"apple-converted-space"> </span><a = href=3D"http://ovirt.org/" style=3D"color: purple; text-decoration: = underline;" class=3D""><span style=3D"color: purple;" = class=3D"">ovirt.org</span></a><span = class=3D"apple-converted-space"> </span>or google.</span><span = lang=3D"EN-US" class=3D""><o:p = class=3D""></o:p></span></div></div></div><div class=3D""><div = style=3D"margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: = =E5=AE=8B=E4=BD=93;" class=3D""><span lang=3D"EN-US" class=3D""><o:p = class=3D""> </o:p></span></div></div><div style=3D"margin: 0cm 0cm = 0.0001pt; font-size: 12pt; font-family: =E5=AE=8B=E4=BD=93;" = class=3D""><span lang=3D"EN-US" class=3D""><a = href=3D"http://www.ovirt.org/develop/developer-guide/vdsm/developers/" = style=3D"color: purple; text-decoration: underline;" = class=3D"">http://www.ovirt.org/develop/developer-guide/vdsm/developers/</= a> has tips how to build from source and what packages are = needed<o:p class=3D""></o:p></span></div></div><div class=3D""><div = style=3D"margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: = =E5=AE=8B=E4=BD=93;" class=3D""><span lang=3D"EN-US" class=3D"">Anything = specific you=E2=80=99re troubleshooting?<o:p = class=3D""></o:p></span></div></div><div class=3D""><div style=3D"margin: = 0cm 0cm 0.0001pt; font-size: 12pt; font-family: =E5=AE=8B=E4=BD=93;" = class=3D""><span lang=3D"EN-US" style=3D"color: rgb(31, 73, 125);" = class=3D""><o:p class=3D""> </o:p></span></div><div style=3D"margin: = 0cm 0cm 0.0001pt; font-size: 12pt; font-family: =E5=AE=8B=E4=BD=93;" = class=3D""><span lang=3D"EN-US" style=3D"font-size: 10.5pt; font-family: = Calibri, sans-serif; color: rgb(31, 73, 125);" = class=3D""> I do build = the source from this instruction , but I want to set breakpoint to view = each step and variable value to understand the vdsm=E2=80=99s code using = python IDE such as Pycharm ,<span = class=3D"Apple-converted-space"> </span><o:p = class=3D""></o:p></span></div><div style=3D"margin: 0cm 0cm 0.0001pt; = font-size: 12pt; font-family: =E5=AE=8B=E4=BD=93;" class=3D""><span = lang=3D"EN-US" style=3D"font-size: 10.5pt; font-family: Calibri, = sans-serif; color: rgb(31, 73, 125);" class=3D""><o:p = class=3D""> </o:p></span></div><div style=3D"margin: 0cm 0cm = 0.0001pt; font-size: 12pt; font-family: =E5=AE=8B=E4=BD=93;" = class=3D""><span lang=3D"EN-US" style=3D"font-size: 10.5pt; font-family: = Calibri, sans-serif; color: rgb(31, 73, 125);" class=3D"">You know that = we can implement this debug requirement in ovirt engine easily, but I = can=E2=80=99t implement local debug in vdsm easily, because vdsm = didn=E2=80=99t allow root to run or debug.<o:p = class=3D""></o:p></span></div><div style=3D"margin: 0cm 0cm 0.0001pt; = font-size: 12pt; font-family: =E5=AE=8B=E4=BD=93;" class=3D""><span = lang=3D"EN-US" style=3D"font-size: 10.5pt; font-family: Calibri, = sans-serif; color: rgb(31, 73, 125);" class=3D""><o:p = class=3D""> </o:p></span></div><div style=3D"margin: 0cm 0cm = 0.0001pt; font-size: 12pt; font-family: =E5=AE=8B=E4=BD=93;" = class=3D""><span lang=3D"EN-US" style=3D"font-size: 10.5pt; font-family: = Calibri, sans-serif; color: rgb(31, 73, 125);" class=3D"">Is there any = debug instruction ?</span></div></div></div></div></blockquote><div><br = class=3D""></div>I don=E2=80=99t think it=E2=80=99s possible to debug it = from PyCharm, or any IDE for that matter, easily. </div><div>It=E2=80= =99s a multithreaded application, you can=E2=80=99t really set a = breakpoint without affecting other functionality since some of the = threads need to keep running</div><div>Best advice is to add a = debugging/logging code in places you need, printing variables you=E2=80=99= re interested in.</div><div><br = class=3D""></div><div>Thanks,</div><div>michal</div><div><br = class=3D""><blockquote type=3D"cite" class=3D""><div class=3D""><div = class=3D"WordSection1" style=3D"page: WordSection1; font-family: = Helvetica; font-size: 12px; font-style: normal; font-variant-caps: = normal; font-weight: normal; letter-spacing: normal; orphans: auto; = text-align: start; text-indent: 0px; text-transform: none; white-space: = normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: = 0px;"><div class=3D""><div style=3D"margin: 0cm 0cm 0.0001pt; font-size: = 12pt; font-family: =E5=AE=8B=E4=BD=93;" class=3D""><span lang=3D"EN-US" = style=3D"font-size: 10.5pt; font-family: Calibri, sans-serif; color: = rgb(31, 73, 125);" class=3D""><o:p class=3D""></o:p></span></div><div = style=3D"margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: = =E5=AE=8B=E4=BD=93;" class=3D""><span lang=3D"EN-US" style=3D"font-size: = 10.5pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" = class=3D""><o:p class=3D""> </o:p></span></div><div style=3D"margin: = 0cm 0cm 0.0001pt; font-size: 12pt; font-family: =E5=AE=8B=E4=BD=93;" = class=3D""><span lang=3D"EN-US" style=3D"font-size: 10.5pt; font-family: = Calibri, sans-serif; color: rgb(31, 73, 125);" class=3D"">Thank you<o:p = class=3D""></o:p></span></div><div style=3D"margin: 0cm 0cm 0.0001pt; = font-size: 12pt; font-family: =E5=AE=8B=E4=BD=93;" class=3D""><span = lang=3D"EN-US" style=3D"font-size: 10.5pt; font-family: Calibri, = sans-serif; color: rgb(31, 73, 125);" class=3D"">Mark<o:p = class=3D""></o:p></span></div><div style=3D"margin: 0cm 0cm 0.0001pt; = font-size: 12pt; font-family: =E5=AE=8B=E4=BD=93;" class=3D""><span = lang=3D"EN-US" style=3D"font-size: 10.5pt; font-family: Calibri, = sans-serif; color: rgb(31, 73, 125);" class=3D""><o:p = class=3D""> </o:p></span></div></div><div class=3D""><div = style=3D"margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: = =E5=AE=8B=E4=BD=93;" class=3D""><span lang=3D"EN-US" = class=3D"">Thanks,<o:p class=3D""></o:p></span></div></div><div = class=3D""><div style=3D"margin: 0cm 0cm 0.0001pt; font-size: 12pt; = font-family: =E5=AE=8B=E4=BD=93;" class=3D""><span lang=3D"EN-US" = class=3D"">michal<o:p class=3D""></o:p></span></div></div><div = class=3D""><div style=3D"margin: 0cm 0cm 0.0001pt; font-size: 12pt; = font-family: =E5=AE=8B=E4=BD=93;" class=3D""><span lang=3D"EN-US" = class=3D""><br class=3D""><br class=3D""><o:p = class=3D""></o:p></span></div><div class=3D""><div class=3D""><div = style=3D"margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: = =E5=AE=8B=E4=BD=93;" class=3D""><span lang=3D"EN-US" style=3D"font-size: = 10.5pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" = class=3D""> </span><span lang=3D"EN-US" class=3D""><o:p = class=3D""></o:p></span></div></div><div class=3D""><div style=3D"margin: = 0cm 0cm 0.0001pt; font-size: 12pt; font-family: =E5=AE=8B=E4=BD=93;" = class=3D""><span lang=3D"EN-US" style=3D"font-size: 10.5pt; font-family: = Calibri, sans-serif; color: rgb(31, 73, 125);" = class=3D""> </span><span lang=3D"EN-US" class=3D""><o:p = class=3D""></o:p></span></div></div><div class=3D""><div style=3D"margin: = 0cm 0cm 0.0001pt; font-size: 12pt; font-family: =E5=AE=8B=E4=BD=93;" = class=3D""><span lang=3D"EN-US" style=3D"font-size: 10.5pt; font-family: = Calibri, sans-serif; color: rgb(31, 73, 125);" class=3D"">Thank = you</span><span lang=3D"EN-US" class=3D""><o:p = class=3D""></o:p></span></div></div><div class=3D""><div style=3D"margin: = 0cm 0cm 0.0001pt; font-size: 12pt; font-family: =E5=AE=8B=E4=BD=93;" = class=3D""><span lang=3D"EN-US" style=3D"font-size: 10.5pt; font-family: = Calibri, sans-serif; color: rgb(31, 73, 125);" = class=3D""> </span><span lang=3D"EN-US" class=3D""><o:p = class=3D""></o:p></span></div></div><div class=3D""><div = style=3D"border-style: solid none none; border-top-color: rgb(181, 196, = 223); border-top-width: 1pt; padding: 3pt 0cm 0cm;" class=3D""><div = class=3D""><div style=3D"margin: 0cm 0cm 0.0001pt; font-size: 12pt; = font-family: =E5=AE=8B=E4=BD=93;" class=3D""><b class=3D""><span = style=3D"font-size: 10pt;" class=3D"">=E5=8F=91=E4=BB=B6=E4=BA=BA<span = lang=3D"EN-US" class=3D"">:</span></span></b><span = class=3D"apple-converted-space"><span lang=3D"EN-US" style=3D"font-size: = 10pt;" class=3D""> </span></span><span lang=3D"EN-US" = style=3D"font-size: 10pt;" class=3D"">Michal Skrivanek [<a = href=3D"mailto:mskrivan@redhat.com" style=3D"color: purple; = text-decoration: underline;" = class=3D"">mailto:mskrivan@redhat.com</a>]<span = class=3D"apple-converted-space"> </span><br class=3D""></span><b = class=3D""><span style=3D"font-size: 10pt;" class=3D"">=E5=8F=91=E9=80=81=E6= =97=B6=E9=97=B4<span lang=3D"EN-US" class=3D"">:</span></span></b><span = class=3D"apple-converted-space"><span lang=3D"EN-US" style=3D"font-size: = 10pt;" class=3D""> </span></span><span lang=3D"EN-US" = style=3D"font-size: 10pt;" class=3D"">2016</span><span style=3D"font-size:= 10pt;" class=3D"">=E5=B9=B4<span lang=3D"EN-US" = class=3D"">7</span>=E6=9C=88<span lang=3D"EN-US" = class=3D"">26</span>=E6=97=A5<span class=3D"apple-converted-space"><span = lang=3D"EN-US" class=3D""> </span></span><span lang=3D"EN-US" = class=3D"">5:00<br class=3D""></span><b class=3D"">=E6=94=B6=E4=BB=B6=E4=BA= =BA<span lang=3D"EN-US" class=3D"">:</span></b><span = class=3D"apple-converted-space"><span lang=3D"EN-US" = class=3D""> </span></span><span lang=3D"EN-US" = class=3D"">lifuqiong<br class=3D""></span><b class=3D"">=E6=8A=84=E9=80=81= <span lang=3D"EN-US" class=3D"">:</span></b><span = class=3D"apple-converted-space"><span lang=3D"EN-US" = class=3D""> </span></span><span lang=3D"EN-US" class=3D"">users; = devel<br class=3D""></span><b class=3D"">=E4=B8=BB=E9=A2=98<span = lang=3D"EN-US" class=3D"">:</span></b><span = class=3D"apple-converted-space"><span lang=3D"EN-US" = class=3D""> </span></span><span lang=3D"EN-US" class=3D"">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</span></span><span lang=3D"EN-US" class=3D""><o:p = class=3D""></o:p></span></div></div></div></div><div class=3D""><div = style=3D"margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: = =E5=AE=8B=E4=BD=93;" class=3D""><span lang=3D"EN-US" class=3D""> <o:p= class=3D""></o:p></span></div></div><div class=3D""><div class=3D""><div = style=3D"margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: = =E5=AE=8B=E4=BD=93;" class=3D""><span lang=3D"EN-US" class=3D""> <o:p= class=3D""></o:p></span></div></div></div><div class=3D""><p = class=3D"MsoNormal" style=3D"margin: 0cm 0cm 12pt; font-size: 12pt; = font-family: =E5=AE=8B=E4=BD=93;"><span lang=3D"EN-US" class=3D""><br = class=3D"">On 25 Jul 2016, at 21:50, Sandro Bonazzola <<a = href=3D"mailto:sbonazzo@redhat.com" style=3D"color: purple; = text-decoration: underline;" class=3D""><span style=3D"color: purple;" = class=3D"">sbonazzo@redhat.com</span></a>> wrote:<o:p = class=3D""></o:p></span></p></div><blockquote style=3D"margin-top: 5pt; = margin-bottom: 5pt;" class=3D""><div class=3D""><div style=3D"margin: = 0cm 0cm 0.0001pt; font-size: 12pt; font-family: =E5=AE=8B=E4=BD=93;" = class=3D""><span lang=3D"EN-US" class=3D"">Adding some people from virt = team.<o:p class=3D""></o:p></span></div><div style=3D"margin: 0cm 0cm = 0.0001pt; font-size: 12pt; font-family: =E5=AE=8B=E4=BD=93;" = class=3D""><span lang=3D"EN-US" class=3D"">Il 23/Lug/2016 11:44, = "lifuqiong" <<a href=3D"mailto:lifuqiong@cncloudsec.com" = style=3D"color: purple; text-decoration: underline;" class=3D""><span = style=3D"color: purple;" = class=3D"">lifuqiong@cncloudsec.com</span></a>> ha scritto:<br = class=3D"">><br class=3D"">> I debugged vdsm with PyCharm, And I = logged on my Centos 7.2 with root, and get an error as follows:<br = class=3D"">><br class=3D"">> <br class=3D"">><br = class=3D"">> Problem:<br class=3D"">><br class=3D"">> <br = class=3D"">><br class=3D"">> Traceback (most recent call last):<br = class=3D"">><br class=3D"">> File "/usr/share/vdsm/vdsm", = line 149, in run<br class=3D"">><br class=3D"">> = serve_clients(log)<br class=3D"">><br = class=3D"">> File "/usr/share/vdsm/vdsm", line 104, in = serve_clients<br class=3D"">><br class=3D"">> = cif =3D clientIF.getInstance(irs, log, scheduler)<br class=3D"">><br = class=3D"">> File "/usr/share/vdsm/clientIF.py", line 204, in = getInstance<br class=3D"">><br class=3D"">> = cls._instance =3D clientIF(irs, log, scheduler)<br class=3D"">><br = class=3D"">> File "/usr/share/vdsm/clientIF.py", line 106, in = __init__<br class=3D"">><br class=3D"">> = secret.clear()<br class=3D"">><br class=3D"">> File = "/usr/lib/python2.7/site-packages/vdsm/virt/secret.py", line 92, in = clear<br class=3D"">><br class=3D"">> con =3D = libvirtconnection.get()<br class=3D"">><br class=3D"">> = File "/usr/lib/python2.7/site-packages/vdsm/libvirtconnection.py", line = 163, in get<br class=3D"">><br class=3D"">> = password)<br class=3D"">><br class=3D"">> File = "/usr/lib/python2.7/site-packages/vdsm/libvirtconnection.py", line 99, = in open_connection<br class=3D"">><br class=3D"">> = return utils.retry(libvirtOpen, timeout=3D10, = sleep=3D0.2)<br class=3D"">><br class=3D"">> File = "/usr/lib/python2.7/site-packages/vdsm/utils.py", line 546, in retry<br = class=3D"">><br class=3D"">> return func()<br = class=3D"">><br class=3D"">> File = "/usr/lib64/python2.7/site-packages/libvirt.py", line 105, in = openAuth<br class=3D"">><br class=3D"">> if ret = is None:raise libvirtError('virConnectOpenAuth() failed')<br = class=3D"">><br class=3D"">> libvirtError: Failed to connect = socket to '/var/run/libvirt/libvirt-sock': Permission denied<br = class=3D"">><br class=3D"">> <br class=3D"">><br = class=3D"">> Investitate:<br class=3D"">><br class=3D"">> = According to the traceback above, the code in libvirt.py as below, and = os.geteuid() get<span = class=3D"Apple-converted-space"> </span></span>=E2=80=98<span = lang=3D"EN-US" class=3D"">0</span>=E2=80=99<span lang=3D"EN-US" = class=3D""><span class=3D"Apple-converted-space"> </span>which = shows the current user is root;<o:p = class=3D""></o:p></span></div></div></blockquote><div class=3D""><div = class=3D""><div style=3D"margin: 0cm 0cm 0.0001pt; font-size: 12pt; = font-family: =E5=AE=8B=E4=BD=93;" class=3D""><span lang=3D"EN-US" = class=3D""> <o:p class=3D""></o:p></span></div></div></div><div = class=3D""><div style=3D"margin: 0cm 0cm 0.0001pt; font-size: 12pt; = font-family: =E5=AE=8B=E4=BD=93;" class=3D""><span lang=3D"EN-US" = class=3D"">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 class=3D""></o:p></span></div></div><div class=3D""><div = class=3D""><div style=3D"margin: 0cm 0cm 0.0001pt; font-size: 12pt; = font-family: =E5=AE=8B=E4=BD=93;" class=3D""><span lang=3D"EN-US" = class=3D"">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 = class=3D""><br class=3D""><br class=3D""><o:p = class=3D""></o:p></span></div></div><div class=3D""><div style=3D"margin: = 0cm 0cm 0.0001pt; font-size: 12pt; font-family: =E5=AE=8B=E4=BD=93;" = class=3D""><span lang=3D"EN-US" class=3D"">><br class=3D"">> = <br class=3D"">><br class=3D"">> def openAuth(uri, auth, = flags=3D0):<br class=3D"">><br class=3D"">> = #print os.geteuid()<br = class=3D"">><br class=3D"">> ret =3D = libvirtmod.virConnectOpenAuth(uri, auth, flags)<br class=3D"">><br = class=3D"">> if ret is None:raise = libvirtError('virConnectOpenAuth() failed')<br class=3D"">><br = class=3D"">> return virConnect(_obj=3Dret)<br class=3D"">><br = class=3D"">> <br class=3D"">><br class=3D"">> = [root@server117 libvirt]# ll /var/run/libvirt/libvirt-sock<br = class=3D"">><br class=3D"">> srwxrwx---. 1 root qemu 0 Jul 19 = 23:43 /var/run/libvirt/libvirt-sock<br class=3D"">><br class=3D"">> = <br class=3D"">><br class=3D"">> According that, root should = not get an Permission denied error ? But why?<br class=3D"">><br = class=3D"">> <br class=3D"">><br class=3D"">> And I = setenforce=3D0 , and still show Perssion denied error.<br = class=3D"">><br class=3D"">> <br class=3D"">><br = class=3D"">> What</span>=E2=80=99<span lang=3D"EN-US" class=3D"">s = the reason? And how to solve it?<br class=3D"">><br class=3D"">> = <br class=3D"">><br class=3D"">> Thank you.<br = class=3D"">><br class=3D"">><br class=3D"">> = _______________________________________________<br class=3D"">> Devel = mailing list<br class=3D"">><span = class=3D"apple-converted-space"> </span><a = href=3D"mailto:Devel@ovirt.org" style=3D"color: purple; text-decoration: = underline;" class=3D""><span style=3D"color: purple;" = class=3D"">Devel@ovirt.org</span></a><br class=3D"">><span = class=3D"apple-converted-space"> </span><a = href=3D"http://lists.ovirt.org/mailman/listinfo/devel" style=3D"color: = purple; text-decoration: underline;" class=3D""><span style=3D"color: = purple;" = class=3D"">http://lists.ovirt.org/mailman/listinfo/devel</span></a></span>= </div></div></div></div></div></div></div></blockquote></div><br = class=3D""></body></html>= --Apple-Mail=_3CB844CF-51EF-43B2-815F-81DB2C6581E5--