-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
_merge_updates() does not handle case where new_resp is None #102
Comments
With the workaround in place, there appears to be multiple packets which fail to parse correctly, before it returns data: % python3 subscribe.py |
hey @ipmonk |
Hi Anton, debugged this further, it is getting tripped up by this path:
'Traceback (most recent call last):\n File "/Users/foo/scripts/foo/gnmi-scripts/venv/lib/python3.9/site-packages/pygnmi/client.py", line 1135, in telemetryParser\n update_container.update({'val': json.loads(update_msg.val.json_val)})\n File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/json/init.py", line 346, in loads\n return _default_decoder.decode(s)\n File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/json/decoder.py", line 337, in decode\n obj, end = self.raw_decode(s, idx=_w(s, 0).end())\n File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/json/decoder.py", line 355, in raw_decode\n raise JSONDecodeError("Expecting value", s, err.value) from None\njson.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File "/Users/foo/.vscode/extensions/ms-python.python-2022.18.2/pythonFiles/lib/python/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_resolver.py", line 192, in _get_py_dictionary\n attr = getattr(var, name)\nAttributeError\n' However, If I change the encoding to PROTO, we get this data, and no crash is seen.
According to JNPR, PROTO is the recommended encoding when using Subscribe() |
Another example of json_val which causes an exception:
|
Crash seen when connecting to a Juniper box running Junos: 21.4R2-S1.12-EVO
resulted in an unhandled exception:
workaround was to add a line to client.py in _merge_updates()
The text was updated successfully, but these errors were encountered: