Closed jlixfeld closed 6 years ago
For the archives, this was due to a few different things. Mainly, I suspect a bug in XR 5.3.4 where the output was too large and required streaming to be enabled. To throw a bunch of poo against the wall to see what stuck while debugging this, I also maxed out the throttle memory, but I didn't test to see if removing the memory throttle but leaving the streaming would have any affect. YMMV.
!
xml agent tty
throttle memory 600
iteration off
streaming on size 48
!
Lastly, the output that was finally produced when running this on the XR CLI was so incredibly huge, I have to think that there is some sort of XR bug that created a loop of the same XML output. I saw the same data stream many tens of times in the output before I finally went ^C on it after over 5 minutes of it spewing whatever it was spewing.
This will produce the loop:
RP/0/RSP0/CPU0:bfr01.905KingStW01.YYZ#xml format echo
Sat Oct 27 10:51:48.007 EDT
XML><?xml version="1.0" encoding="UTF-8"?>
<Request MajorVersion="1" MinorVersion="0">
<Get>
<Operational>
<BGP>
<ConfigInstanceTable>
<ConfigInstance>
<Naming>
<InstanceName>
default
</InstanceName>
</Naming>
<ConfigInstanceVRFTable>
</ConfigInstanceVRFTable>
</ConfigInstance>
</ConfigInstanceTable>
</BGP>
</Operational>
</Get>
</Request>
When limiting it only to the VRF you're interested in, it works fine.
XML> <?xml version="1.0" encoding="UTF-8"?>
<Request MajorVersion="1" MinorVersion="0">
<Get>
<Operational>
<BGP>
<InstanceTable>
<Instance>
<Naming>
<InstanceName>
default
</InstanceName>
</Naming>
<InstanceActive>
<VRFTable>
<VRF>
<Naming>
Inetv4
</Naming>
<GlobalProcessInfo>
</GlobalProcessInfo>
<NeighborTable>
</NeighborTable>
</VRF>
</VRFTable>
</InstanceActive>
</Instance>
</InstanceTable>
</BGP>
</Operational>
</Get>
</Request>
<?xml version="1.0" encoding="UTF-8"?>
<Response MajorVersion="1" MinorVersion="0">
<Get>
...
...
...
</Get>
<ResultSummary ErrorCount="0"/>
</Response>
XML>
How did you to show only default VRF results using napalm ?
@beufanet You might want to ask a question in the slack channel: https://github.com/napalm-automation/napalm#slack
Regards,
Kirk
@beufanet I never specifically attempted to show the default VRF, but I believe the first example above would provide either the default VRF or both the default VRF and any non-default VRFs.
I end here, after looking for some answers on the same error. @jlixfeld are saying the issue was solved by modifying xr xml configuration? with the following config?
!
xml agent tty
throttle memory 600
iteration off
streaming on size 48
!
@jbotello7381 I specifically recall, but I don't believe so, no. There was never any real attempt made to resolve the issue for the default VRF. My interest was only in having NAPALM return results for one specific VRF, and I had to hack NAPALM in order to achieve that.
When coupled with this patch for NAPALM 2.3.3...
BlackBox:napalm jlixfeld$ git diff
diff --git a/napalm/iosxr/iosxr.py b/napalm/iosxr/iosxr.py
index 491bf0ce..5d39858f 100644
--- a/napalm/iosxr/iosxr.py
+++ b/napalm/iosxr/iosxr.py
@@ -345,7 +344,7 @@ class IOSXRDriver(NetworkDriver):
because bulk-getting all instance-data to do the same could get ridiculously heavy
Assuming we're always interested in the DefaultVRF
"""
-
+ """
active_vrfs = ["global"]
rpc_command = '<Get><Operational><BGP><ConfigInstanceTable><ConfigInstance><Naming>\
@@ -357,7 +356,9 @@ class IOSXRDriver(NetworkDriver):
for node in result_tree.xpath('.//ConfigVRF'):
active_vrfs.append(napalm.base.helpers.find_txt(node, 'Naming/VRFName'))
+ """
result = {}
+ active_vrfs = ["Inetv4"]
for vrf in active_vrfs:
rpc_command = generate_vrf_query(vrf)
@@ -912,6 +913,7 @@ class IOSXRDriver(NetworkDriver):
bgp_neighbors_detail = {}
+ '''
active_vrfs = ['default']
active_vrfs_rpc_request = '<Get><Operational><BGP><ConfigInstanceTable><ConfigInstance>\
@@ -926,6 +928,8 @@ class IOSXRDriver(NetworkDriver):
active_vrfs.append(napalm.base.helpers.find_txt(active_vrf_tree, 'Naming/VRFName'))
unique_active_vrfs = sorted(set(active_vrfs))
+ '''
+ unique_active_vrfs = ['Inetv4']
bgp_neighbors_vrf_all_rpc = '<Get><Operational><BGP><InstanceTable><Instance><Naming>\
<InstanceName>default</InstanceName></Naming>'
@@ -1081,7 +1085,7 @@ class IOSXRDriver(NetworkDriver):
'advertised_prefix_count': advertised_prefix_count,
'flap_count': flap_count
})
- bgp_neighbors_detail['global'] = bgp_neighbors_detail.pop('default')
+ #bgp_neighbors_detail['global'] = bgp_neighbors_detail.pop('default')
return bgp_neighbors_detail
def get_arp_table(self):
BlackBox:napalm jlixfeld$
... this XR config was sufficient:
!
xml agent tty
iteration off
!
However, YMMV as this will not patch cleanly on > NAPALM 2.3.3.
Not sure what to make of this, but I suspect it's a timeout issue although I'm not sure if it's user error or something else. I've tried to pass
--optional_args timeout=120
to extend it a bit, but that still seems like a long time to return results. We're connecting, as can be seen from the successfulopen()
,connection_tests()
andget_facts()
.Looking at the device logs, the session is closed very shortly after the traceback is thrown, so it would seem to me it's not a keepalive issue closing the session.
I'm not finding any results searching for similar symptoms, so either no one is using napalm with XR 5.3.4, or this issue is something unique to me :)
Does anyone have some clue to lob over?