Handle error seen on system where vlan interface map is not present#246
Merged
SuvarnaMeenakshi merged 2 commits intosonic-net:masterfrom Mar 28, 2022
Merged
Handle error seen on system where vlan interface map is not present#246SuvarnaMeenakshi merged 2 commits intosonic-net:masterfrom
SuvarnaMeenakshi merged 2 commits intosonic-net:masterfrom
Conversation
in counters db. Signed-off-by: Suvarna Meenakshi <sumeenak@microsoft.com>
Contributor
Author
|
@mlok-nokia tested with the changes as discussed. Please review. |
qiluo-msft
approved these changes
Mar 16, 2022
|
This pull request introduces 1 alert when merging e36b7d8 into 6bd51c4 - view on LGTM.com new alerts:
|
Contributor
Author
Contributor
Author
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
|
/azp run Azure.sonic-snmpagent |
|
Commenter does not have sufficient privileges for PR 246 in repo Azure/sonic-snmpagent |
Collaborator
|
/azp run Azure.sonic-snmpagent |
|
Commenter does not have sufficient privileges for PR 246 in repo Azure/sonic-snmpagent |
Collaborator
|
Hi @judyjoseph , could you help cherry-pick to 202111? |
|
@SuvarnaMeenakshi could you raise a separate PR for 202111 ? as there are merge conflicts |
Collaborator
|
@SuvarnaMeenakshi When can we have the PR for 202111 branch? |
SuvarnaMeenakshi
added a commit
that referenced
this pull request
Apr 13, 2022
…present (#252) - 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):#12 File "/usr/local/lib/python3.7/dist-packages/ax_interface/mib.py", line 37, in start#012 self.reinit_data()#12 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)#12 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)#12 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)#12 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)#12 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))#12 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.
ssithaia-ebay
pushed a commit
to ssithaia-ebay/sonic-snmpagent
that referenced
this pull request
May 23, 2025
…onic-net#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(). 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
in counters db.
Signed-off-by: Suvarna Meenakshi sumeenak@microsoft.com
- What I did
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:
- 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