Skip to content
New issue

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

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

Already on GitHub? # to your account

[202111] Handle error seen on system where vlan interface map is not present #252

Merged
merged 1 commit into from
Apr 13, 2022

Conversation

SuvarnaMeenakshi
Copy link
Contributor

@SuvarnaMeenakshi SuvarnaMeenakshi commented Apr 11, 2022

- What I did
cherrypick of: #246
fixes sonic-net/sonic-buildimage#9996
Handle error seen on system where vlan interface map is not present.
This change requires: sonic-net/sonic-py-swsssdk#117
On chassis platform, on supervisor there are not ports available in config_db. So, there is no vlan interface map in counters db, which causes this error in syslog:

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 37, in start#012    self.reinit_data()#012  File "/usr/local/lib/python3.7/dist-packages/sonic_ax_impl/mibs/ietf/rfc1213.py", line 233, in reinit_data#012    self.vlan_oid_name_map = Namespace.get_sync_d_from_all_namespace(mibs.init_sync_d_vlan_tables, self.db_conn)#012  File "/usr/local/lib/python3.7/dist-packages/sonic_ax_impl/mibs/__init__.py", line 649, in get_sync_d_from_all_namespace#012    ns_tuple = per_namespace_func(db_conn)#012  File "/usr/local/lib/python3.7/dist-packages/sonic_ax_impl/mibs/__init__.py", line 339, in init_sync_d_vlan_tables#012    vlan_name_map = port_util.get_vlan_interface_oid_map(db_conn)#012  File "/usr/local/lib/python3.7/dist-packages/swsssdk/port_util.py", line 167, in get_vlan_interface_oid_map#012    rif_name_map = db.get_all('COUNTERS_DB', 'COUNTERS_RIF_NAME_MAP', blocking=True)#012  File "/usr/lib/python3/dist-packages/swsscommon/swsscommon.py", line 1751, in get_all#012    return dict(super(SonicV2Connector, self).get_all(db_name, _hash, blocking))#012  File "/usr/lib/python3/dist-packages/swsscommon/swsscommon.py", line 1708, in get_all#012    return _swsscommon.SonicV2Connector_Native_get_all(self, db_name, _hash, blocking)#012RuntimeError: Key '{COUNTERS_RIF_NAME_MAP}' unavailable in database '{COUNTERS_DB}'

- How I did it
Return empty dict if vlan interface map is not present in DB.
- How to verify it
With this fix, no error in syslog message.
Able to execute other MIB queries on supervisor.
UT passes.
- Description for the changelog

…resent

fixes sonic-net/sonic-buildimage#9996
Handle error seen on system where vlan interface map is not present.
This change requires: sonic-net/sonic-py-swsssdk#117
On chassis platform, on supervisor there are not ports available in config_db. So, there is no vlan interface map in counters db, which causes this error in syslog:

ERROR: MIBUpdater.start() caught an unexpected exception during update_data(). RuntimeError: Key '{COUNTERS_RIF_NAME_MAP}' unavailable in database '{COUNTERS_DB}'
- How I did it
Return empty dict if vlan interface map is not present in DB.

(cherry picked from commit 2151731)
Signed-off-by: Suvarna Meenakshi <sumeenak@microsoft.com>
@SuvarnaMeenakshi
Copy link
Contributor Author

@dgsudharsan fyi

@dprital
Copy link
Collaborator

dprital commented Apr 12, 2022

@judyjoseph - Can you please merge into 202111 ?

@liat-grozovik
Copy link
Collaborator

@qiluo-msft could you please signoff now that checkers are passing?

@SuvarnaMeenakshi SuvarnaMeenakshi changed the title [20211] Handle error seen on system where vlan interface map is not present [202111] Handle error seen on system where vlan interface map is not present Apr 12, 2022
@SuvarnaMeenakshi
Copy link
Contributor Author

@qiluo-msft could you please signoff now that checkers are passing?

sonic-snmpagent check was skipped. PR #253 raised to add this checker, will re-run after that PR and then merge once it passes.

@SuvarnaMeenakshi
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@SuvarnaMeenakshi SuvarnaMeenakshi merged commit 004b9a4 into sonic-net:202111 Apr 13, 2022
@SuvarnaMeenakshi SuvarnaMeenakshi deleted the vlan branch April 13, 2022 01:23
@dgsudharsan
Copy link
Collaborator

Thank you @SuvarnaMeenakshi. Can you also please raise a submodule update for 202111 for sonic-snmpagent?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants