lxml.etree.XMLSyntaxError: Opening and ending tag mismatch

180 views
Skip to first unread message

Amrish Patel

unread,
Jul 27, 2020, 11:23:40 AM7/27/20
to Junos Python EZ
Hello,

i am trying to pull ingress replication information from the router and getting this error message. i appreciate any help on this to resolve it. 


>>>from jnpr.junos import Device
>>> from lxml import etree
>>> with Device(host='10.13.33.21', user='autom', password='Automation') as dev:             
...     ir  = dev.rpc.get_ingress_replication_information(application = 'mvpn')
...     print(ir)         
... 
Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
  File "/usr/lib/python3.6/site-packages/jnpr/junos/rpcmeta.py", line 364, in _exec_rpc
    return self._junos.execute(rpc, **dec_args)
  File "/usr/lib/python3.6/site-packages/jnpr/junos/decorators.py", line 76, in wrapper
    return function(*args, **kwargs)
  File "/usr/lib/python3.6/site-packages/jnpr/junos/decorators.py", line 31, in wrapper
    return function(*args, **kwargs)
  File "/usr/lib/python3.6/site-packages/jnpr/junos/device.py", line 810, in execute
    filter_xml=kvargs.get("filter_xml"),
  File "/usr/lib/python3.6/site-packages/jnpr/junos/decorators.py", line 117, in wrapper
    rsp = function(self, *args, **kwargs)
  File "/usr/lib/python3.6/site-packages/jnpr/junos/device.py", line 1413, in _rpc_reply
    return self._conn.rpc(rpc_cmd_e, filter_xml)._NCElement__doc
  File "/usr/lib/python3.6/site-packages/ncclient/manager.py", line 236, in execute
    huge_tree=self._huge_tree).request(*args, **kwds)
  File "/usr/lib/python3.6/site-packages/ncclient/operations/third_party/juniper/rpc.py", line 52, in request
    return self._request(rpc)
  File "/usr/lib/python3.6/site-packages/ncclient/operations/rpc.py", line 338, in _request
    self._reply.parse()
  File "/usr/lib/python3.6/site-packages/ncclient/operations/rpc.py", line 148, in parse
    root = self._root = to_ele(self._raw, huge_tree=self._huge_tree) # The <rpc-reply> element
  File "/usr/lib/python3.6/site-packages/ncclient/xml_.py", line 124, in to_ele
    return x if etree.iselement(x) else etree.fromstring(x.encode('UTF-8'), parser=_get_parser(huge_tree))
  File "src/lxml/etree.pyx", line 3230, in lxml.etree.fromstring (src/lxml/etree.c:81070)
  File "src/lxml/parser.pxi", line 1871, in lxml.etree._parseMemoryDocument (src/lxml/etree.c:121250)
  File "src/lxml/parser.pxi", line 1759, in lxml.etree._parseDoc (src/lxml/etree.c:119926)
  File "src/lxml/parser.pxi", line 1125, in lxml.etree._BaseParser._parseDoc (src/lxml/etree.c:114173)
  File "src/lxml/parser.pxi", line 598, in lxml.etree._ParserContext._handleParseResultDoc (src/lxml/etree.c:107738)
  File "src/lxml/parser.pxi", line 709, in lxml.etree._handleParseResult (src/lxml/etree.c:109447)
  File "src/lxml/parser.pxi", line 638, in lxml.etree._raiseParseError (src/lxml/etree.c:108301)
  File "<string>", line 3054
lxml.etree.XMLSyntaxError: Opening and ending tag mismatch: ir-tunnel line 2931 and ingress-replication-information, line 3054, column 36
>>> 

Rahul Kumar

unread,
Jul 29, 2020, 2:00:31 AM7/29/20
to Amrish Patel, Junos Python EZ
Hi Amrish, 

Could you share the output for the following command - "show ingress-replication mvpn | display xml" from the device. 

Also, share the netconf trace when you execute this script.
For more details for trace-options, refer - 
"https://www.juniper.net/documentation/en_US/junos/topics/example/netconf-traceoptions-configuring.html

Regards
Rahul Kumar


From: junos-p...@googlegroups.com <junos-p...@googlegroups.com> on behalf of Amrish Patel <pramuk...@gmail.com>
Sent: 27 July 2020 20:53
To: Junos Python EZ <junos-p...@googlegroups.com>
Subject: lxml.etree.XMLSyntaxError: Opening and ending tag mismatch
 

[External Email. Be cautious of content]

--
You received this message because you are subscribed to the Google Groups "Junos Python EZ" group.
To unsubscribe from this group and stop receiving emails from it, send an email to junos-python-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/junos-python-ez/04fe2c42-2870-4ce1-aec6-9b29eb6b9694o%40googlegroups.com.

Juniper Business Use Only

Reply all
Reply to author
Forward
0 new messages