CiscoDevNet / clus2017_iosxe_demo_booth

Demo's and Code used at the IOS XE Demo Booth
5 stars 4 forks source link

Getting ValueError when I initiate subcription via curl #1

Open afk-always opened 5 years ago

afk-always commented 5 years ago

ERROR | Thread-5 | 2019-02-19 17:49:10,807 | Exception on /sendrpc [POST] Traceback (most recent call last): File "/usr/lib64/python2.7/site-packages/flask/app.py", line 2292, in wsgi_app response = self.full_dispatch_request() File "/usr/lib64/python2.7/site-packages/flask/app.py", line 1815, in full_dispatch_request rv = self.handle_user_exception(e) File "/usr/lib64/python2.7/site-packages/flask/app.py", line 1718, in handle_user_exception reraise(exc_type, exc_value, tb) File "/usr/lib64/python2.7/site-packages/flask/app.py", line 1813, in full_dispatch_request rv = self.dispatch_request() File "/usr/lib64/python2.7/site-packages/flask/app.py", line 1799, in dispatch_request return self.view_functionsrule.endpoint File "ietf_client_ncc.py", line 170, in sendrpc dampening_period=dampening_period) File "/usr/lib/python2.7/site-packages/ncclient/manager.py", line 253, in _missing subele(root, arg) File "/usr/lib/python2.7/site-packages/ncclient/xml.py", line 215, in sub_ele = lambda parent, tag, attrs={}, extra: etree.SubElement(parent, qualify(tag), attrs, extra) File "src/lxml/etree.pyx", line 3110, in lxml.etree.SubElement File "src/lxml/apihelpers.pxi", line 179, in lxml.etree._makeSubElement File "src/lxml/apihelpers.pxi", line 1678, in lxml.etree._tagValidOrRaise ValueError: Invalid tag name u'<function callback_kafka_publish at 0x7f88fe69dde8>' INFO | Thread-5 | 2019-02-19 17:49:10,808 | 127.0.0.1 - - [19/Feb/2019 17:49:10] "POST /sendrpc HTTP/1.1" 500 -

einarnn commented 5 years ago

Which version of the ncclient library do you have installed? Please make sure you have installed it this way in a virtualenv:

pip install git+https://github.com/CiscoDevNet/ncclient.git
afk-always commented 5 years ago

$ pip list | grep ncc ncclient 0.6.3

einarnn commented 5 years ago

That is not the forked version of ncclient I mentioned above. The demo you are trying to use depends on that forked version, which has functionality not yet in the main public distribution (as the functionaltymdepends on and IOS XE-specific implementation of an early draft of the related IETF YANG Push specifications).

Please install the fork I referred to on top of the public version of ncclient.

shashiyms commented 5 years ago

I'am getting similar error as below, when i try to establish a subscription.

curl -d '{"xpath":"/cpu-usage/cpu-utilization/five-seconds","period":1000,"incident_id":1234}' -H 'Content-type: application/json' http://127.0.0.1:8320/sendrpc

Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/flask/app.py", line 2311, in wsgi_app response = self.full_dispatch_request() File "/usr/lib/python2.7/site-packages/flask/app.py", line 1834, in full_dispatch_request rv = self.handle_user_exception(e) File "/usr/lib/python2.7/site-packages/flask/app.py", line 1737, in handle_user_exception reraise(exc_type, exc_value, tb) File "/usr/lib/python2.7/site-packages/flask/app.py", line 1832, in full_dispatch_request rv = self.dispatch_request() File "/usr/lib/python2.7/site-packages/flask/app.py", line 1818, in dispatch_request return self.view_functionsrule.endpoint File "/opt/kafka/ietf.py", line 171, in sendrpc dampening_period=dampening_period) File "/usr/lib/python2.7/site-packages/ncclient-0.6.6-py2.7.egg/ncclient/manager.py", line 273, in missing File "/usr/lib/python2.7/site-packages/ncclient-0.6.6-py2.7.egg/ncclient/xml.py", line 231, in File "lxml.etree.pyx", line 2898, in lxml.etree.SubElement (src/lxml/lxml.etree.c:62059) File "apihelpers.pxi", line 171, in lxml.etree._makeSubElement (src/lxml/lxml.etree.c:14255) File "apihelpers.pxi", line 1517, in lxml.etree._tagValidOrRaise (src/lxml/lxml.etree.c:26654) ValueError: Invalid tag name u'<function callback_kafka_publish at 0x7f987a0e3b18>'

& my nccclient version is

[root@ansibletest site-packages]# pip list |grep ncc DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. ncclient 0.7.0+31.gcc3077c

Not sure why i'am still seeing dependency issues.Can somebody pls help me with this.

tronar commented 2 weeks ago

Wow. The telemetry lab in the cisco ENAUI course also depends on this (as of yet) not published extension... and the error you get is kind of cryptic (an invalid tag name in an lxml etree fn receiving a callback address somehow)