VNs are getting removed in the neutron list after attaching policy to vns

Bug #1743546 reported by musharani
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
Trunk
Fix Committed
Critical
Naga Kiran

Bug Description

If policy is attached to vn, that particular vn is getting removed from neutron net-list. This is done through UI.

Getting below error when I checked in contrail-api log.

Issue seen in Build 5.0.0-167 newton and 5.0.0-93 ocata

vn list before attaching policy:
=================================
root@nodek12:/var/log/nova# openstack network list
+--------------------------------------+-------------------------+----------------------------------------------------------------------------+
| ID | Name | Subnets |
+--------------------------------------+-------------------------+----------------------------------------------------------------------------+
| 54c26977-d553-4dc6-8dba-38a992fa0559 | vnet2 | 9d71d4d4-2c93-4a4e-87ac-7d2112b520ce, a06f93f2-0c2a-463f-a41d-a28983fc8586 |
| 360970dd-a5cf-4470-ad53-14ee16396626 | vnet1 | 3ed77f79-9c55-49e8-a97d-a5a7bcffa8c6, bd8e4481-ccab-44fa-bd53-a1a85819ec7e |
| 3c6d33e7-3eba-4dc3-98ac-3efd4dc8387f | left_vn | da7bb45f-6fa0-4420-b871-f14d0c697a72 |
| ebed3ea7-d287-4a43-81d8-51c6f422b95a | default-virtual-network | |
| e52df03b-c2aa-4a8e-91fd-8ef575e7d949 | right_vn | 0824e552-d9ca-47d3-a880-fda65027020c |
| 7f489873-cae7-4b99-a3d7-96ed80e9800f | __link_local__ | |
| 428f6cb0-7f44-40b3-8ea0-928afc73dea1 | vnet3 | 476dde3f-9392-42d0-9d98-5a9c4835b998, 6a3bf6aa-ecb8-4b65-b85a-95ff4bf78a0f |
| 43fe8645-d262-41d7-9849-bfb5031233bd | ip-fabric | |
| b413b91f-2874-435a-830d-dc6f754a8692 | vnet0 | 6dbace39-24d2-4d20-b0eb-4c17f38bcda4, c6e4b2b4-de55-4794-8325-2e5b1b3d83f4 |
| bc7e6155-1265-445f-9f8e-11df74c7ed09 | vn-test | d10be2d7-25b0-4557-b04a-382930ca2a9d |
+--------------------------------------+-------------------------+----------------------------------------------------------------------------+

Vn list after attaching policy:
===============================
root@nodek12:/var/log/nova# openstack network list
+--------------------------------------+-------------------------+----------------------------------------------------------------------------+
| ID | Name | Subnets |
+--------------------------------------+-------------------------+----------------------------------------------------------------------------+
| 43fe8645-d262-41d7-9849-bfb5031233bd | ip-fabric | |
| 3c6d33e7-3eba-4dc3-98ac-3efd4dc8387f | left_vn | da7bb45f-6fa0-4420-b871-f14d0c697a72 |
| ebed3ea7-d287-4a43-81d8-51c6f422b95a | default-virtual-network | |
| 7f489873-cae7-4b99-a3d7-96ed80e9800f | __link_local__ | |
| 428f6cb0-7f44-40b3-8ea0-928afc73dea1 | vnet3 | 476dde3f-9392-42d0-9d98-5a9c4835b998, 6a3bf6aa-ecb8-4b65-b85a-95ff4bf78a0f |
| 360970dd-a5cf-4470-ad53-14ee16396626 | vnet1 | 3ed77f79-9c55-49e8-a97d-a5a7bcffa8c6, bd8e4481-ccab-44fa-bd53-a1a85819ec7e |
| bc7e6155-1265-445f-9f8e-11df74c7ed09 | vn-test | d10be2d7-25b0-4557-b04a-382930ca2a9d |
+--------------------------------------+-------------------------+----------------------------------------------------------------------------+
root@nodek12:/var/log/nova#

From api log:
=============
01/16/2018 05:21:41 PM [contrail-api]: __default__ [SYS_ERR]: VncApiError: <type 'exceptions.AttributeError'>
Python 2.7.12: /usr/bin/python
Tue Jan 16 17:21:41 2018

A problem occurred in a Python script. Here is the sequence of
function calls leading up to the error, in the order they occurred.

 /usr/lib/python2.7/dist-packages/vnc_cfg_api_server/vnc_db.py in _dbe_subscribe_callback(self=<vnc_cfg_api_server.vnc_db.VncServerKombuClient object>, oper_info={u'fq_name': [u'default-domain', u'ctest-WebuiTestSanity-14874782', u'vnet0'], u'oper': u'UPDATE', u'request-id': u'req-626599f8-c74d-4dc8-aabd-d5de5a3cb105', u'type': u'virtual_network', u'uuid': u'b413b91f-2874-435a-830d-dc6f754a8692'})
  275 trace = self._generate_msgbus_notify_trace(oper_info)
  276
  277 self._db_client_mgr.dbe_uve_trace(**oper_info)
  278 if oper_info['oper'] == 'CREATE':
  279 self._dbe_create_notification(oper_info)
self = <vnc_cfg_api_server.vnc_db.VncServerKombuClient object>
self._db_client_mgr = <vnc_cfg_api_server.vnc_db.VncDbClient object>
self._db_client_mgr.dbe_uve_trace = <bound method VncDbClient.dbe_uve_trace of <vnc_cfg_api_server.vnc_db.VncDbClient object>>
oper_info = {u'fq_name': [u'default-domain', u'ctest-WebuiTestSanity-14874782', u'vnet0'], u'oper': u'UPDATE', u'request-id': u'req-626599f8-c74d-4dc8-aabd-d5de5a3cb105', u'type': u'virtual_network', u'uuid': u'b413b91f-2874-435a-830d-dc6f754a8692'}

 /usr/lib/python2.7/dist-packages/vnc_cfg_api_server/vnc_db.py in dbe_uve_trace(self=<vnc_cfg_api_server.vnc_db.VncDbClient object>, oper=u'UPDATE', type=u'virtual_network', uuid=u'b413b91f-2874-435a-830d-dc6f754a8692', obj_dict=None, **kwargs={u'fq_name': [u'default-domain', u'ctest-WebuiTestSanity-14874782', u'vnet0'], u'request-id': u'req-626599f8-c74d-4dc8-aabd-d5de5a3cb105'})
 1193 if obj_dict is None:
 1194 try:
 1195 obj_class = self._db_client_mgr.get_resource_class(type)
 1196 fields = list(obj_class.prop_fields) + list(obj_class.ref_fields)
 1197 (ok, obj_dict) = self.dbe_read(type, uuid, obj_fields=fields)
obj_class undefined
self = <vnc_cfg_api_server.vnc_db.VncDbClient object>
self._db_client_mgr undefined
type = u'virtual_network'
<type 'exceptions.AttributeError'>: 'VncDbClient' object has no attribute '_db_client_mgr'
    __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 = ("'VncDbClient' object has no attribute '_db_client_mgr'",)
    message = "'VncDbClient' object has no attribute '_db_client_mgr'"

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/dist-packages/vnc_cfg_api_server/vnc_db.py", line 277, in _dbe_subscribe_callback
    self._db_client_mgr.dbe_uve_trace(**oper_info)
  File "/usr/lib/python2.7/dist-packages/vnc_cfg_api_server/vnc_db.py", line 1195, in dbe_uve_trace
    obj_class = self._db_client_mgr.get_resource_class(type)
AttributeError: 'VncDbClient' object has no attribute '_db_client_mgr'

musharani (musharani)
tags: added: sanityblocker
musharani (musharani)
description: updated
description: updated
musharani (musharani)
Changed in juniperopenstack:
assignee: nobody → Sachin Bansal (sbansal)
Revision history for this message
Sachin Bansal (sbansal) wrote :

This should have been fixed with this commit: https://github.com/Juniper/contrail-controller/commit/aa4a4542a9570b5691402361aeaded3851f5fea9#diff-cf31ed51db056c325c8954d53f73c2ec

Please try again with a build that has the above commit.

Changed in juniperopenstack:
status: New → Fix Committed
musharani (musharani)
description: updated
Revision history for this message
musharani (musharani) wrote :

This is testing is done through UI. Still this issue is seen in latest build mainline - 170 build newton.
Hence moved to new state.

Revision history for this message
Sachin Bansal (sbansal) wrote :

Are you able to see the networks with curl? Could you please provide access to setup where this is seen along with steps to recreate?

Revision history for this message
musharani (musharani) wrote :

Setup is available. You can use nodek12
node: nodek12
username: admin
UI password: contrail123
ssh password: c0ntrail123

Steps to recreate:
==================
1. create networks using Webui. Configure->Networks->Network
2. Create policy using configure->Networks->Policy
3. Check networks list using openstack networks list
4. Again go to Configure->Networks->Network.
   Click the edit option to attach the policy. Select some policy in Network policy list box and save it.
5. Again check the networks list using openstack networks list command after attaching policy to vn.

Now you can see the issue. The network won't be listed.

I tried to get the networks list using curl command. But got the response with authentication required message.

root@nodek12:~# curl -s -X GET http://10.204.216.232:9696/v2.0/networks.json -H "User-Agent: python-neutronclient" -H "Accept: application/json" -H "X-Auth-Token:$TOKEN" | python -mjson.tool
{
    "error": {
        "code": 401,
        "message": "The request you have made requires authentication.",
        "title": "Unauthorized"
    }
}
root@nodek12:~#

Revision history for this message
Sachin Bansal (sbansal) wrote :

Naga,

UI is not populating sequence number when adding link from VN to policy. This is required. Could you please look into it? We need to populate the sequence number even if there is only one policy.

Sachin

Revision history for this message
Naga Kiran (nagakiran) wrote :

It was fixed (sequence numbers not added for link between VN and policy) as part of bug https://bugs.launchpad.net/juniperopenstack/+bug/1743714

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.