Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

accton-as5712-54x: lldp-syncd throws exception from get_sys_capability_list #14

Open
nikos-github opened this issue Dec 14, 2018 · 1 comment

Comments

@nikos-github
Copy link

This is seen in the log after the messages reported in sonic-net/sonic-swss#728.

Nov 3 17:50:40.475838 sonic INFO lldp#supervisord: lldp-syncd Exception in thread LldpSyncDaemon:
Nov 3 17:50:40.475999 sonic INFO lldp#supervisord: lldp-syncd Traceback (most recent call last):
Nov 3 17:50:40.476080 sonic INFO lldp#supervisord: lldp-syncd File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
Nov 3 17:50:40.476155 sonic INFO lldp#supervisord: lldp-syncd self.run()
Nov 3 17:50:40.476227 sonic INFO lldp#supervisord: lldp-syncd File "/usr/local/lib/python2.7/dist-packages/sonic_syncd/interface.py", line 45, in run
Nov 3 17:50:40.476301 sonic INFO lldp#supervisord: lldp-syncd parsed_update = self.parse_update(update_obj)
Nov 3 17:50:40.476375 sonic INFO lldp#supervisord: lldp-syncd File "/usr/local/lib/python2.7/dist-packages/lldp_syncd/daemon.py", line 250, in parse_update
Nov 3 17:50:40.476448 sonic INFO lldp#supervisord: lldp-syncd capability_list = self.get_sys_capability_list(if_attributes)
Nov 3 17:50:40.476521 sonic INFO lldp#supervisord: lldp-syncd File "/usr/local/lib/python2.7/dist-packages/lldp_syncd/daemon.py", line 121, in get_sys_capability_list
Nov 3 17:50:40.476595 sonic INFO lldp#supervisord: lldp-syncd capability_list = if_attributes['chassis'].values()[0]['capability']
Nov 3 17:50:40.476668 sonic INFO lldp#supervisord: lldp-syncd TypeError: string indices must be integers

@chenkelly
Copy link
Contributor

chenkelly commented Apr 3, 2019

Current get_sys_capability_list don't consider the system name of remote device is null case.
If devices don't configure host name, it will send out LLDPPDU whose System Name TLV is null string.
When sonic device learned the remote device, the chassis object of lldp_json does not include system name string.
The capability_list does not get successfully by applying current statement, capability_list = if_attributes['chassis'].values()[0]['capability'].
We can execute lldpclt command to see the difference.
root@sonic:~# docker exec -it lldp bash
root@sonic:/# /usr/sbin/lldpctl -f json
[Remote device without system name]

        "chassis": {
           ......
          "capability": [
            {
              "type": "Bridge",
              "enabled": true
            },
            {
              "type": "Router",
              "enabled": true
            }
          ]
        }

[Remote device with system name]

        "chassis": {
          **"ECS4120-28T_device"**: {
              ......
            "capability": [
              {
                "type": "Bridge",
                "enabled": true
              },
              {
                "type": "Router",
                "enabled": true
              }
            ]
          }
        }

qiluo-msft pushed a commit that referenced this issue May 10, 2019
#22)

* Fix issue #14 accton-as5712-54x: lldp-syncd throws exception from get_sys_capability_list
The get_sys_capability_list() shall consider the system name of remote device is null case.
* To correct vlan format in new json file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants