Closed bdlamprecht closed 6 years ago
@mirceaulinic Any updates on resolving this issue?
@bdlamprecht We probably need the output of the following to help us debug the information. Should be able to get this by using | display xml
and | display xml rpc
.
As discussed in the NetworkToCode Slack channel, here is the XML file for the peer that is crashing the get_bgp_neighbors
. I've done a search and replace for the IPs and replaced the first 3 octets with RFC1918 addressing. The last octet was not changed at all.
xml for junos_bgp_getter issue.txt
Let me know if you need other information. Thanks!
The #209 should fix that as the error is exactly the same. However I cannot see the problem based on the xml file provided (ie: all ribs have the advertised-prefix-count
node).
@bdlamprecht is it possible that get_bgp_neighbors
is crashing because of a different peer than the one you provided ? would it be possible to get the full output of show bgp neighbors | display xml
?
@ckishimo Yes, #209 did fix the error for get_bgp_neigbors_detail
for this device (thanks!)
However, but when I checked the napalm get_bgp_neighbors
(no _detail
), the same error as posted above occurred.
I've done what you asked and posted the show bgp neighbors | display xml
into this gist
:
https://gist.github.com/bdlamprecht/0a2742ef0a649164b7b85783af9cbebb
Hope that provides you with enough information to troubleshoot the problem.
Note, I did change the addressing of the first two octets of the BGP peers to RFC1918 addresses.
FYI, I can't guarantee that it is the same as before as these are lab devices and multiple people may have changed the configuration since the previous information was posted.
@bdlamprecht thanks for the outputs! I was able to see an error while using get_bgp_neighbors
however the error is not exactly the same as before, so not sure if it's the same as you saw or a new one...:
Traceback (most recent call last):
File "client_junos_bgp.py", line 21, in <module>
res = dev.get_bgp_neighbors()
File "/home/ckishimo/python/devel/git/devel-bgp/napalm-junos/napalm_junos/junos.py", line 597, in get_bgp_neighbors
uptime_table_items=uptime_table_items)
File "/home/ckishimo/python/devel/git/devel-bgp/napalm-junos/napalm_junos/junos.py", line 563, in _get_bgp_neighbors_core
peer['address_family'] = self._parse_route_stats(neighbor_details)
File "/home/ckishimo/python/devel/git/devel-bgp/napalm-junos/napalm_junos/junos.py", line 478, in _parse_route_stats
data[family]['sent_prefixes'] = neighbor['sent_prefixes'].pop(0)
AttributeError: 'int' object has no attribute 'pop'
Based on the data provided, sent_prefixes
is of type int
when a list
was expected:
'send-state': ['in sync', 'not advertising', 'not advertising', 'not advertising', 'not advertising', 'not advertising', 'not advertising', 'not advertising', 'not advertising', 'not advertising', 'not advertising', 'not advertising'], u'is_up': True, 'sent_prefixes': 5439, 'peer_as': 65143, 'accepted_prefixes': [622, 9, 0, 61, 41, 117, 121, 40, 36, 127, 6, 2]
I just pushed the change converting sent_prefixes
into a list.
@bdlamprecht could you please confirm the error was the same I just posted ? and also please report if all errors are fixed now. Thanks!
@ckishimo Yes, that fixed the issue I was having. I now get the expected values back correctly. Please submit this fix as PR so it can be merged into the main driver.
Thanks again for investigating this and revolving it so quickly.
Description of Issue/Question
When running the NAPALM getter 'get_bgp_neighbors()' I get an
IndexError: list index out of range
error.Did you follow the steps from https://github.com/napalm-automation/napalm#faq
[X] Yes [ ] No
Setup
napalm-junos version
(Paste verbatim output from
pip freeze | grep napalm-junos
between quotes below)JunOS version
(Paste verbatim output from
show version and haiku
between quotes below)Steps to Reproduce the Issue
Run the following code:
Error Traceback
Provides the following error: