sonic-net / sonic-buildimage

Scripts which perform an installable binary image build for SONiC
Other
741 stars 1.44k forks source link

[SFLOW] [error log] ERR sflow#port_index_mapper: no interface with this name #11437

Open dellwuchuan opened 2 years ago

dellwuchuan commented 2 years ago

Description

When I enable SFLOW configuration as background configuration which is existing with other configuration, such as vlan and port. Vlan deletion could trigger sflow error log - ERR sflow#port_index_mapper: no interface with this name

One of my colleague had some investigation on this issue, I hope it could provide some advantage. _Failing at this line https://github.com/Azure/sonic-buildimage/blob/master/dockers/docker-sflow/port_index_mapper.py#L48 Method call to "socket" python library which means the given interface doesn't exist when this call is made

Based on the syslog this failed directly after the following command was run:

sudo config vlan del 4094 Its likely that the host interface is removed before sflow processes the removal.

This should be resolved in sflow to make it tolerant of this particular deletion flow._

Steps to reproduce the issue:

  1. Config portchannel and sflow configuration sudo config portchannel add PortChannel0001 sudo config portchannel member add PortChannel0001 Ethernet0

sudo config feature state sflow enabled sudo config sflow enable sudo config sflow collector add collector0 50.0.0.2 --port 6343 --vrf default sudo config sflow interface disable all sudo config sflow interface enable Ethernet0 sudo config sflow interface enable Ethernet28

  1. Wait 1 minute for sflow docker startup
  2. Execute below vlan related commands: sudo config vlan add 4095 sudo config vlan member del 30 PortChannel0001 sudo config vlan member add --untagged 4095 PortChannel0001 sudo config vlan member add 4095 Ethernet40 sudo config vlan add 4094 sudo config vlan member add --untagged 4094 PortChannel0001 sudo config vlan member add 4094 Ethernet40 sudo config vlan member del 4094 PortChannel0001 sudo config vlan member del 4094 Ethernet40 sudo config vlan del 4094 sudo config vlan member add --untagged 30 PortChannel0001

Describe the results you received:

In the system log of sonic switch, one sflow error log could be catched: ERR sflow#port_index_mapper: no interface with this name

Describe the results you expected:

There should be no sflow error log

Output of show version:

(paste your output here)

Output of show techsupport:

(paste your output here or download and attach the file here )

Additional information you deem important (e.g. issue happens only occasionally):

zhangyanzhao commented 2 years ago

https://github.com/Azure/sonic-buildimage/blob/master/dockers/docker-sflow/port_index_mapper.py#L48 need be improved to handle this situation.

zhangyanzhao commented 2 years ago

@jeff-yin

dellwuchuan commented 2 years ago

Another error log in the same test and same module: ERR sflow#port_index_mapper: returned a result with an error set

liat-grozovik commented 1 year ago

@venkatmahalingam could you please update when this issue can be fixed for 202211 and 202205?

venkatmahalingam commented 1 year ago

@padmanarayana Please comment on this issue. @jeff-yin FYI.

venkatmahalingam commented 1 year ago

@Gokulnath-Raja is working on this issue.

Gokulnath-Raja commented 1 year ago

@Gokulnath-Raja is working on this issue.

Raised pull request https://github.com/sonic-net/sonic-buildimage/pull/13567