Comment 4 for bug 1314677

Revision history for this message
RedBaron (dheeraj-gupta4) wrote :

I know this bug has been patched, but I ran into a weird situation with the unpatched master branch.
If I specified invalid JSON in the file, the CellStateManagerFile was correctly instantiated (going beyond the point where the bug pops up) and nova-cells went as far as trying to read cell state from the file and failing with invalid JSON.
However, on correcting the JSON, the CellStateManager failed to instantiate with the error message in the original bug.
I couldn't figure out why this happened. Maybe, if you have time, you can investigate it

Appendix: Here are the logs for starting an unpatched nova with invalid JSON

CRITICAL nova [-] ValueError: Expecting property name enclosed in double quotes: line 9 column 9 (char 273)

2014-08-29 14:28:09.030 TRACE nova Traceback (most recent call last):
2014-08-29 14:28:09.030 TRACE nova File "/usr/bin/nova-cells", line 10, in <module>
2014-08-29 14:28:09.030 TRACE nova sys.exit(main())
2014-08-29 14:28:09.030 TRACE nova File "/opt/stack/nova/nova/cmd/cells.py", line 45, in main
2014-08-29 14:28:09.030 TRACE nova manager=CONF.cells.manager)
2014-08-29 14:28:09.030 TRACE nova File "/opt/stack/nova/nova/service.py", line 275, in create
2014-08-29 14:28:09.030 TRACE nova db_allowed=db_allowed)
2014-08-29 14:28:09.030 TRACE nova File "/opt/stack/nova/nova/service.py", line 148, in __init__
2014-08-29 14:28:09.030 TRACE nova self.manager = manager_class(host=self.host, *args, **kwargs)
2014-08-29 14:28:09.030 TRACE nova File "/opt/stack/nova/nova/cells/manager.py", line 91, in __init__
2014-08-29 14:28:09.030 TRACE nova self.state_manager = cell_state_manager()
2014-08-29 14:28:09.030 TRACE nova File "/opt/stack/nova/nova/cells/state.py", line 159, in __new__
2014-08-29 14:28:09.030 TRACE nova return CellStateManagerFile(cell_state_cls, config_path)
2014-08-29 14:28:09.030 TRACE nova File "/opt/stack/nova/nova/cells/state.py", line 466, in __init__
2014-08-29 14:28:09.030 TRACE nova super(CellStateManagerFile, self).__init__(cell_state_cls)
2014-08-29 14:28:09.030 TRACE nova File "/opt/stack/nova/nova/cells/state.py", line 176, in __init__
2014-08-29 14:28:09.030 TRACE nova self._cell_data_sync(force=True)
2014-08-29 14:28:09.030 TRACE nova File "/opt/stack/nova/nova/cells/state.py", line 480, in _cell_data_sync
2014-08-29 14:28:09.030 TRACE nova self.cells_config_data = jsonutils.loads(data)
2014-08-29 14:28:09.030 TRACE nova File "/opt/stack/nova/nova/openstack/common/jsonutils.py", line 176, in loads
2014-08-29 14:28:09.030 TRACE nova return json.loads(strutils.safe_decode(s, encoding), **kwargs)
2014-08-29 14:28:09.030 TRACE nova File "/usr/lib64/python2.7/json/__init__.py", line 338, in loads
2014-08-29 14:28:09.030 TRACE nova return _default_decoder.decode(s)
2014-08-29 14:28:09.030 TRACE nova File "/usr/lib64/python2.7/json/decoder.py", line 365, in decode
2014-08-29 14:28:09.030 TRACE nova obj, end = self.raw_decode(s, idx=_w(s, 0).end())
2014-08-29 14:28:09.030 TRACE nova File "/usr/lib64/python2.7/json/decoder.py", line 381, in raw_decode
2014-08-29 14:28:09.030 TRACE nova obj, end = self.scan_once(s, idx)
2014-08-29 14:28:09.030 TRACE nova ValueError: Expecting property name enclosed in double quotes: line 9 column 9 (char 273)
2014-08-29 14:28:09.030 TRACE nova

As you can see it successfully goes past the state_manager() step where the original bug was found.