<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Oct 7, 2016 at 10:44 PM, Yaniv Kaul <span dir="ltr">&lt;<a href="mailto:ykaul@redhat.com" target="_blank">ykaul@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">I&#39;m trying on FC24, using python-ovirt-engine-sdk4-4.1.0<wbr>-0.0.20161003git056315d.fc24.x<wbr>86_64 to add a DC, and failing - against master. The client is unhappy:<div><div>File &quot;/home/ykaul/ovirt-system-test<wbr>s/basic-suite-master/test-scen<wbr>arios/002_bootstrap.py&quot;, line 98, in add_dc4</div><div>    version=sdk4.types.Version(maj<wbr>or=DC_VER_MAJ,minor=DC_VER_MIN<wbr>),</div><div>  File &quot;/usr/lib64/python2.7/site-pac<wbr>kages/ovirtsdk4/services.py&quot;, line 4347, in add</div><div>    response = self._connection.send(request)</div><div>  File &quot;/usr/lib64/python2.7/site-pac<wbr>kages/ovirtsdk4/__init__.py&quot;, line 276, in send</div><div>    return self.__send(request)</div><div>  File &quot;/usr/lib64/python2.7/site-pac<wbr>kages/ovirtsdk4/__init__.py&quot;, line 298, in __send</div><div>    self._sso_token = self._get_access_token()</div><div>  File &quot;/usr/lib64/python2.7/site-pac<wbr>kages/ovirtsdk4/__init__.py&quot;, line 460, in _get_access_token</div><div>    sso_response = self._get_sso_response(self._s<wbr>so_url, post_data)</div><div>  File &quot;/usr/lib64/python2.7/site-pac<wbr>kages/ovirtsdk4/__init__.py&quot;, line 498, in _get_sso_response</div><div>    return json.loads(body_buf.getvalue()<wbr>.decode(&#39;utf-8&#39;))</div><div>  File &quot;/usr/lib64/python2.7/json/__i<wbr>nit__.py&quot;, line 339, in loads</div><div>    return _default_decoder.decode(s)</div><div>  File &quot;/usr/lib64/python2.7/json/dec<wbr>oder.py&quot;, line 364, in decode</div><div>    obj, end = self.raw_decode(s, idx=_w(s, 0).end())</div><div>  File &quot;/usr/lib64/python2.7/json/dec<wbr>oder.py&quot;, line 382, in raw_decode</div><div>    raise ValueError(&quot;No JSON object could be decoded&quot;)</div><div>ValueError: No JSON object could be decoded</div><div><br></div><div><br></div><div>Surprisingly, I now can&#39;t find that RPM of this SDK in <a href="http://resources.ovirt.org" target="_blank">resources.ovirt.org</a> now.</div><div><br></div><div>I&#39;ve tried with <a href="http://resources.ovirt.org/pub/ovirt-master-snapshot/rpm/fc24/x86_64/python-ovirt-engine-sdk4-4.0.0-0.1.20161004gitf94eeb5.fc24.x86_64.rpm" target="_blank">http://resources.ovirt.or<wbr>g/pub/ovirt-master-snapshot/rp<wbr>m/fc24/x86_64/python-ovirt-eng<wbr>ine-sdk4-4.0.0-0.1.20161004git<wbr>f94eeb5.fc24.x86_64.rpm</a> </div></div><div><br></div><div>- same result.</div><div><br></div><div>Did not see anything obvious on server or engine logs.</div><div>The code:</div><div><div>def add_dc4(api):</div><div>    nt.assert_true(api != None)</div><div>    dcs_service = api.system_service().data_cent<wbr>ers_service()</div><div>    nt.assert_true(</div><div>        dc = dcs_service.add(</div><div>            sdk4.types.DataCenter(</div><div>                name=DC_NAME4,</div><div>                description=&#39;APIv4 DC&#39;,</div><div>                local=False,</div><div>                version=sdk4.types.Version(maj<wbr>or=DC_VER_MAJ,minor=DC_VER_MIN<wbr>),</div><div>            ),</div><div>        )</div><div>    )</div></div><div><br></div><div><br></div><div>And the api object is from:</div><div><div>            return sdk4.Connection(</div><div>                url=url,</div><div>                username=constants.ENGINE_USER<wbr>,</div><div>                password=str(self.metadata[&#39;ov<wbr>irt-engine-password&#39;]),</div><div>                insecure=True,</div><div>                debug=True,</div><div>            )</div></div><div><br></div></div>
</blockquote></div><br></div><div class="gmail_extra">The clue is actually on the HTTPd logs:</div><div class="gmail_extra">192.168.203.1 - - [12/Oct/2016:17:56:27 -0400] &quot;POST /ovirt-engine/sso/oauth/token HTTP/1.1&quot; 404 74<br></div><div class="gmail_extra"><br></div><div class="gmail_extra">And indeed, from the deubg log:</div><div class="gmail_extra">begin captured logging &lt;&lt; --------------------\n</div><div class="gmail_extra">root: DEBUG: Trying 192.168.203.3...\n</div><div class="gmail_extra">root: DEBUG: Connected to 192.168.203.3 (192.168.203.3) port 443 (#0)\n</div><div class="gmail_extra">root: DEBUG: Initializing NSS with certpath: sql:/etc/pki/nssdb\n</div><div class="gmail_extra">root: DEBUG: skipping SSL peer certificate verification\n</div><div class="gmail_extra">root: DEBUG: ALPN/NPN, server did not agree to a protocol\n</div><div class="gmail_extra">root: DEBUG: SSL connection using TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256\n</div><div class="gmail_extra">root: DEBUG: Server certificate:\n</div><div class="gmail_extra">root: DEBUG: subject: CN=engine,O=Test,C=US\n</div><div class="gmail_extra">root: DEBUG: start date: Oct 11 21:55:29 2016 GMT\n</div><div class="gmail_extra">root: DEBUG: expire date: Sep 16 21:55:29 2021 GMT\n</div><div class="gmail_extra">root: DEBUG: common name: engine\nroot: DEBUG: issuer: CN=engine.38998,O=Test,C=US\n</div><div class="gmail_extra"><b>root: DEBUG: POST /ovirt-engine/sso/oauth/token HTTP/1.1\n</b></div><div class="gmail_extra"><b>root: DEBUG: Host: 192.168.203.3\n</b></div><div class="gmail_extra"><b>root: DEBUG: User-Agent: PythonSDK/4.1.0a0\n</b></div><div class="gmail_extra"><b>root: DEBUG: Accept: application/json\n</b></div><div class="gmail_extra"><b>root: DEBUG: Content-Length: 78\n</b></div><div class="gmail_extra"><b>root: DEBUG: Content-Type: application/x-www-form-urlencoded\nroot: DEBUG: username=admin%40internal&amp;scope=ovirt-app-api&amp;password=123&amp;grant_type=password\n</b></div><div class="gmail_extra"><b>root: DEBUG: upload completely sent off: 78 out of 78 bytes\n</b></div><div class="gmail_extra"><b>root: DEBUG: HTTP/1.1 404 Not Found\n</b></div><div class="gmail_extra"><b>root: DEBUG: Date: Wed, 12 Oct 2016 21:56:27 GMT\n</b></div><div class="gmail_extra"><b>root: DEBUG: Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.1e-fips\n</b></div><div class="gmail_extra"><b>root: DEBUG: Content-Length: 74\n</b></div><div class="gmail_extra"><b>root: DEBUG: Content-Type: text/html; charset=UTF-8\n</b></div><div class="gmail_extra"><b>root: DEBUG: \n</b></div><div class="gmail_extra"><b>root: DEBUG: &lt;html&gt;&lt;head&gt;&lt;title&gt;Error&lt;/title&gt;&lt;/head&gt;&lt;body&gt;404 - Not Found&lt;/body&gt;&lt;/html&gt;\n</b></div><div class="gmail_extra">root: DEBUG: Connection #0 to host 192.168.203.3 left intact\n</div><div class="gmail_extra">--------------------- &gt;&gt; end captured logging<br></div></div>