Not able to attach policy to a network

Bug #1363584 reported by venu kolli
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
R1.1
Fix Released
Critical
Hampapur Ajay
Trunk
Fix Released
Undecided
Unassigned

Bug Description

create a default policy through webui / api

Attaching a policy to a network gives an internal error during both operations from webui / api

2014-08-31T07:36:36.935Z - debug: In updateFloatingIpList(): JSON Parse error:TypeError: Cannot read property 'length' of undefined
2014-08-31T07:36:36.952Z - error: URL [http://5.5.5.13:9100/virtual-network/026fd53c-6fa2-49b6-86fa-76034d9452b1] returned error ["Internal Server Error"]
2014-08-31T07:36:36.953Z - error: REST Server Error: Internal Server Error
    at APIServer.retryMakeCall (/usr/src/contrail/contrail-web-core/src/serverroot/common/rest.api.js:169:13)
    at EventEmitter.APIServer.makeCall (/usr/src/contrail/contrail-web-core/src/serverroot/common/rest.api.js:280:18)
    at EventEmitter.emit (events.js:99:17)
    at EventEmitter.mixin._fireSuccess (/usr/lib64/node_modules/restler/lib/restler.js:211:10)
    at mixin._responseHandler (/usr/lib64/node_modules/restler/lib/restler.js:152:20)
    at IncomingMessage.parsers.auto (/usr/lib64/node_modules/restler/lib/restler.js:368:7)
    at EventEmitter.mixin._encode (/usr/lib64/node_modules/restler/lib/restler.js:192:29)
    at mixin._responseHandler (/usr/lib64/node_modules/restler/lib/restler.js:148:16)
    at EventEmitter.mixin._decode (/usr/lib64/node_modules/restler/lib/restler.js:164:7)
    at IncomingMessage.mixin._responseHandler (/usr/lib64/node_modules/restler/lib/restler.js:141:14)

Revision history for this message
venu kolli (vkolli) wrote :
Revision history for this message
venu kolli (vkolli) wrote :
Revision history for this message
venu kolli (vkolli) wrote :
Revision history for this message
venu kolli (vkolli) wrote :
Revision history for this message
venu kolli (vkolli) wrote :

Traceback when attaching a policy via api

ERROR:vnc_cfg_api_server.vnc_cfg_api_server:Exception in REST api handler:
<pre>Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/vnc_cfg_api_server/vnc_cfg_api_server.py", line 403, in handler_trap_exception
    return handler(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/vnc_cfg_api_server/gen/vnc_api_server_gen.py", line 2458, in network_policys_http_post
    obj_dict = request.json[key]
  File "/usr/lib/python2.7/dist-packages/bottle.py", line 163, in __get__
    if key not in storage: storage[key] = self.getter(obj)
  File "/usr/lib/python2.7/dist-packages/bottle.py", line 1020, in json
    return json_loads(self.body.read(self.MEMFILE_MAX))
  File "/usr/lib/python2.7/json/__init__.py", line 326, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 366, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python2.7/json/decoder.py", line 384, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
</pre>

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/bottle.py", line 764, in _handle
    return route.call(**args)
  File "/usr/lib/python2.7/dist-packages/bottle.py", line 1575, in wrapper
    rv = callback(*a, **ka)
  File "/usr/lib/python2.7/dist-packages/vnc_cfg_api_server/vnc_cfg_api_server.py", line 416, in handler_trap_exception
    raise e
ValueError: No JSON object could be decoded

description: updated
Sanju Abraham (asanju)
Changed in juniperopenstack:
milestone: none → r1.10-fcs
Rahul (rahuls)
tags: added: config ui
Revision history for this message
Prakash Bailkeri (prakashmb) wrote :

From the api server logs on the setup: I see repeated error log while attaching the policy to virtual network:

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/vnc_cfg_api_server/vnc_cfg_api_server.py", line 403, in handler_trap_exception
    return handler(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/vnc_cfg_api_server/gen/vnc_api_server_gen.py", line 15179, in virtual_network_http_put
    (ok, result) = self._put_common(request, 'virtual_network', id, fq_name, obj_dict)
  File "/usr/lib/python2.7/dist-packages/vnc_cfg_api_server/vnc_cfg_api_server.py", line 1093, in _http_put_common
    obj_uuid, fq_name_str, obj_type, 'put', log_msg)
  File "/usr/lib/python2.7/dist-packages/vnc_cfg_api_server/vnc_cfg_api_server.py", line 1002, in config_object_error
    if object_type is not None:
NameError: global name 'object_type' is not defined

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/bottle.py", line 764, in _handle
    return route.call(**args)
  File "/usr/lib/python2.7/dist-packages/bottle.py", line 1575, in wrapper
    rv = callback(*a, **ka)
  File "/usr/lib/python2.7/dist-packages/vnc_cfg_api_server/vnc_cfg_api_server.py", line 416, in handler_trap_exception
    raise e
NameError: global name 'object_type' is not defined
5.5.5.12 - - [2014-08-31 00:36:36] "PUT /virtual-network/026fd53c-6fa2-49b6-86fa-76034d9452b1 HTTP/1.1" 500 156 0.008587

This error is fixed in R1.1 (https://github.com/Juniper/contrail-controller/commit/7ca465bfa483)

Regarding the error in comment #5, (network_policys_http_post), can be related to the size of json body(MEMFILE_MAX = 102400). Do you have more number of rules in the policy?

information type: Proprietary → Public
Revision history for this message
Hampapur Ajay (hajay) wrote :

fixed by 7ca465bfa483a573e99caad7d9bf4abfc67b2cf1

Revision history for this message
venu kolli (vkolli) wrote :

Not seeing this issue anymore on 1.1 build 34

Revision history for this message
venu kolli (vkolli) wrote :

Not seeing this issue anymore

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.