Page MenuHomeVyOS Platform

LLDP Traceback error
Closed, ResolvedPublicBUG

Description

show lldp neighbors gives the following error

vyos:~$ show lldp neighbors
Traceback (most recent call last):

File "/usr/libexec/vyos/op_mode/lldp_op.py", line 121, in <module>
  config_text = tmpl.render(parse_data(neighbors))
File "/usr/libexec/vyos/op_mode/lldp_op.py", line 50, in parse_data
  for local_if, values in data.items():

AttributeError: 'list' object has no attribute 'items'

If I do show lld neighbors interface eth1 it returns nothing. Even though in previous versions it returns neighbors. I have lld enabled on my interface eth1.

vyos:~$ show lldp neighbors interface eth1
Capability Codes: R - Router, B - Bridge, W - Wlan r - Repeater, S - Station

D - Docsis, T - Telephone, O - Other

Device ID Local Proto Cap Platform Port ID


mlaney@vyos:~$

Details

Difficulty level
Unknown (require assessment)
Version
VyOS 1.3-rolling-202012012205
Why the issue appeared?
Implementation mistake
Is it a breaking change?
Perfectly compatible
Issue type
Bug (incorrect behavior)

Event Timeline

@thadrumr please provide your lldp configuration. show configuration commands | match lldp
I can't reproduce this issue in lab with the latest rolling. Provide please detailed reproducing steps, also will be helpful to get an output

sudo lldpcli show neighbors

Here is my lldp config. ETH0 is WAN ETH1 is lan that is why only eth1 has lldp enabled.

mlaney@vyos:~$ show configuration commands | match lldp
set service lldp interface eth1
set service lldp legacy-protocols cdp
set service lldp management-address '10.22.87.1'
set service lldp snmp enable
mlaney@vyos:~$

mlaney@vyos:~$ sudo lldpcli show neighbors

LLDP neighbors:

Interface: eth1, via: CDPv2, RID: 1, Time: 0 day, 08:19:01

Chassis:     
  ChassisID:    local Cisco-Sw1.local
  SysName:      Cisco-Sw1.local
  SysDescr:     cisco WS-C2960S-48LPS-L running on
                Cisco IOS Software, C2960S Software (C2960S-UNIVERSALK9-M), Version 15.2(2)E9, RELEASE SOFTWARE (fc4)
                Technical Support: http://www.cisco.com/techsupport
                Copyright (c) 1986-2018 by Cisco Systems, Inc.
                Compiled Sat 08-Sep-18 14:56 by prod_rel_team
  MgmtIP:       10.22.87.254
  Capability:   Bridge, on
Port:        
  PortID:       ifname GigabitEthernet1/0/9
  PortDescr:    GigabitEthernet1/0/9
  TTL:          180

Interface: eth1, via: CDPv2, RID: 1, Time: 0 day, 08:18:47

Chassis:     
  ChassisID:    local Cisco-Sw1.local
  SysName:      Cisco-Sw1.local
  SysDescr:     cisco WS-C2960S-48LPS-L running on
                Cisco IOS Software, C2960S Software (C2960S-UNIVERSALK9-M), Version 15.2(2)E9, RELEASE SOFTWARE (fc4)
                Technical Support: http://www.cisco.com/techsupport
                Copyright (c) 1986-2018 by Cisco Systems, Inc.
                Compiled Sat 08-Sep-18 14:56 by prod_rel_team

I just tried the show lldp neighbors again and it doesn't work but sudo lldpcli show neighbors works

I just upgraded to the absolute latest rolling release that came out early this morning and it has the same issue.

It looks like the issue is CDP. If I remove the CDP piece of the config then it works.

mlaney@vyos# delete service lldp legacy-protocols cdp
mlaney@vyos# commit
mlaney@vyos# exit
exit
mlaney@vyos:~$ show lldp neighbors
Capability Codes: R - Router, B - Bridge, W - Wlan r - Repeater, S - Station

D - Docsis, T - Telephone, O - Other

Device ID Local Proto Cap Platform Port ID


I still can't reproduce this issue.

vyos@vyos:~$ show configuration commands | match lldp
set service lldp interface eth1
set service lldp legacy-protocols cdp
set service lldp management-address '192.168.255.31'
set service lldp snmp enable
vyos@vyos:~$ show lldp neighbors 
Capability Codes: R - Router, B - Bridge, W - Wlan r - Repeater, S - Station
                  D - Docsis, T - Telephone, O - Other

Device ID                 Local     Proto  Cap   Platform             Port ID
---------                 -----     -----  ---   --------             -------

vyos                      eth1      LLDP   R     VyOS 1.3-rolling-2   eth1

vyos@vyos:~$ show lldp neighbors interface eth1
Capability Codes: R - Router, B - Bridge, W - Wlan r - Repeater, S - Station
                  D - Docsis, T - Telephone, O - Other

Device ID                 Local     Proto  Cap   Platform             Port ID
---------                 -----     -----  ---   --------             -------

vyos                      eth1      LLDP   R     VyOS 1.3-rolling-2   eth1

Please provide full config but replace all private data. I will check also with cisco devices

Dmitry changed the task status from Open to Confirmed.Dec 2 2020, 1:22 PM

Ok, with cisco device and added vif 1 I can reproduce this issue

vyos@vyos# run show lldp neighbors 
Traceback (most recent call last):
  File "/usr/libexec/vyos/op_mode/lldp_op.py", line 121, in <module>
    config_text = tmpl.render(parse_data(neighbors))
  File "/usr/libexec/vyos/op_mode/lldp_op.py", line 50, in parse_data
    for local_if, values in data.items():
AttributeError: 'list' object has no attribute 'items'

Cool let me know if you still need my config

c-po changed the task status from Confirmed to Needs testing.Dec 2 2020, 7:01 PM
c-po assigned this task to Dmitry.
c-po triaged this task as Normal priority.
c-po changed Why the issue appeared? from Will be filled on close to Implementation mistake.
c-po changed Is it a breaking change? from Unspecified (possibly destroys the router) to Perfectly compatible.

Thanks, @c-po , works as expected.

vyos@vyos:~$ show  lldp neighbors 
Capability Codes: R - Router, B - Bridge, W - Wlan r - Repeater, S - Station
                  D - Docsis, T - Telephone, O - Other

Device ID                 Local     Proto  Cap   Platform             Port ID
---------                 -----     -----  ---   --------             -------
vyos                      eth1      LLDP   R     VyOS 1.3-rolling-2   eth1
vyos                      eth1      LLDP   R     VyOS 1.2.5           eth0
Switch                    eth1      LLDP   R     Cisco IOS Software   Ethernet0/0

@thadrumr , please try the latest rolling, and let's mark this bug as resolved.

erkin set Issue type to Bug (incorrect behavior).Aug 29 2021, 12:08 PM
erkin removed a subscriber: Active contributors.