py-junos-eznc icon indicating copy to clipboard operation
py-junos-eznc copied to clipboard

RPCError when calling get_support_information

Open ACpynet opened this issue 1 year ago • 0 comments

Hello Team,

I am facing intermittent RPC failures when calling dev.rpc.get_support_information(ignore_warning=True, normalize=True) from Juniper PTX10002 devices.

First error:

ncclient.operations.rpc.RPCError:
satellite-platform-management-process subsystem not running - not needed by configuration.

followed by the: lxml.etree.XMLSyntaxError: xmlSAX2Characters: huge text node, line 127449, column 78

for lxml exception am passing huge_tree already on device object: dev = Device(host="xxx", user="xxx", password="xxxx", gather_facts=False, huge_tree=True)

Note: When I edit the file ncclient/xml_.py with fix #186(not merged) always works without any problem. https://github.com/ncclient/ncclient/pull/186/files -> where recover=True is passed to etree.XMLParser

Anyone experiencing the same??

Thanks in advance AC

i.e.

`>>> jnpr.junos.__version__
'2.6.4'
>>>
>>> dev = Device(host=host, user=user, password=pwd, gather_facts=False, huge_tree=True)
>>> dev.open()
Device(blah)
>>> dev.connected
True
>>> dev.rpc.get_support_information(ignore_warning=True, normalize=True)
/Users/user_name/test_JTAC_case_open/JTAC_case_open/lib/python3.8/site-packages/jnpr/junos/device.py:857: RuntimeWarning: An unknown exception occurred - please report.
  warnings.warn(
Traceback (most recent call last):
  File "/Users/user_name/test_JTAC_case_open/JTAC_case_open/lib/python3.8/site-packages/jnpr/junos/decorators.py", line 117, in wrapper
    rsp = function(self, *args, **kwargs)
  File "/Users/user_name/test_JTAC_case_open/JTAC_case_open/lib/python3.8/site-packages/jnpr/junos/device.py", line 1457, in _rpc_reply
    return self._conn.rpc(rpc_cmd_e, filter_xml)._NCElement__doc
  File "/Users/user_name/test_JTAC_case_open/JTAC_case_open/lib/python3.8/site-packages/ncclient/manager.py", line 246, in execute
    return cls(self._session,
  File "/Users/user_name/test_JTAC_case_open/JTAC_case_open/lib/python3.8/site-packages/ncclient/operations/third_party/juniper/rpc.py", line 52, in request
    return self._request(rpc)
  File "/Users/user_name/test_JTAC_case_open/JTAC_case_open/lib/python3.8/site-packages/ncclient/operations/rpc.py", line 375, in _request
    raise self._reply.error
ncclient.operations.rpc.RPCError:
satellite-platform-management-process subsystem not running - not needed by configuration.


During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/user_name/test_JTAC_case_open/JTAC_case_open/lib/python3.8/site-packages/jnpr/junos/rpcmeta.py", line 364, in _exec_rpc
    return self._junos.execute(rpc, **dec_args)
  File "/Users/user_name/test_JTAC_case_open/JTAC_case_open/lib/python3.8/site-packages/jnpr/junos/decorators.py", line 63, in wrapper
    result = function(*args, **kwargs)
  File "/Users/user_name/test_JTAC_case_open/JTAC_case_open/lib/python3.8/site-packages/jnpr/junos/decorators.py", line 31, in wrapper
    return function(*args, **kwargs)
  File "/Users/user_name/test_JTAC_case_open/JTAC_case_open/lib/python3.8/site-packages/jnpr/junos/device.py", line 834, in execute
    rpc_rsp_e = self._rpc_reply(
  File "/Users/user_name/test_JTAC_case_open/JTAC_case_open/lib/python3.8/site-packages/jnpr/junos/decorators.py", line 155, in wrapper
    rsp = NCElement(
  File "/Users/user_name/test_JTAC_case_open/JTAC_case_open/lib/python3.8/site-packages/ncclient/xml_.py", line 179, in __init__
    self.__doc = self.remove_namespaces(self.__result)
  File "/Users/user_name/test_JTAC_case_open/JTAC_case_open/lib/python3.8/site-packages/ncclient/xml_.py", line 239, in remove_namespaces
    self.__root = etree.fromstring(str(self.__transform(etree.parse(StringIO(str(rpc_reply)),
  File "src/lxml/etree.pyx", line 3538, in lxml.etree.parse
  File "src/lxml/parser.pxi", line 1893, in lxml.etree._parseDocument
  File "src/lxml/parser.pxi", line 1913, in lxml.etree._parseMemoryDocument
  File "src/lxml/parser.pxi", line 1793, in lxml.etree._parseDoc
  File "src/lxml/parser.pxi", line 1082, in lxml.etree._BaseParser._parseUnicodeDoc
  File "src/lxml/parser.pxi", line 615, in lxml.etree._ParserContext._handleParseResultDoc
  File "src/lxml/parser.pxi", line 725, in lxml.etree._handleParseResult
  File "src/lxml/parser.pxi", line 654, in lxml.etree._raiseParseError
  File "<string>", line 127449
lxml.etree.XMLSyntaxError: xmlSAX2Characters: huge text node, line 127449, column 78
>>>`

ACpynet avatar Jul 17 '22 12:07 ACpynet