06-19-2020 09:32 PM
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.
Solved! Go to Solution.
06-20-2020 01:22 AM
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
06-19-2020 10:15 PM
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!
06-28-2020 04:51 PM
06-20-2020 01:22 AM
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
06-28-2020 04:52 PM - edited 06-28-2020 04:54 PM
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
01-31-2022 02:02 AM
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.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide