--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(a)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.
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
=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
=20
On 25 Jul 2016, at 21:50, Sandro Bonazzola <sbonazzo(a)redhat.com =
<mailto:sbonazzo@redhat.com>> wrote:
=20
Adding some people from virt team.
=20
Il 23/Lug/2016 11:44, "lifuqiong" <lifuqiong(a)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", =
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
=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(a)ovirt.org <mailto:Devel@ovirt.org>
>
http://lists.ovirt.org/mailman/listinfo/devel =
<
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(a)cncloudsec.com</a>&gt;
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...
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(a)redhat.com</a>&gt; =
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(a)cncloudsec.com</a>&gt; =
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(a)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<...
iv></div></div></div></blockquote></div><br
class=3D""></body></html>=
--Apple-Mail=_A58705BB-94F0-41B3-912E-C81871820D95--