"Controller service snmpd failed" due to IndexError in aviportalsnmpagent when ServiceEngines have empty vnic_networks list.
search cancel

"Controller service snmpd failed" due to IndexError in aviportalsnmpagent when ServiceEngines have empty vnic_networks list.

book

Article ID: 426426

calendar_today

Updated On:

Products

VMware Avi Load Balancer

Issue/Introduction

 

  • The controller snmpd service will fail repeatedly, and the following events can be observed under All Events on the controller.
  • To view all events on an Avi Controller, sign into the web UI and navigate to Operations > Events > All Events

 

 

  • The journalctl logs for aviportalsnmpagent.service show an error: IndexError: list index (0) out of range.
  •  Check the journalctl logs for aviportalsnmpagent.service on the controller leader node.
journalctl -u aviportalsnmpagent.service
Jan 18 21:36:56 ####### aviportalsnmpagent-service[5166]:   File "snmpagent.py", line 82, in GetServiceEngine
Jan 18 21:36:56 ####### aviportalsnmpagent-service[5166]:     rsp.serviceengine_mib_entry.mgmt_ip.CopyFrom(pb.mgmt_vnic.vnic_networks[0].ip.ip_addr)
Jan 18 21:36:56 ####### aviportalsnmpagent-service[5166]:                                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^
Jan 18 21:36:56 ####### aviportalsnmpagent-service[5166]: IndexError: list index (0) out of range
Jan 18 23:27:19 ####### aviportalsnmpagent-service[5166]: Traceback (most recent call last):

 

 

 

Environment

  • Avi Load Balancer
  • Affected Version: 31.1.1

Cause

  • Due to missing validation for an empty vnic_networks list, the snmpagent attempted to access pb.mgmt_vnic.vnic_networks[0], leading to an empty RPC esponse and repeated snmpd service restarts.

Resolution

Temporary Workaround:

Remove any Service Engines that do not have a management vNIC/IP configured.

 

Permanent Fix:

The issue will be permanently fixed on version 32.1.1