cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
901
Views
5
Helpful
1
Replies

ncs.maapi.Maapi() failed says Bad protocol

kiran kotari
Cisco Employee
Cisco Employee

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 Accepted Solution

Accepted Solutions

kiran kotari
Cisco Employee
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

View solution in original post

1 Reply 1

kiran kotari
Cisco Employee
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