cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
168
Views
0
Helpful
1
Replies
Highlighted
Cisco Employee

ncs.maapi.Maapi() failed says Bad protocol

Hi Experts, need help on couldn't able to find the why the `ncs.maapi.Maapi()` failed.

 

In [1]: import ncs

In [2]: m = ncs.maapi.Maapi()
---------------------------------------------------------------------------
Error                                     Traceback (most recent call last)
<ipython-input-2-e9dc812e0d89> in <module>
----> 1 m = ncs.maapi.Maapi()

~/cisco/nso-development/nso-5.3.1/src/ncs/pyapi/ncs/maapi.py in __init__(self, ip, port, path, load_schemas, msock)
    178             self.msock = msock
    179         else:
--> 180             self.msock = connect(ip, port, path)
    181         if load_schemas:
    182             self.load_schemas()

~/cisco/nso-development/nso-5.3.1/src/ncs/pyapi/ncs/maapi.py in connect(ip, port, path)
     94     msock = socket.socket()
     95     if path is None:
---> 96         _tm.maapi.connect(msock, ip, port)
     97     else:
     98         _tm.maapi.connect(msock, path=path)

Error: Bad protocol usage or unexpected retval (21): Library protocol version (73) is not compatible with ConfD protocol version (72)

In [3]:
1 REPLY 1
Highlighted
Cisco Employee

Oops found the solution: PYTHONPATH was causing this issue.

Python path was pointing to wrong NSO i.e. 5.3.1 where as which ncs is 5.2.1.2