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

SNMP error seen on supervisor in chassis #9996

Closed
SuvarnaMeenakshi opened this issue Feb 16, 2022 · 0 comments · Fixed by sonic-net/sonic-snmpagent#246
Closed

SNMP error seen on supervisor in chassis #9996

SuvarnaMeenakshi opened this issue Feb 16, 2022 · 0 comments · Fixed by sonic-net/sonic-snmpagent#246
Assignees
Labels
Chassis 🤖 Modular chassis support chassis-packet

Comments

@SuvarnaMeenakshi
Copy link
Contributor

Description

SNMP queries fail on supervisor because periodic data update for MIBs fail due to "Key '{COUNTERS_PORT_NAME_MAP}' unavailable in database '{COUNTERS_DB}'" error.

Steps to reproduce the issue:

Always seen on chassis supervisor

Describe the results you received:

Key '{COUNTERS_PORT_NAME_MAP}' unavailable in database '{COUNTERS_DB}' seen continuously in syslog.

Describe the results you expected:

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):

@SuvarnaMeenakshi SuvarnaMeenakshi self-assigned this Feb 16, 2022
SuvarnaMeenakshi added a commit to sonic-net/sonic-snmpagent that referenced this issue Mar 28, 2022
…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.
SuvarnaMeenakshi added a commit to SuvarnaMeenakshi/sonic-snmpagent that referenced this issue Apr 11, 2022
…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 added a commit to sonic-net/sonic-snmpagent that referenced this issue 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Chassis 🤖 Modular chassis support chassis-packet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant