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

This is a multipart message in MIME format. ------=_NextPart_000_001E_01D1E509.19780F20 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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@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. ------=_NextPart_000_001E_01D1E509.19780F20 Content-Type: text/html; charset="us-ascii" 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=3Dus-ascii"><meta name=3DGenerator content=3D"Microsoft Word 14 = (filtered medium)"><style><!-- /* Font Definitions */ @font-face {font-family:SimSun; panose-1:2 1 6 0 3 1 1 1 1 1;} @font-face {font-family:SimSun; 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:SimSun; 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; text-align:justify; text-justify:inter-ideograph; font-size:10.5pt; font-family:"Calibri","sans-serif";} 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;} span.EmailStyle17 {mso-style-type:personal-compose; font-family:"Calibri","sans-serif"; color:windowtext;} .MsoChpDefault {mso-style-type:export-only; font-family:"Calibri","sans-serif";} /* Page Definitions */ @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 style=3D'text-justify-trim:punctuation'><div = class=3DWordSection1><p class=3DMsoNormal><span lang=3DEN-US>I debugged = vdsm with PyCharm, And I logged on my Centos 7.2 with root, and = get an error as follows:<o:p></o:p></span></p><p class=3DMsoNormal><span = lang=3DEN-US><o:p> </o:p></span></p><p class=3DMsoNormal><span = lang=3DEN-US>Problem:<o:p></o:p></span></p><p class=3DMsoNormal><span = lang=3DEN-US><o:p> </o:p></span></p><p class=3DMsoNormal><span = lang=3DEN-US>Traceback (most recent call last):<o:p></o:p></span></p><p = class=3DMsoNormal><span lang=3DEN-US> File = "/usr/share/vdsm/vdsm", line 149, in = run<o:p></o:p></span></p><p class=3DMsoNormal><span = lang=3DEN-US> = serve_clients(log)<o:p></o:p></span></p><p class=3DMsoNormal><span = lang=3DEN-US> File "/usr/share/vdsm/vdsm", line 104, in = serve_clients<o:p></o:p></span></p><p class=3DMsoNormal><span = lang=3DEN-US> cif =3D clientIF.getInstance(irs, log, = scheduler)<o:p></o:p></span></p><p class=3DMsoNormal><span = lang=3DEN-US> File "/usr/share/vdsm/clientIF.py", line = 204, in getInstance<o:p></o:p></span></p><p class=3DMsoNormal><span = lang=3DEN-US> cls._instance =3D clientIF(irs, log, = scheduler)<o:p></o:p></span></p><p class=3DMsoNormal><span = lang=3DEN-US> File "/usr/share/vdsm/clientIF.py", line = 106, in __init__<o:p></o:p></span></p><p class=3DMsoNormal><span = lang=3DEN-US> secret.clear()<o:p></o:p></span></p><p = class=3DMsoNormal><span lang=3DEN-US> File = "/usr/lib/python2.7/site-packages/vdsm/virt/secret.py", line = 92, in clear<o:p></o:p></span></p><p class=3DMsoNormal><span = lang=3DEN-US> con =3D = libvirtconnection.get()<o:p></o:p></span></p><p class=3DMsoNormal><span = lang=3DEN-US> File = "/usr/lib/python2.7/site-packages/vdsm/libvirtconnection.py", = line 163, in get<o:p></o:p></span></p><p class=3DMsoNormal><span = lang=3DEN-US> password)<o:p></o:p></span></p><p = class=3DMsoNormal><span lang=3DEN-US> File = "/usr/lib/python2.7/site-packages/vdsm/libvirtconnection.py", = line 99, in open_connection<o:p></o:p></span></p><p = class=3DMsoNormal><span lang=3DEN-US> return = utils.retry(libvirtOpen, timeout=3D10, = sleep=3D0.2)<o:p></o:p></span></p><p class=3DMsoNormal><span = lang=3DEN-US> File = "/usr/lib/python2.7/site-packages/vdsm/utils.py", line 546, in = retry<o:p></o:p></span></p><p class=3DMsoNormal><span = lang=3DEN-US> return func()<o:p></o:p></span></p><p = class=3DMsoNormal><span lang=3DEN-US> File = "/usr/lib64/python2.7/site-packages/libvirt.py", line 105, in = openAuth<o:p></o:p></span></p><p class=3DMsoNormal><span = lang=3DEN-US> if ret is None:raise = libvirtError('virConnectOpenAuth() failed')<o:p></o:p></span></p><p = class=3DMsoNormal><span lang=3DEN-US>libvirtError: Failed to connect = socket to '/var/run/libvirt/libvirt-sock': Permission = denied<o:p></o:p></span></p><p class=3DMsoNormal><span = lang=3DEN-US><o:p> </o:p></span></p><p class=3DMsoNormal><span = lang=3DEN-US>Investitate:<o:p></o:p></span></p><p = class=3DMsoNormal><span lang=3DEN-US>According to the traceback above, = the code in libvirt.py as below, and os.geteuid() get = ‘0’ which shows the current user is = root;<o:p></o:p></span></p><p class=3DMsoNormal><span = lang=3DEN-US><o:p> </o:p></span></p><p class=3DMsoNormal><span = lang=3DEN-US>def openAuth(uri, auth, flags=3D0):<o:p></o:p></span></p><p = class=3DMsoNormal><span = lang=3DEN-US> #print = os.geteuid()<o:p></o:p></span></p><p class=3DMsoNormal><span = lang=3DEN-US> ret =3D = libvirtmod.virConnectOpenAuth(uri, auth, flags)<o:p></o:p></span></p><p = class=3DMsoNormal><span lang=3DEN-US> if ret is = None:raise libvirtError('virConnectOpenAuth() = failed')<o:p></o:p></span></p><p class=3DMsoNormal = style=3D'text-indent:21.0pt'><span lang=3DEN-US>return = virConnect(_obj=3Dret)<o:p></o:p></span></p><p class=3DMsoNormal><span = lang=3DEN-US><o:p> </o:p></span></p><p class=3DMsoNormal><span = lang=3DEN-US>[root@server117 libvirt]# ll = /var/run/libvirt/libvirt-sock<o:p></o:p></span></p><p = class=3DMsoNormal><span lang=3DEN-US>srwxrwx---. 1 root qemu 0 Jul 19 = 23:43 /var/run/libvirt/libvirt-sock<o:p></o:p></span></p><p = class=3DMsoNormal><span lang=3DEN-US><o:p> </o:p></span></p><p = class=3DMsoNormal><span lang=3DEN-US>According that, root should not get = an Permission denied error ? But why?<o:p></o:p></span></p><p = class=3DMsoNormal><span lang=3DEN-US><o:p> </o:p></span></p><p = class=3DMsoNormal><span lang=3DEN-US>And I setenforce=3D0 , and still = show Perssion denied error.<o:p></o:p></span></p><p = class=3DMsoNormal><span lang=3DEN-US><o:p> </o:p></span></p><p = class=3DMsoNormal><span lang=3DEN-US>What’s the reason? And how to = solve it?<o:p></o:p></span></p><p class=3DMsoNormal><span = lang=3DEN-US><o:p> </o:p></span></p><p class=3DMsoNormal><span = lang=3DEN-US>Thank you.<o:p></o:p></span></p></div></body></html> ------=_NextPart_000_001E_01D1E509.19780F20--

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:
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@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.
_______________________________________________ Devel mailing list Devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/devel

--Apple-Mail-D1347541-AC09-4E82-BD2E-44566BA8A20C Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: base64 DQoNCj4gT24gMjUgSnVsIDIwMTYsIGF0IDIxOjUwLCBTYW5kcm8gQm9uYXp6b2xhIDxzYm9uYXp6 b0ByZWRoYXQuY29tPiB3cm90ZToNCj4gDQo+IEFkZGluZyBzb21lIHBlb3BsZSBmcm9tIHZpcnQg dGVhbS4NCj4gDQo+IElsIDIzL0x1Zy8yMDE2IDExOjQ0LCAibGlmdXFpb25nIiA8bGlmdXFpb25n QGNuY2xvdWRzZWMuY29tPiBoYSBzY3JpdHRvOg0KPiA+DQo+ID4gSSBkZWJ1Z2dlZCB2ZHNtIHdp dGggUHlDaGFybSwgQW5kIEkgbG9nZ2VkIG9uIG15IENlbnRvcyA3LjIgd2l0aCByb290LCAgYW5k IGdldCBhbiBlcnJvciBhcyBmb2xsb3dzOg0KPiA+DQo+ID4gIA0KPiA+DQo+ID4gUHJvYmxlbToN Cj4gPg0KPiA+ICANCj4gPg0KPiA+IFRyYWNlYmFjayAobW9zdCByZWNlbnQgY2FsbCBsYXN0KToN Cj4gPg0KPiA+ICAgRmlsZSAiL3Vzci9zaGFyZS92ZHNtL3Zkc20iLCBsaW5lIDE0OSwgaW4gcnVu DQo+ID4NCj4gP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QomZ3Q7 PGJyPg0KJmd0OyAmbmJzcDs8YnI+DQomZ3Q7PGJyPg0KJmd0OyBBbmQgSSBzZXRlbmZvcmNlPTAg LCBhbmQgc3RpbGwgc2hvdyBQZXJzc2lvbiBkZW5pZWQgZXJyb3IuPGJyPg0KJmd0Ozxicj4NCiZn dDsgJm5ic3A7PGJyPg0KJmd0Ozxicj4NCiZndDsgV2hhdOKAmXMgdGhlIHJlYXNvbj8gQW5kIGhv dyB0byBzb2x2ZSBpdD88YnI+DQomZ3Q7PGJyPg0KJmd0OyAmbmJzcDs8YnI+DQomZ3Q7PGJyPg0K Jmd0OyBUaGFuayB5b3UuPGJyPg0KJmd0Ozxicj4NCiZndDs8YnI+DQomZ3Q7IF9fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fPGJyPg0KJmd0OyBEZXZlbCBtYWls aW5nIGxpc3Q8YnI+DQomZ3Q7IDxhIGhyZWY9Im1haWx0bzpEZXZlbEBvdmlydC5vcmciPkRldmVs QG92aXJ0Lm9yZzwvYT48YnI+DQomZ3Q7IDxhIGhyZWY9Imh0dHA6Ly9saXN0cy5vdmlydC5vcmcv bWFpbG1hbi9saXN0aW5mby9kZXZlbCI+aHR0cDovL2xpc3RzLm92aXJ0Lm9yZy9tYWlsbWFuL2xp c3RpbmZvL2RldmVsPC9hPjxicj48L3A+DQo8L2Rpdj48L2Jsb2NrcXVvdGU+PC9kaXY+PC9ib2R5 PjwvaHRtbD4= --Apple-Mail-D1347541-AC09-4E82-BD2E-44566BA8A20C--

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--

--Apple-Mail=_A58705BB-94F0-41B3-912E-C81871820D95 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8
On 26 Jul 2016, at 08:02, lifuqiong <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.
the vdsm account is intentionally disabled for interactive login
=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 =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: =
=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. =20 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", =
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? 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 =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
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=_A58705BB-94F0-41B3-912E-C81871820D95 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:02, 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" = 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"">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 = 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"">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></div></div></div></blockquote><div><br class=3D""></div>the = vdsm account is intentionally disabled for interactive = login</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 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"">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"">ovirt.org</a><span = class=3D"Apple-converted-space"> </span>or = google.</span></div></div></div></blockquote><div><br class=3D""></div><a = href=3D"http://www.ovirt.org/develop/developer-guide/vdsm/developers/" = class=3D"">http://www.ovirt.org/develop/developer-guide/vdsm/developers/</= a> has tips how to build from source and what packages are = needed</div><div>Anything specific you=E2=80=99re = troubleshooting?</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 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""><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""><o:p = class=3D""> </o:p></span></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 = 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 lang=3D"EN-US" style=3D"font-size: = 10pt;" class=3D""><span = class=3D"Apple-converted-space"> </span>Michal Skrivanek [<a = href=3D"mailto:mskrivan@redhat.com" = 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 = lang=3D"EN-US" style=3D"font-size: 10pt;" class=3D""><span = class=3D"Apple-converted-space"> </span>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 lang=3D"EN-US" class=3D""><span = class=3D"Apple-converted-space"> </span>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 lang=3D"EN-US" class=3D""><span = class=3D"Apple-converted-space"> </span>lifuqiong<br = class=3D""></span><b class=3D"">=E6=8A=84=E9=80=81<span lang=3D"EN-US" = class=3D"">:</span></b><span lang=3D"EN-US" class=3D""><span = class=3D"Apple-converted-space"> </span>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 lang=3D"EN-US" class=3D""><span = class=3D"Apple-converted-space"> </span>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 = class=3D""></o:p></span></span></div></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 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""><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"">sbonazzo@redhat.com</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""><p style=3D"margin-right: 0cm; margin-left: 0cm; 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></p><p style=3D"margin-right: 0cm; margin-left: = 0cm; 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"">lifuqiong@cncloudsec.com</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 =E2=80=980=E2=80=99 which shows the current user = is root;<o:p class=3D""></o:p></span></p></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"">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 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""><o:p = class=3D""></o:p></span></div><div class=3D""><p style=3D"margin-right: = 0cm; margin-left: 0cm; 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=E2=80=99s 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"">Devel@ovirt.org</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"">http://lists.ovirt.org/mailman/listinfo/devel</a></span></p></d= iv></div></div></div></blockquote></div><br class=3D""></body></html>= --Apple-Mail=_A58705BB-94F0-41B3-912E-C81871820D95--

This is a multipart message in MIME format. ------=_NextPart_000_00D7_01D1E74D.001CF1D0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable =20 On 26 Jul 2016, at 08:02, lifuqiong <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 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 <http://ovirt.org/> ovirt.org or google. =20 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 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 < = <mailto:sbonazzo@redhat.com> sbonazzo@redhat.com> wrote: Adding some people from virt team. Il 23/Lug/2016 11:44, "lifuqiong" < <mailto:lifuqiong@cncloudsec.com> = 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 <mailto:Devel@ovirt.org> Devel@ovirt.org <http://lists.ovirt.org/mailman/listinfo/devel> =
http://lists.ovirt.org/mailman/listinfo/devel =20 ------=_NextPart_000_00D7_01D1E74D.001CF1D0 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:Helvetica; panose-1:2 11 6 4 2 2 2 2 2 4;} @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.MsoAcetate, li.MsoAcetate, div.MsoAcetate {mso-style-priority:99; mso-style-link:"=E6=89=B9=E6=B3=A8=E6=A1=86=E6=96=87=E6=9C=AC Char"; margin:0cm; margin-bottom:.0001pt; font-size:9.0pt; font-family:=E5=AE=8B=E4=BD=93;} span.apple-converted-space {mso-style-name:apple-converted-space;} span.EmailStyle18 {mso-style-type:personal-reply; font-family:"Calibri","sans-serif"; color:#1F497D;} span.Char {mso-style-name:"=E6=89=B9=E6=B3=A8=E6=A1=86=E6=96=87=E6=9C=AC Char"; mso-style-priority:99; mso-style-link:=E6=89=B9=E6=B3=A8=E6=A1=86=E6=96=87=E6=9C=AC; font-family:=E5=AE=8B=E4=BD=93;} .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><o:p> </o:p></span></p><div><blockquote = style=3D'margin-top:5.0pt;margin-bottom:5.0pt'><div><p = class=3DMsoNormal><span lang=3DEN-US>On 26 Jul 2016, at 08:02, lifuqiong = <<a = href=3D"mailto:lifuqiong@cncloudsec.com">lifuqiong@cncloudsec.com</a>>= wrote:<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><span lang=3DEN-US = style=3D'font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497= D'> </span><span lang=3DEN-US><o:p></o:p></span></p></div><div><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;</span><span = lang=3DEN-US><o:p></o:p></span></p></div><div><p class=3DMsoNormal><span = lang=3DEN-US = style=3D'font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497= D'> </span><span lang=3DEN-US><o:p></o:p></span></p></div><div><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.</span><span = lang=3DEN-US><o:p></o:p></span></p></div></div></blockquote><div><p = class=3DMsoNormal><span = lang=3DEN-US><o:p> </o:p></span></p></div><p = class=3DMsoNormal><span lang=3DEN-US>the vdsm account is intentionally = disabled for interactive login<o:p></o:p></span></p></div><div><p = class=3DMsoNormal><span = lang=3DEN-US><br><br><o:p></o:p></span></p><div><div><p = class=3DMsoNormal><span lang=3DEN-US = style=3D'font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497= D'> </span><span lang=3DEN-US><o:p></o:p></span></p></div><div><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 = ? I can=E2=80=99t get useful information in<span = class=3Dapple-converted-space> </span><a = href=3D"http://ovirt.org/"><span = style=3D'color:purple'>ovirt.org</span></a><span = class=3Dapple-converted-space> </span>or google.</span><span = lang=3DEN-US><o:p></o:p></span></p></div></div><div><p = class=3DMsoNormal><span = lang=3DEN-US><o:p> </o:p></span></p></div><p = class=3DMsoNormal><span lang=3DEN-US><a = href=3D"http://www.ovirt.org/develop/developer-guide/vdsm/developers/">ht= tp://www.ovirt.org/develop/developer-guide/vdsm/developers/</a> has = tips how to build from source and what packages are = needed<o:p></o:p></span></p></div><div><p class=3DMsoNormal><span = lang=3DEN-US>Anything specific you=E2=80=99re = troubleshooting?<o:p></o:p></span></p></div><div><p = class=3DMsoNormal><span lang=3DEN-US = style=3D'color:#1F497D'><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'>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 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 , <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 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></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'>Is there any debug instruction ?<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'>Mark<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><p class=3DMsoNormal><span = lang=3DEN-US>Thanks,<o:p></o:p></span></p></div><div><p = class=3DMsoNormal><span = lang=3DEN-US>michal<o:p></o:p></span></p></div><div><p = class=3DMsoNormal><span = lang=3DEN-US><br><br><o:p></o:p></span></p><div><div><p = class=3DMsoNormal><span lang=3DEN-US = style=3D'font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497= D'> </span><span lang=3DEN-US><o:p></o:p></span></p></div><div><p = class=3DMsoNormal><span lang=3DEN-US = style=3D'font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497= D'> </span><span lang=3DEN-US><o:p></o:p></span></p></div><div><p = class=3DMsoNormal><span lang=3DEN-US = style=3D'font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497= D'>Thank you</span><span = lang=3DEN-US><o:p></o:p></span></p></div><div><p class=3DMsoNormal><span = lang=3DEN-US = style=3D'font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497= D'> </span><span lang=3DEN-US><o:p></o:p></span></p></div><div><div = style=3D'border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm = 0cm 0cm'><div><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 = class=3Dapple-converted-space><span lang=3DEN-US = style=3D'font-size:10.0pt'> </span></span><span lang=3DEN-US = style=3D'font-size:10.0pt'>Michal Skrivanek [<a = href=3D"mailto:mskrivan@redhat.com">mailto:mskrivan@redhat.com</a>]<span = class=3Dapple-converted-space> </span><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 = class=3Dapple-converted-space><span lang=3DEN-US = style=3D'font-size:10.0pt'> </span></span><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 = class=3Dapple-converted-space><span = lang=3DEN-US> </span></span><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 class=3Dapple-converted-space><span = lang=3DEN-US> </span></span><span = lang=3DEN-US>lifuqiong<br></span><b>=E6=8A=84=E9=80=81<span = lang=3DEN-US>:</span></b><span class=3Dapple-converted-space><span = lang=3DEN-US> </span></span><span lang=3DEN-US>users; = devel<br></span><b>=E4=B8=BB=E9=A2=98<span = lang=3DEN-US>:</span></b><span class=3Dapple-converted-space><span = lang=3DEN-US> </span></span><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</span></span><span = lang=3DEN-US><o:p></o:p></span></p></div></div></div><div><p = class=3DMsoNormal><span = lang=3DEN-US> <o:p></o:p></span></p></div><div><div><p = class=3DMsoNormal><span = lang=3DEN-US> <o:p></o:p></span></p></div></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"><span = style=3D'color:purple'>sbonazzo@redhat.com</span></a>> = wrote:<o:p></o:p></span></p></div><blockquote = style=3D'margin-top:5.0pt;margin-bottom:5.0pt'><div><p class=3DMsoNormal = style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span = lang=3DEN-US>Adding some people from virt team.<o:p></o:p></span></p><p = class=3DMsoNormal = style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span = lang=3DEN-US>Il 23/Lug/2016 11:44, "lifuqiong" <<a = href=3D"mailto:lifuqiong@cncloudsec.com"><span = style=3D'color:purple'>lifuqiong@cncloudsec.com</span></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 </span>=E2=80=98<span lang=3DEN-US>0</span>=E2=80=99<span = lang=3DEN-US> which shows the current user is = root;<o:p></o:p></span></p></div></blockquote><div><div><p = class=3DMsoNormal><span = lang=3DEN-US> <o:p></o:p></span></p></div></div><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><div><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><br><o:p></o:p></span></p></div><div><p = class=3DMsoNormal = style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><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</span>=E2=80=99<span lang=3DEN-US>s the = reason? And how to solve it?<br>><br>> <br>><br>> = Thank you.<br>><br>><br>> = _______________________________________________<br>> Devel mailing = list<br>><span class=3Dapple-converted-space> </span><a = href=3D"mailto:Devel@ovirt.org"><span = style=3D'color:purple'>Devel@ovirt.org</span></a><br>><span = class=3Dapple-converted-space> </span><a = href=3D"http://lists.ovirt.org/mailman/listinfo/devel"><span = style=3D'color:purple'>http://lists.ovirt.org/mailman/listinfo/devel</spa= n></a><o:p></o:p></span></p></div></div></div></div><p = class=3DMsoNormal><span = lang=3DEN-US><o:p> </o:p></span></p></div></body></html> ------=_NextPart_000_00D7_01D1E74D.001CF1D0--

--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--

This is a multipart message in MIME format. ------=_NextPart_000_00EB_01D1E757.F5CF4E70 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable =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 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 <http://ovirt.org/> 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 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. =20 I know it=E2=80=99s a multithreaded application , and debug = vdsm is a very difficult job, but without debug, I don=E2=80=99t know = which code I should replace or logging, Is there any remote debug = solution like ovirt engine? I found that=20 I can do remote debug in simple python application , but I = didn=E2=80=99t success yet remote debugging vdsm.=20 =20 Now one of our case I want to consider using ovirt as our = solution , we may do little change over ovirt. but as described above, = without debug , we can hardly understand vdsm clearly and cannot do = correctly code change. Is there some good advice ? =20 Thank you Mark Thanks, michal =20 Thank you Mark =20 Thanks, michal =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: = 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 < = <mailto:sbonazzo@redhat.com> sbonazzo@redhat.com> wrote: Adding some people from virt team. Il 23/Lug/2016 11:44, "lifuqiong" < <mailto:lifuqiong@cncloudsec.com> = 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 <mailto:Devel@ovirt.org> Devel@ovirt.org <http://lists.ovirt.org/mailman/listinfo/devel> =
http://lists.ovirt.org/mailman/listinfo/devel =20 ------=_NextPart_000_00EB_01D1E757.F5CF4E70 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:Helvetica; panose-1:2 11 6 4 2 2 2 2 2 4;} @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.MsoAcetate, li.MsoAcetate, div.MsoAcetate {mso-style-priority:99; mso-style-link:"=E6=89=B9=E6=B3=A8=E6=A1=86=E6=96=87=E6=9C=AC Char"; margin:0cm; margin-bottom:.0001pt; font-size:9.0pt; font-family:=E5=AE=8B=E4=BD=93;} span.apple-converted-space {mso-style-name:apple-converted-space;} span.EmailStyle18 {mso-style-type:personal-reply; font-family:"Calibri","sans-serif"; color:#1F497D;} span.Char {mso-style-name:"=E6=89=B9=E6=B3=A8=E6=A1=86=E6=96=87=E6=9C=AC Char"; mso-style-priority:99; mso-style-link:=E6=89=B9=E6=B3=A8=E6=A1=86=E6=96=87=E6=9C=AC; font-family:=E5=AE=8B=E4=BD=93;} .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> <o:p></o:p></span></p><div><div><div><p = class=3DMsoNormal><span lang=3DEN-US = style=3D'font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497= D'> </span><span = lang=3DEN-US><o:p></o:p></span></p></div></div><div><div><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;</span><span = lang=3DEN-US><o:p></o:p></span></p></div></div><div><div><p = class=3DMsoNormal><span lang=3DEN-US = style=3D'font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497= D'> </span><span = lang=3DEN-US><o:p></o:p></span></p></div></div><div><div><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.</span><span = lang=3DEN-US><o:p></o:p></span></p></div></div></div><div><div><p = class=3DMsoNormal><span = lang=3DEN-US> <o:p></o:p></span></p></div></div><div><p = class=3DMsoNormal><span lang=3DEN-US>the vdsm account is intentionally = disabled for interactive login<o:p></o:p></span></p></div><div><div><p = class=3DMsoNormal><span = lang=3DEN-US><br><br><br><o:p></o:p></span></p></div><div><div><div><p = class=3DMsoNormal><span lang=3DEN-US = style=3D'font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497= D'> </span><span = lang=3DEN-US><o:p></o:p></span></p></div></div><div><div><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 = ? I can=E2=80=99t get useful information in<span = class=3Dapple-converted-space> </span><a = href=3D"http://ovirt.org/"><span = style=3D'color:purple'>ovirt.org</span></a><span = class=3Dapple-converted-space> </span>or google.</span><span = lang=3DEN-US><o:p></o:p></span></p></div></div></div><div><div><p = class=3DMsoNormal><span = lang=3DEN-US> <o:p></o:p></span></p></div></div><div><p = class=3DMsoNormal><span lang=3DEN-US><a = href=3D"http://www.ovirt.org/develop/developer-guide/vdsm/developers/"><s= pan = style=3D'color:purple'>http://www.ovirt.org/develop/developer-guide/vdsm/= developers/</span></a> has tips how to build from source and what = packages are needed<o:p></o:p></span></p></div></div><div><div><p = class=3DMsoNormal><span lang=3DEN-US>Anything specific = you</span>=E2=80=99<span lang=3DEN-US>re = troubleshooting?<o:p></o:p></span></p></div></div><div><div><p = class=3DMsoNormal><span lang=3DEN-US = style=3D'color:#1F497D'> </span><span = lang=3DEN-US><o:p></o:p></span></p></div><div><p class=3DMsoNormal><span = lang=3DEN-US = style=3D'font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497= D'> 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=3Dapple-converted-space> </span></span><span = lang=3DEN-US><o:p></o:p></span></p></div><div><p class=3DMsoNormal><span = lang=3DEN-US = style=3D'font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497= D'> </span><span lang=3DEN-US><o:p></o:p></span></p></div><div><p = class=3DMsoNormal><span lang=3DEN-US = style=3D'font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497= D'>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.</span><span = lang=3DEN-US><o:p></o:p></span></p></div><div><p class=3DMsoNormal><span = lang=3DEN-US = style=3D'font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497= D'> </span><span lang=3DEN-US><o:p></o:p></span></p></div><div><p = class=3DMsoNormal><span lang=3DEN-US = style=3D'font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497= D'>Is there any debug instruction ?</span><span = lang=3DEN-US><o:p></o:p></span></p></div></div><div><p = class=3DMsoNormal><span = lang=3DEN-US><o:p> </o:p></span></p></div><p = class=3DMsoNormal><span lang=3DEN-US>I don=E2=80=99t think it=E2=80=99s = possible to debug it from PyCharm, or any IDE for that matter, = easily. <o:p></o:p></span></p><div><p class=3DMsoNormal><span = lang=3DEN-US>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<o:p></o:p></span></p></div><div><p = class=3DMsoNormal><span lang=3DEN-US>Best advice is to add a = debugging/logging code in places you need, printing variables = you=E2=80=99re interested in.<o:p></o:p></span></p></div><div><p = class=3DMsoNormal><span lang=3DEN-US = style=3D'color:#1F497D'><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'>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 I know it=E2=80=99s = a multithreaded application , and debug vdsm is a very difficult job, = but without debug, I don=E2=80=99t know which code I should replace or = logging,=C2=A0 =C2=A0Is there any remote debug solution like ovirt = engine? =C2=A0I found that <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 can do remote debug in simple python application , but I = didn=E2=80=99t success yet remote debugging 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'>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = <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'>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Now one of our case = I want to consider using ovirt as our solution , we may do little change = over ovirt. but as described above, without debug , we can hardly = understand vdsm clearly and cannot do correctly code = change.<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'>Is there some good advice ?<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'>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = <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'>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 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'>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = Mark<o:p></o:p></span></p></div><div><p class=3DMsoNormal><span = lang=3DEN-US>Thanks,<o:p></o:p></span></p></div><div><p = class=3DMsoNormal><span = lang=3DEN-US>michal<o:p></o:p></span></p></div><div><p = class=3DMsoNormal><span = lang=3DEN-US><br><br><o:p></o:p></span></p><div><div><div><p = class=3DMsoNormal><span lang=3DEN-US = style=3D'font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497= D'> </span><span lang=3DEN-US><o:p></o:p></span></p></div><div><p = class=3DMsoNormal><span lang=3DEN-US = style=3D'font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497= D'>Thank you</span><span = lang=3DEN-US><o:p></o:p></span></p></div><div><p class=3DMsoNormal><span = lang=3DEN-US = style=3D'font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497= D'>Mark</span><span lang=3DEN-US><o:p></o:p></span></p></div><div><p = class=3DMsoNormal><span lang=3DEN-US = style=3D'font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497= D'> </span><span = lang=3DEN-US><o:p></o:p></span></p></div></div><div><div><p = class=3DMsoNormal><span = lang=3DEN-US>Thanks,<o:p></o:p></span></p></div></div><div><div><p = class=3DMsoNormal><span = lang=3DEN-US>michal<o:p></o:p></span></p></div></div><div><div><p = class=3DMsoNormal><span = lang=3DEN-US><br><br><br><o:p></o:p></span></p></div><div><div><div><p = class=3DMsoNormal><span lang=3DEN-US = style=3D'font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497= D'> </span><span = lang=3DEN-US><o:p></o:p></span></p></div></div><div><div><p = class=3DMsoNormal><span lang=3DEN-US = style=3D'font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497= D'> </span><span = lang=3DEN-US><o:p></o:p></span></p></div></div><div><div><p = class=3DMsoNormal><span lang=3DEN-US = style=3D'font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497= D'>Thank you</span><span = lang=3DEN-US><o:p></o:p></span></p></div></div><div><div><p = class=3DMsoNormal><span lang=3DEN-US = style=3D'font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497= D'> </span><span = lang=3DEN-US><o:p></o:p></span></p></div></div><div><div = style=3D'border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm = 0cm 0cm'><div><div><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 = class=3Dapple-converted-space><span lang=3DEN-US = style=3D'font-size:10.0pt'> </span></span><span lang=3DEN-US = style=3D'font-size:10.0pt'>Michal Skrivanek [<a = href=3D"mailto:mskrivan@redhat.com"><span = style=3D'color:purple'>mailto:mskrivan@redhat.com</span></a>]<span = class=3Dapple-converted-space> </span><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 = class=3Dapple-converted-space><span lang=3DEN-US = style=3D'font-size:10.0pt'> </span></span><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 = class=3Dapple-converted-space><span = lang=3DEN-US> </span></span><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 class=3Dapple-converted-space><span = lang=3DEN-US> </span></span><span = lang=3DEN-US>lifuqiong<br></span><b>=E6=8A=84=E9=80=81<span = lang=3DEN-US>:</span></b><span class=3Dapple-converted-space><span = lang=3DEN-US> </span></span><span lang=3DEN-US>users; = devel<br></span><b>=E4=B8=BB=E9=A2=98<span = lang=3DEN-US>:</span></b><span class=3Dapple-converted-space><span = lang=3DEN-US> </span></span><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</span></span><span = lang=3DEN-US><o:p></o:p></span></p></div></div></div></div><div><div><p = class=3DMsoNormal><span = lang=3DEN-US> <o:p></o:p></span></p></div></div><div><div><div><p = class=3DMsoNormal><span = lang=3DEN-US> <o:p></o:p></span></p></div></div></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"><span = style=3D'color:purple'>sbonazzo@redhat.com</span></a>> = wrote:<o:p></o:p></span></p></div><blockquote = style=3D'margin-top:5.0pt;margin-bottom:5.0pt'><div><div><p = class=3DMsoNormal><span lang=3DEN-US>Adding some people from virt = team.<o:p></o:p></span></p></div><div><p class=3DMsoNormal><span = lang=3DEN-US>Il 23/Lug/2016 11:44, "lifuqiong" <<a = href=3D"mailto:lifuqiong@cncloudsec.com"><span = style=3D'color:purple'>lifuqiong@cncloudsec.com</span></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<span = class=3Dapple-converted-space> </span></span>=E2=80=98<span = lang=3DEN-US>0</span>=E2=80=99<span class=3Dapple-converted-space><span = lang=3DEN-US> </span></span><span lang=3DEN-US>which shows the = current user is = root;<o:p></o:p></span></p></div></div></blockquote><div><div><div><p = class=3DMsoNormal><span = lang=3DEN-US> <o:p></o:p></span></p></div></div></div><div><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></div><div><div><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><br><br><o:p></o:p></span></p></div></div><div><div><p = class=3DMsoNormal><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</span>=E2=80=99<span lang=3DEN-US>s the = reason? And how to solve it?<br>><br>> <br>><br>> = Thank you.<br>><br>><br>> = _______________________________________________<br>> Devel mailing = list<br>><span class=3Dapple-converted-space> </span><a = href=3D"mailto:Devel@ovirt.org"><span = style=3D'color:purple'>Devel@ovirt.org</span></a><br>><span = class=3Dapple-converted-space> </span><a = href=3D"http://lists.ovirt.org/mailman/listinfo/devel"><span = style=3D'color:purple'>http://lists.ovirt.org/mailman/listinfo/devel</spa= n></a><o:p></o:p></span></p></div></div></div></div></div></div></div><p = class=3DMsoNormal><span = lang=3DEN-US><o:p> </o:p></span></p></div></body></html> ------=_NextPart_000_00EB_01D1E757.F5CF4E70--

"lifuqiong" <lifuqiong@cncloudsec.com> writes:
I know it’s a multithreaded application , and debug vdsm is a very difficult job, but without debug, I don’t know which code I should replace or logging, Is there any remote debug solution like ovirt engine? I found that
I can do remote debug in simple python application , but I didn’t success yet remote debugging vdsm.
As Michal mentioned, making a breakpoint in Vdsm may break things due to the stopped execution of the given thread. Inserting logging messages to proper places of the code, where you need to get some information about the runtime state, is typically much simpler and good enough solution. If you still want to try more interactive approach and need to access `vdsm' user, you can change the login shell of `vdsm' account to /bin/sh and then use `su - vdsm' from root account. But I don't recommend doing that on any production system.
Now one of our case I want to consider using ovirt as our solution , we may do little change over ovirt. but as described above, without debug , we can hardly understand vdsm clearly and cannot do correctly code change.
Is there some good advice ?
If you want to study Vdsm runtime execution, read the logs, there's plenty of information there. When you are interested in a particular place in the source code, where you intend to perform the changes, and some information is missing, simply add your own debugging calls there, restart Vdsm and watch the log. I do it all the time and it works. :-)

----- Original Message -----
From: "Milan Zamazal" <mzamazal@redhat.com> To: "lifuqiong" <lifuqiong@cncloudsec.com> Cc: devel@ovirt.org Sent: Tuesday, July 26, 2016 3:46:42 PM Subject: 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
"lifuqiong" <lifuqiong@cncloudsec.com> writes:
I know it’s a multithreaded application , and debug vdsm is a very difficult job, but without debug, I don’t know which code I should replace or logging, Is there any remote debug solution like ovirt engine? I found that
I can do remote debug in simple python application , but I didn’t success yet remote debugging vdsm.
As Michal mentioned, making a breakpoint in Vdsm may break things due to the stopped execution of the given thread. Inserting logging messages to proper places of the code, where you need to get some information about the runtime state, is typically much simpler and good enough solution.
Additionally, another option is to use our manhole integration: https://pypi.python.org/pypi/manhole this is available on ovirt-4.0.z check manhole_enable in [devel] section. As the name hints, this should not be enabled in production settings. Bests, -- Francesco Romani RedHat Engineering Virtualization R & D Phone: 8261328 IRC: fromani
participants (5)
-
Francesco Romani
-
lifuqiong
-
Michal Skrivanek
-
Milan Zamazal
-
Sandro Bonazzola