placement in neutron_lib could not process keystone exceptions.

Bug #1862565 reported by Yang Youseok on 2020-02-10
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

For stein/stable, routed network which enable placement client.

I could not find root cause though, but the current situation looks like this.

- neutron_lib.placement.get_inventory() called.
- since IPV4_RESOURCE_CLASS is not created yet, keystoneauth1 emit NotFound exception.
- (weird) keystoneauth1 does sereilize error response from placement
  - in keystoneauth1/exceptions/, they assume that 'error' string in body, but placement encode response like { 'errors': [...] }.
    - I think placement way is right from the reference ( and keystoneauth1 does not correctly follow the spec, but not sure.

- get_inventory() does not change NotFound exception to PlacementResourceProviderNotFound exception since the exception does not have 'details'.
- final exception which user encounter is

2020-02-10 10:00:20.757 24507 DEBUG [-] ### exception argument of type 'NoneType' is not iterable _update_nova_inventory /opt/openstack/src/neutron/neutron/services/segments/

I'm not sure how others use placement api in neutron bacause it occurs every logics.


Yang Youseok (ileixe) wrote :

Another interface mismatch.

When placement API in neutron was trying to associate host in the created aggregate, it serialized a payload with uuid list.

But from placement API 1.19 aggregate association API expect object type. (placement/schemas/ PUT_AGGREGATES_SCHEMA_V1_19)

The result is that host could not registered to host aggregate emitting below exception.

2020-02-10 14:36:54.252 28845 DEBUG placement.wsgi_wrapper [req-bf6e64f6-63bf-43c6-b6d8-8856817c1920 3bd0c1cbe8f140cf982e1ffc22ef9842 3f7b5c5c19a84d10984d49ab1226569f - default default] Placement API returning an error response: JSON does not validate: ['e65a8fe8-562a-400d-8711-369ed6ffc7af'] is not of type 'object'

Failed validating 'type' in schema:
    {'additionalProperties': False,
     'properties': {'aggregates': {'items': {'format': 'uuid',
                                             'type': 'string'},
                                   'type': 'array',
                                   'uniqueItems': True},
                    'resource_provider_generation': {'type': 'integer'}},
     'required': ['aggregates', 'resource_provider_generation'],
     'type': 'object'}

On instance:
    ['e65a8fe8-562a-400d-8711-369ed6ffc7af'] call_func /opt/openstack/src/placement/placement/

Yang Youseok (ileixe) wrote :

Root cause found. Previous placement client request payload with content-type "text/*", and keystoneauth1 process it correctly.

And this bug report duplicated ''. Master was fixed but other release are affrected.

Akihiro Motoki (amotoki) wrote :

I added a comment to bug 1828543 with backport potential tags and mark this as duplicate to the bug. Backports can be discussed but the fix consists of multiple fixes and we need to consider the backport possibility carefully.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers