Open jean-christophe-manciot opened 2 years ago
Same issue with netcommon 3.0.1.
A few more details:
1) The first failed netconf_rpc
which yields:
redirecting (type: netconf) ansible.builtin.default to ansible.netcommon.default
<172.21.202.121> attempting to start connection
<172.21.202.121> using connection plugin ansible.netcommon.netconf
Found ansible-connection at path /usr/local/bin/ansible-connection
<172.21.202.121> found existing local domain socket, using it!
<172.21.202.121>
<172.21.202.121> local domain socket path is /media/SAMSUNG9-Shared/home/admin/.ansible/pc/14e3bdf45e
<172.21.202.121> Using network group action ansible.netcommon.netconf for ansible.netcommon.netconf_rpc
<172.21.202.121> ANSIBLE_NETWORK_IMPORT_MODULES: enabled
<172.21.202.121> ANSIBLE_NETWORK_IMPORT_MODULES: found ansible.netcommon.netconf_rpc at /opt/ansible_collections/ansible/netcommon/plugins/modules/netconf_rpc.py
<172.21.202.121> ANSIBLE_NETWORK_IMPORT_MODULES: running ansible.netcommon.netconf_rpc
<172.21.202.121> ANSIBLE_NETWORK_IMPORT_MODULES: complete
The full traceback is:
File "/opt/ansible_collections/ansible/netcommon/plugins/module_utils/network/netconf/netconf.py", line 128, in dispatch
response = conn.dispatch(request)
File "/opt/ansible_collections/ansible/netcommon/plugins/module_utils/network/common/netconf.py", line 80, in __rpc__
return self.parse_rpc_error(
File "/opt/ansible_collections/ansible/netcommon/plugins/module_utils/network/common/netconf.py", line 126, in parse_rpc_error
raise ConnectionError(rpc_error)
fatal: [IOS_XRv_9k-7.4.1]: FAILED! => changed=false
invocation:
module_args:
content: |2-
<identifier>Cisco-IOS-XR-lldp-clear-act</identifier>
<version>2019-11-13</version>
<format>yang</format>
display: xml
rpc: get-schema
xmlns: urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring
msg: b'Not connected to NETCONF server'
2) According to netconf statistics, the session is dropped along the way:
{
"ietf-netconf-monitoring:netconf-state": {
"statistics": {
"dropped-sessions": "1",
"in-bad-hellos": "0",
"in-bad-rpcs": "0",
"in-rpcs": "42",
"in-sessions": "1",
"netconf-start-time": "2022-06-01T07:57:39Z",
"out-notifications": "0",
"out-rpc-errors": "0"
}
}
}
Even inserting another type of rpc call such as a rpc: get
between all rpc: get-schema
does not change anything: the netconf sesssion is still dropped after a while.
SUMMARY
The connection to the remote NETCONF device is lost forever after a while when looping over the same
netconf_rpc
operation with some delay usingansible_network_cli_ssh_type: paramiko
oransible_network_cli_ssh_type: libssh
The issue does not come from a congested bandwidth as the device is the only one tested. However, it happens with all versions of IOS XRv and IOS XRv 9k I could put my hands on, but not on any IOS XEv..
ISSUE TYPE
COMPONENT NAME
module_utils
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
STEPS TO REPRODUCE
EXPECTED RESULTS
No disconnection from remote NETCONF server
ACTUAL RESULTS
The full log is available here: Not connected to NETCONF server after a while.log.