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

[master] Fix exception in update_data of rfc4363.py #173

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tim-rj
Copy link

@tim-rj tim-rj commented Nov 4, 2020

Signed-off-by: tim-rj sonic_rd@ruijie.com.cn

- What I did
Fix sonic-net/sonic-buildimage#5345
- How I did it
If port_id does not exist in if_id_map, do not use it.
- How to verify it
Up and down portchannel
Check is there exception log of rfc4363.py in /var/log/syslog
- Log before commit

    `Nov  3 17:31:18.701533 sonic ERR snmp#snmp-subagent [ax_interface] ERROR: MIBUpdater.start() caught an unexpected exception during update_data()#012Traceback (most recent call last):#012  File "/usr/local/lib/python3.7/dist-packages/ax_interface/mib.py", line 43, in start#012    self.update_data()#012  File "/usr/local/lib/python3.7/dist-packages/sonic_ax_impl/mibs/ietf/rfc4363.py", line 75, in update_data#012    self.vlanmac_ifindex_map[vlanmac] = mibs.get_index_from_str(self.if_id_map[port_id])#012KeyError: b'20000000009b7'`

- Log after commit
No exception log
- Description for the changelog
Avoid exception when handling update_data in rfc4363.py in case of invalid db entry.

Signed-off-by: tim-rj <sonic_rd@ruijie.com.cn>
@tim-rj tim-rj changed the title [rfc4363]Validate port_id for sonic-buildimage issue 5345 [master] Fix exception in update_data of rfc4363.py Nov 4, 2020
@pettershao-ragilenetworks
Copy link
Contributor

help forward this, thanks!

@@ -70,6 +70,8 @@ def update_data(self):
if bridge_port_id not in self.if_bpid_map:
continue
port_id = self.if_bpid_map[bridge_port_id]
if port_id not in self.if_id_map:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

port_id not in self.if_id_map:

What is the root cause of this issue?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you give more description about your topology and config? I guess your DUT has a PortChannel in Vlan, and there are traffic hit the port in PortChannel. If this is true, we recently fixed it by #203. Could you try latest master code?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants