cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2407
Views
0
Helpful
5
Replies

DevNet Track IOS-XE Programmability

lariasca
Cisco Employee
Cisco Employee

Hello,

 

I am trying to do the learning lab Exploring IOS XE YANG Data Models with NETCONF", and in Step 3, the first python script is failing on me, anyone knows what might be occurring? Thanks.

 

(venv) bash$ python get_interface_list.py
Opening NETCONF Connection to ios-xe-mgmt.cisco.com
Sending a <get-config> operation to the device.

Traceback (most recent call last):
File "get_interface_list.py", line 65, in <module>
netconf_reply = m.get_config(source = 'running', filter = netconf_filter)
File "/Users/user/Documents/Programmability/dne-dna-code/intro-mdp/netconf/venv/lib/python3.8/site-packages/ncclient/manager.py", line 212, in execute
return cls(self._session,
File "/Users/user/Documents/Programmability/dne-dna-code/intro-mdp/netconf/venv/lib/python3.8/site-packages/ncclient/operations/retrieve.py", line 166, in request
return self._request(node)
File "/Users/user/Documents/Programmability/dne-dna-code/intro-mdp/netconf/venv/lib/python3.8/site-packages/ncclient/operations/rpc.py", line 341, in _request
raise self._reply.error
ncclient.operations.rpc.RPCError: application protocol error

Thanks.

1 Accepted Solution

Accepted Solutions

omz
VIP Alumni
VIP Alumni

Hi

the issue is with ios-xe-mgmt.cisco.com sandbox. Try with ios-xe-mgmt-latest.cisco.com same credentials.. just rename the sandbox in the env_lab.py.

 

just tested the netconf get interface list script - https://github.com/CiscoDevNet/dne-dna-code/blob/master/intro-mdp/netconf/get_interface_list.py - with the above sandbox and it worked fine using Python 3.8.2

from traceback .. it looks like you have created a virtual environment in python 3.8 .. 

File "/Users/user/Documents/Programmability/dne-dna-code/intro-mdp/netconf/venv/lib/python3.8/site-packages/ncclient/operations/rpc.py", line 341, in _request
raise self._reply.error 

the issue with non-working sandbox is most likely software related .. 

Hope this helps 

View solution in original post

5 Replies 5

LanDownUnda
Spotlight
Spotlight

Hi Lariasca,

 

Can you provide me the output of the following bash command "python --version" just to make sure your running 3.8 and not something like 2.7? If the above command gives you something like 'python 2.7' then try referencing "python3" in your bash command. For example:

"python3 get_interface_list.py"

 

If this doesn't work and your still running into issues then I'm more than happy to take a look at your script to see if we are dealing with something else :)

 

I hope this helps!

*** Rate All Helpful Responses ***

I am using 3.8. It resolved on its own, it seems it was a sandbox issue. Thanks!

omz
VIP Alumni
VIP Alumni

Hi

the issue is with ios-xe-mgmt.cisco.com sandbox. Try with ios-xe-mgmt-latest.cisco.com same credentials.. just rename the sandbox in the env_lab.py.

 

just tested the netconf get interface list script - https://github.com/CiscoDevNet/dne-dna-code/blob/master/intro-mdp/netconf/get_interface_list.py - with the above sandbox and it worked fine using Python 3.8.2

from traceback .. it looks like you have created a virtual environment in python 3.8 .. 

File "/Users/user/Documents/Programmability/dne-dna-code/intro-mdp/netconf/venv/lib/python3.8/site-packages/ncclient/operations/rpc.py", line 341, in _request
raise self._reply.error 

the issue with non-working sandbox is most likely software related .. 

Hope this helps 

lariasca
Cisco Employee
Cisco Employee

Thanks! the issue resolved on its own, seems it was a sandbox issue and they fixed it.

(venv) user:netconf lariasca$ python --version
Python 3.8.2

>>Now it is working!!

(venv) user:netconf lariasca$ python get_interface_list.py
Opening NETCONF Connection to ios-xe-mgmt.cisco.com
Sending a <get-config> operation to the device.
<snip>

The interface status of the device is:
Interface GigabitEthernet1 enabled status is true
Interface GigabitEthernet2 enabled status is true
Interface GigabitEthernet3 enabled status is true
Interface Loopback42 enabled status is true
Interface Loopback50 enabled status is true
Interface Loopback100 enabled status is true
Interface Loopback200 enabled status is true
Interface Loopback666 enabled status is true

dnlg
Cisco Employee
Cisco Employee

I'm having the same issue and I've tried renaming the sandbox. I have used ios-xe-mgmt.cisco.com, ios-xe-mgmt-latest.cisco.com and sandbox-iosxe-recomm-1.cisco.com.