Il giorno mer 7 nov 2018 alle ore 14:47 Ondra Machacek <omachace@redhat.com> ha scritto:
On 11/7/18 10:24 AM, Sandro Bonazzola wrote:
> Il giorno mar 6 nov 2018, 14:56 Ondra Machacek <omachace@redhat.com> ha
> scritto:
>
>> You are using Python SDK from master, but 4.2 engine, there are
>> currently changes in master Python SDK, which are not understand by 4.2
>> engine. I would suggest you to use both same versions.
>>
>
>
> we shouldn't break api in sdk4. isn't there any way to preserve <4.3
> compatibility in sdk4-4.3?

It's not breaking the API backward compatibility.

As an example see this:

API 4.3 introduce new parameter 'abc' for VM, so in 4.3 you can set it
as follows:

  $ curl -X POST -d '<vm><abc>value</abc></vm>'
https://fqdn:8443/ovirt-engine/api/vms

And it succeed, but in 4.2 if you send such request you will get:

<fault>
     <detail>For correct usage, see:
https://fqdn:8443/ovirt-engine/apidoc#services/vms/methods/add</detail>
     <reason>Request syntactically incorrect.</reason>
</fault>

That's excatly what is happening in network OST job. For 4.2 it's just
unknown parameter. And we fail if client send something unknown to API.

Thanks for explanation, looks good to me then.
 

>
>
>
>
>> Also I would suggest you to send just needed parameters for specific
>> actions. For example, when using preview_snapshot action you should send
>> Snaphost object with just ID, not full object. It's not really needed
>> and you wouldn't be hitting this issue.
>>
>> On 11/6/18 1:25 PM, Eitan Raviv wrote:
>>> Hi,
>>>
>>> We have a failure on OST/network-suite-master for several days now.
>>> My suspicions of the cause are detailed below.
>>> Can you have a look?
>>>
>>> Thanks
>>>
>>> ---------- Forwarded message ---------
>>> From: Eitan Raviv <eraviv@redhat.com>
>>> Date: Mon, Nov 5, 2018 at 8:39 AM
>>> Subject: Re: [oVirt Jenkins] ovirt-system-tests_network-suite-4.2 -
>> Build #
>>> 719 - Still Failing!
>>> To: Ori Liel <oliel@redhat.com>
>>>
>>>
>>> Hi,
>>> Can you have a look?
>>> Thanks
>>>
>>> On Thu, Nov 1, 2018 at 10:08 AM Eitan Raviv <eraviv@redhat.com> wrote:
>>>
>>>> Hi Ondra,
>>>>
>>>> We have above failure on OST network-suite-4.2 [1] due to:
>>>> Fault reason is "Request syntactically incorrect.". Fault detail is "For
>>>> correct usage, see:
>>>>
>> https://192.168.201.4/ovirt-engine/apidoc#services/vm/methods/preview_snapshot
>>>> "
>>>>
>>>> and I see in engine.log [2]:
>>>>
>>>> javax.xml.bind.UnmarshalException: unexpected element (uri:"",
>> local:"disks")
>>>>
>>>> at the same time I see in model_4.2 [3] that a change was done to add
>> the disks, but if i am not mistaken the ovirt-engine-sdk pom.xml [4] was
>> not bumped to reflect this change.
>>>>
>>>> Can you please check?
>>>>
>>>> Thanks
>>>>
>>>> [1]
>>>>
>> https://jenkins.ovirt.org/job/ovirt-system-tests_network-suite-4.2/719/artifact/exported-artifacts/pytest.junit.xml
>>>> [2]
>>>>
>> https://jenkins.ovirt.org/job/ovirt-system-tests_network-suite-4.2/717/artifact/exported-artifacts/tests.test_mac_pools/lago-network-suite-4-2-engine/_var_log/ovirt-engine/engine.log
>>>> [3]
>>>>
>> https://gerrit.ovirt.org/#/q/project:ovirt-engine-api-model+branch:model_4.2
>>>> [4]
>> https://gerrit.ovirt.org/#/q/project:ovirt-engine-sdk+branch:sdk_4.2
>>>>
>>>>
>>>>
>>>> ---------- Forwarded message ---------
>>>> From: Edward Haas <edwardh@redhat.com>
>>>> Date: Thu, Nov 1, 2018 at 8:35 AM
>>>> Subject: Fwd: [oVirt Jenkins] ovirt-system-tests_network-suite-4.2 -
>> Build
>>>> # 719 - Still Failing!
>>>> To: <rhevm-network-staff@redhat.com>
>>>>
>>>>
>>>> FYI
>>>>
>>>> ---------- Forwarded message ---------
>>>> From: <jenkins@jenkins.phx.ovirt.org>
>>>> Date: Thu, Nov 1, 2018 at 6:02 AM
>>>> Subject: [oVirt Jenkins] ovirt-system-tests_network-suite-4.2 - Build #
>>>> 719 - Still Failing!
>>>> To: <lgoldber@redhat.com>, <edwardh@redhat.com>, <infra@ovirt.org>
>>>>
>>>>
>>>> Project:
>>>> http://jenkins.ovirt.org/job/ovirt-system-tests_network-suite-4.2/
>>>> Build:
>>>> http://jenkins.ovirt.org/job/ovirt-system-tests_network-suite-4.2/719/
>>>> Build Number: 719
>>>> Build Status:  Still Failing
>>>> Triggered By: Started by timer
>>>>
>>>> -------------------------------------
>>>> Changes Since Last Success:
>>>> -------------------------------------
>>>> Changes for Build #717
>>>> [Marcin Sobczyk] Change logging level for 'schema.inconsistency'
>>>>
>>>>
>>>> Changes for Build #718
>>>> [Ales Musil] master: Update master suite compatibility version
>>>>
>>>>
>>>> Changes for Build #719
>>>> [Ales Musil] master: Update master suite compatibility version
>>>>
>>>>
>>>>
>>>>
>>>> -----------------
>>>> Failed Tests:
>>>> -----------------
>>>> 1 tests failed.
>>>> FAILED:
>>>>
>> network-suite-4.2.tests.test_mac_pools.test_undo_preview_snapshot_when_mac_used_reassigns_a_new_mac
>>>>
>>>> Error Message:
>>>> Error: Fault reason is "Request syntactically incorrect.". Fault detail
>> is
>>>> "For correct usage, see:
>>>>
>> https://192.168.201.4/ovirt-engine/apidoc#services/vm/methods/preview_snapshot
>> ".
>>>> HTTP response code is 400.
>>>>
>>>> Stack Trace:
>>>> system = <lib.system.SDKSystemRoot object at 0x7fc7f91f48d0>
>>>> default_cluster = <lib.clusterlib.Cluster object at 0x7fc7f91f4bd0>
>>>> ovirtmgmt_vnic_profile = <lib.netlib.VnicProfile object at
>> 0x7fc7f81b3710>
>>>> cirros_template = 'Cirros_0_4_0'
>>>>
>>>>       def test_undo_preview_snapshot_when_mac_used_reassigns_a_new_mac(
>>>>               system, default_cluster, ovirtmgmt_vnic_profile,
>>>> cirros_template):
>>>>           with virtlib.vm_pool(system, size=2) as (vm_0, vm_1):
>>>>               vm_0.create(vm_name=VM0,
>>>>                           cluster=default_cluster,
>>>>                           template=cirros_template)
>>>>               vm_0.wait_for_down_status()
>>>>
>>>>               vm_0.run()
>>>>               vm_0.wait_for_up_status()
>>>>
>>>>               nicless_snapshot = _create_snapshot(vm_0)
>>>>
>>>>               vm_0.create_vnic(NIC_NAME_1, ovirtmgmt_vnic_profile,
>>>> MAC_ADDR_1)
>>>>               vm_0.stop()
>>>>               vm_0.wait_for_down_status()
>>>>
>>>>>             nicless_snapshot.preview()
>>>>
>>>> network-suite-4.2/tests/test_mac_pools.py:124:
>>>> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>> _
>>>> _ _ _
>>>> network-suite-4.2/lib/virtlib.py:243: in preview
>>>>       snapshot=self.get_sdk_type()
>>>> /usr/lib64/python2.7/site-packages/ovirtsdk4/services.py:31091: in
>>>> preview_snapshot
>>>>       return self._internal_action(action, 'previewsnapshot', None,
>> headers,
>>>> query, wait)
>>>> /usr/lib64/python2.7/site-packages/ovirtsdk4/service.py:299: in
>>>> _internal_action
>>>>       return future.wait() if wait else future
>>>> /usr/lib64/python2.7/site-packages/ovirtsdk4/service.py:55: in wait
>>>>       return self._code(response)
>>>> /usr/lib64/python2.7/site-packages/ovirtsdk4/service.py:296: in callback
>>>>       self._check_fault(response)
>>>> /usr/lib64/python2.7/site-packages/ovirtsdk4/service.py:132: in
>>>> _check_fault
>>>>       self._raise_error(response, body)
>>>> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>> _
>>>> _ _ _
>>>>
>>>> response = <ovirtsdk4.http.Response object at 0x7fc7f81b3350>
>>>> detail = <ovirtsdk4.types.Fault object at 0x7fc7f81b39d0>
>>>>
>>>>       @staticmethod
>>>>       def _raise_error(response, detail=None):
>>>>           """
>>>>               Creates and raises an error containing the details of the
>>>> given HTTP
>>>>               response and fault.
>>>>
>>>>               This method is intended for internal use by other
>> components
>>>> of the
>>>>               SDK. Refrain from using it directly, as backwards
>>>> compatibility isn't
>>>>               guaranteed.
>>>>               """
>>>>           fault = detail if isinstance(detail, types.Fault) else None
>>>>
>>>>           msg = ''
>>>>           if fault:
>>>>               if fault.reason:
>>>>                   if msg:
>>>>                       msg += ' '
>>>>                   msg = msg + 'Fault reason is "%s".' % fault.reason
>>>>               if fault.detail:
>>>>                   if msg:
>>>>                       msg += ' '
>>>>                   msg = msg + 'Fault detail is "%s".' % fault.detail
>>>>           if response:
>>>>               if response.code:
>>>>                   if msg:
>>>>                       msg += ' '
>>>>                   msg = msg + 'HTTP response code is %s.' % response.code
>>>>               if response.message:
>>>>                   if msg:
>>>>                       msg += ' '
>>>>                   msg = msg + 'HTTP response message is "%s".' %
>>>> response.message
>>>>
>>>>           if isinstance(detail, six.string_types):
>>>>               if msg:
>>>>                   msg += ' '
>>>>               msg = msg + detail + '.'
>>>>
>>>>           class_ = Error
>>>>           if response is not None:
>>>>               if response.code in [401, 403]:
>>>>                   class_ = AuthError
>>>>               elif response.code == 404:
>>>>                   class_ = NotFoundError
>>>>
>>>>           error = class_(msg)
>>>>           error.code = response.code if response else None
>>>>           error.fault = fault
>>>>>         raise error
>>>> E       Error: Fault reason is "Request syntactically incorrect.". Fault
>>>> detail is "For correct usage, see:
>>>>
>> https://192.168.201.4/ovirt-engine/apidoc#services/vm/methods/preview_snapshot
>> ".
>>>> HTTP response code is 400.
>>>>
>>>> /usr/lib64/python2.7/site-packages/ovirtsdk4/service.py:118: Error
>>>>
>>>
>> _______________________________________________
>> Infra mailing list -- infra@ovirt.org
>> To unsubscribe send an email to infra-leave@ovirt.org
>> Privacy Statement: https://www.ovirt.org/site/privacy-policy/
>> oVirt Code of Conduct:
>> https://www.ovirt.org/community/about/community-guidelines/
>> List Archives:
>> https://lists.ovirt.org/archives/list/infra@ovirt.org/message/T5FWQGOS7TEJUTSVTUP2BD3ZXLUPRCWF/
>>
>


--

SANDRO BONAZZOLA

MANAGER, SOFTWARE ENGINEERING, EMEA R&D RHV

Red Hat EMEA

sbonazzo@redhat.com