port created with vnc api is not updated with neutron

Bug #1783688 reported by vimal
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
R5.0
Fix Committed
Critical
vimal
Trunk
Fix Committed
Critical
vimal

Bug Description

port created with vnc api is not updated with neutron

version
----------
queens-5.0-156

test script
-----------

            self.vn_obj = self.vnc_api_h.virtual_network_read(id=self.vn_id)
            if self.api_type == 'neutron':
                self._neutron_create_port()
            else:
                self._contrail_create_port()
            self.created = True

            try:
                self.neutron_handle = self.get_neutron_handle()
                self.obj = self.neutron_handle.get_port(self.uuid) >>>> This handle is empty.
                self.mac_address = self.obj['mac_address']
            except Exception as e:
                pass
            self.logger.debug('Created port %s' % (self.uuid))
            self.read()

{'_cleanups': <fixtures.callmany.CallMany object at 0x7f41aa7c3fd0>,
 '_detail_sources': [],
 '_details': {},
 '_orch': <openstack.OpenstackOrchestrator object at 0x7f41c8046d90>,
 'api_server_port': '8082',
 'api_type': 'neutron',
 'auth_client': <openstack.OpenstackAuth object at 0x7f41c80ccb90>,
 'auth_port': '5000',
 'auth_server_ip': '10.204.216.141',
 'auth_url': 'http://10.204.216.141:5000/v3',
 'authn_url': '/v3/auth/tokens',
 'binding_profile': None,
 'cacert': None,
 'certfile': None,
 'cfgm_ip': '10.204.216.107',
 'connections': <common.connections.ContrailConnections instance at 0x7f41c803a908>,
 'created': True,
 'domain': 'default-domain',
 'extra_dhcp_opts': [],
 'fixed_ips': [],
 'iip_objs': [<vnc_api.gen.resource_client.InstanceIp object at 0x7f41aa7c32d0>],
 'inputs': <common.contrail_test_init.ContrailTestInit object at 0x7f41c8046e10>,
 'insecure': True,
 'keyfile': None,
 'logger': <logging.Logger object at 0x7f41cc517bd0>,
 'mac_address': u'02:15:e4:c7:f1:58',
 'neutron_handle': <quantum_test.QuantumHelper instance at 0x7f41c803a950>,
 'neutron_obj': {u'admin_state_up': True,
                 u'allowed_address_pairs': [],
                 u'binding:host_id': None,
                 u'binding:vif_details': {u'port_filter': True},
                 u'binding:vif_type': u'vrouter',
                 u'binding:vnic_type': u'normal',
                 u'device_id': u'',
                 u'device_owner': u'',
                 u'fixed_ips': [{u'ip_address': u'177.27.28.4',
                                 u'subnet_id': u'c0b39b41-2c10-481b-8e57-34f8d8bd4a50'}],
                 u'id': u'15e4c7f1-5812-481d-9688-ae8309c1f29a',
                 u'mac_address': u'02:15:e4:c7:f1:58',
                 u'name': u'15e4c7f1-5812-481d-9688-ae8309c1f29a',
                 u'network_id': u'4f9cda6e-0897-44e0-9b2b-91e565c5dcbd',
                 u'port_security_enabled': True,
                 u'security_groups': [u'a36534eb-48c0-4afc-b855-23300def2bc5'],
                 u'status': u'DOWN',
                 u'tenant_id': u'6faf06283058459e833eb40606eef577'},
 'obj': {}, <<<<<<<<<<<<<<<<<

logs
-----
tail -f /var/log/contrail/contrail-api.log

07/26/2018 09:18:03 AM [contrail-api] [WARNING]: __default__ [SYS_WARN]: VncApiError: Multiget result contains a key (5bac2200-3451-473d-b598-99defb0d5637) with an empty value. obj_uuid_table: keys ([u'a0a9d421-4f21-4e73-b0e5-2087956f8f96', u'91ad2db0-2d37-45d4-b66f-3e972666c2fe', u'5bac2200-3451-473d-b598-99defb0d5637', u'0d916a69-419a-444d-8ed9-b01a60477950', u'5ef70620-aab3-4b3f-a262-9ef75bafe90d', u'fe05c85f-f259-4c35-a7f9-f500f68cdb95', u'b0b64fb3-8d42-4a37-9d5f-2dfcd22c5751', u'82539b68-9dbc-4cd0-9864-baf3347e10c0', u'83df9f00-f99b-4b3b-9c14-ab5fe7666e36', u'13e2f9f8-2294-41d7-abd0-2d91a8d799ea', u'1954f49a-40ea-499a-86cd-4005a7144bd6', u'87ff0e45-8d62-4f6f-9b3a-0d97ab898f06', u'db372111-b85c-4ae3-9e46-7752aeddc868']), columns (None), start (backref:virtual_machine_interface:), finish (backref:virtual_machine_interface;)
07/26/2018 09:18:03 AM [contrail-api] [WARNING]: __default__ [SYS_WARN]: VncApiError: Multiget result contains a key (87ff0e45-8d62-4f6f-9b3a-0d97ab898f06) with an empty value. obj_uuid_table: keys ([u'a0a9d421-4f21-4e73-b0e5-2087956f8f96', u'91ad2db0-2d37-45d4-b66f-3e972666c2fe', u'5bac2200-3451-473d-b598-99defb0d5637', u'0d916a69-419a-444d-8ed9-b01a60477950', u'5ef70620-aab3-4b3f-a262-9ef75bafe90d', u'fe05c85f-f259-4c35-a7f9-f500f68cdb95', u'b0b64fb3-8d42-4a37-9d5f-2dfcd22c5751', u'82539b68-9dbc-4cd0-9864-baf3347e10c0', u'83df9f00-f99b-4b3b-9c14-ab5fe7666e36', u'13e2f9f8-2294-41d7-abd0-2d91a8d799ea', u'1954f49a-40ea-499a-86cd-4005a7144bd6', u'87ff0e45-8d62-4f6f-9b3a-0d97ab898f06', u'db372111-b85c-4ae3-9e46-7752aeddc868']), columns (None), start (backref:virtual_machine_interface:), finish (backref:virtual_machine_interface;)
07/26/2018 09:18:03 AM [contrail-api] [WARNING]: __default__ [SYS_WARN]: VncApiError: Multiget result contains a key (b0b64fb3-8d42-4a37-9d5f-2dfcd22c5751) with an empty value. obj_uuid_table: keys ([u'a0a9d421-4f21-4e73-b0e5-2087956f8f96', u'91ad2db0-2d37-45d4-b66f-3e972666c2fe', u'5bac2200-3451-473d-b598-99defb0d5637', u'0d916a69-419a-444d-8ed9-b01a60477950', u'5ef70620-aab3-4b3f-a262-9ef75bafe90d', u'fe05c85f-f259-4c35-a7f9-f500f68cdb95', u'b0b64fb3-8d42-4a37-9d5f-2dfcd22c5751', u'82539b68-9dbc-4cd0-9864-baf3347e10c0', u'83df9f00-f99b-4b3b-9c14-ab5fe7666e36', u'13e2f9f8-2294-41d7-abd0-2d91a8d799ea', u'1954f49a-40ea-499a-86cd-4005a7144bd6', u'87ff0e45-8d62-4f6f-9b3a-0d97ab898f06', u'db372111-b85c-4ae3-9e46-7752aeddc868']), columns (None), start (backref:virtual_machine_interface:), finish (backref:virtual_machine_interface;)
07/26/2018 09:18:03 AM [contrail-api] [WARNING]: __default__ [SYS_WARN]: VncApiError: Multiget result contains a key (0d916

Revision history for this message
Nagendra Prasath (npchandran) wrote :

Please help provide the setup access.

Revision history for this message
vimal (vappachan) wrote :

Testbed is available now ( nodem16)

Revision history for this message
Nagendra Prasath (npchandran) wrote :

Seeing below error at API

 /usr/lib/python2.7/site-packages/vnc_cfg_api_server/vnc_cfg_api_server.py in obj_perms_http_get(self=<vnc_cfg_api_server.vnc_cfg_api_server.VncApiServer object>)
 2433 result['permissions'] = self._permissions.obj_perms(get_request(),
 2434 obj_uuid)
 2435 if 'token' in token_info.keys():
 2436 if 'project' in token_info['token'].keys():
 2437 domain = None
token_info = ''
token_info.keys undefined
<type 'exceptions.AttributeError'>: 'str' object has no attribute 'keys'
    __class__ = <type 'exceptions.AttributeError'>
    __delattr__ = <method-wrapper '__delattr__' of exceptions.AttributeError object>
    __dict__ = {}
    __doc__ = 'Attribute not found.'
    __format__ = <built-in method __format__ of exceptions.AttributeError object>
    __getattribute__ = <method-wrapper '__getattribute__' of exceptions.AttributeError object>
    __getitem__ = <method-wrapper '__getitem__' of exceptions.AttributeError object>
    __getslice__ = <method-wrapper '__getslice__' of exceptions.AttributeError object>
    __hash__ = <method-wrapper '__hash__' of exceptions.AttributeError object>
    __init__ = <method-wrapper '__init__' of exceptions.AttributeError object>
    __new__ = <built-in method __new__ of type object>
    __reduce__ = <built-in method __reduce__ of exceptions.AttributeError object>
    __reduce_ex__ = <built-in method __reduce_ex__ of exceptions.AttributeError object>
    __repr__ = <method-wrapper '__repr__' of exceptions.AttributeError object>
    __setattr__ = <method-wrapper '__setattr__' of exceptions.AttributeError object>
    __setstate__ = <built-in method __setstate__ of exceptions.AttributeError object>
    __sizeof__ = <built-in method __sizeof__ of exceptions.AttributeError object>
    __str__ = <method-wrapper '__str__' of exceptions.AttributeError object>
    __subclasshook__ = <built-in method __subclasshook__ of type object>
    __unicode__ = <built-in method __unicode__ of exceptions.AttributeError object>
    args = ("'str' object has no attribute 'keys'",)
    message = "'str' object has no attribute 'keys'"

The above is a description of an error in a Python program. Here is
the original traceback:

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/vnc_cfg_api_server/vnc_cfg_api_server.py", line 2253, in handler_trap_exception
    response = handler(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/vnc_cfg_api_server/vnc_cfg_api_server.py", line 2435, in obj_perms_http_get
    if 'token' in token_info.keys():
AttributeError: 'str' object has no attribute 'keys'

Revision history for this message
Nagendra Prasath (npchandran) wrote :

FYI:
I do see virtual-networks created via openstack command at contrail API if above error is not there..

Revision history for this message
Nagendra Prasath (npchandran) wrote :

In test code when field is not passed, port returns properly. Not sure if it is due to newer python neutronclient.
Not a bug at contrail API

checked at
> /contrail-test/fixtures/quantum_test.py(169)get_port()
-> port_obj = self.obj.show_port(port_id, fields=field)['port']

(Pdb) self.obj
<neutronclient.v2_0.client.Client object at 0x7f87283a2d10>
(Pdb) field
''
(Pdb) self.obj.show_port(port_id, fields=field)['port']
{}
(Pdb) self.obj.show_port(port_id, fields=field)
{u'port': {}}
(Pdb) self.obj.show_port(port_id)
{u'port': {u'status': u'DOWN', u'binding:host_id': None, u'name': u'ff1cce76-f413-4739-9149-27cc7f69365d', u'allowed_address_pa
fb0280ae2b0', u'tenant_id': u'fb870958cab4403a94b12afd094315a9', u'binding:vif_details': {u'port_filter': True}, u'binding:vnic
ac_address': u'02:ff:1c:ce:76:f4', u'port_security_enabled': True, u'fixed_ips': [{u'subnet_id': u'e335d5d6-3621-4877-a4e9-7f4d
7cc7f69365d', u'security_groups': [u'03c35532-2e9c-46d7-b64e-3a758c72280c'], u'device_id': u''}}
(Pdb)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] R5.0

Review in progress for https://review.opencontrail.org/45157
Submitter: vimal (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/45157
Committed: http://github.com/Juniper/contrail-test/commit/dba09ce3504ab07d889b58cca34fad8fbfee13cd
Submitter: Zuul v3 CI (<email address hidden>)
Branch: R5.0

commit dba09ce3504ab07d889b58cca34fad8fbfee13cd
Author: vappachan <email address hidden>
Date: Wed Aug 1 11:08:58 2018 +0530

Closes-bug: #1783688
queens specific changes - 1783688

Change-Id: I64c46941ff9f1ab0ebc5cbd1f9c940b5198c2c47

tags: added: automation
Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] master

Review in progress for https://review.opencontrail.org/45296
Submitter: vimal (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/45296
Committed: http://github.com/Juniper/contrail-test/commit/0a4b1236ae882b81a529cb3ce9ae734cc9a0f683
Submitter: Zuul v3 CI (<email address hidden>)
Branch: master

commit 0a4b1236ae882b81a529cb3ce9ae734cc9a0f683
Author: vappachan <email address hidden>
Date: Wed Aug 1 11:08:58 2018 +0530

Closes-bug: #1783688
queens specific changes - 1783688

Change-Id: I64c46941ff9f1ab0ebc5cbd1f9c940b5198c2c47
(cherry picked from commit dba09ce3504ab07d889b58cca34fad8fbfee13cd)

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.