Page MenuHomeVyOS Platform

`show snmp mib ifmib` crashes with IndexError
Closed, ResolvedPublic

Description

After run command show snmp mib ifmib and lspci not returned values script crashed

lo:     ifIndex = 1
        ifAlias = lo
        ifDescr = lo
eth0:   ifIndex = 2
        ifAlias = OUTSIDE
Traceback (most recent call last):
  File "/usr/libexec/vyos/op_mode/snmp_ifmib.py", line 126, in <module>
    print('\t{0}'.format(show_ifdescr(i)))
  File "/usr/libexec/vyos/op_mode/snmp_ifmib.py", line 82, in show_ifdescr
    vendor = string[3]
IndexError: list index out of range

Returned values

sudo cat /sys/class/net/eth0/device/vendor
 0x1af4
sudo cat /sys/class/net/eth0/device/device
0x0001
/usr/bin/lspci -mm -d 0x1af4:0x0001

needs add additional check

Details

Difficulty level
Unknown (require assessment)
Version
-
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)

Event Timeline

Dmitry created this object in space S1 VyOS Public.
Dmitry updated the task description. (Show Details)
Dmitry changed the task status from Open to Needs testing.Nov 28 2019, 12:27 PM
Dmitry claimed this task.
Dmitry set Is it a breaking change? to Unspecified (possibly destroys the router).

This patch successfully tested on VyOS 1.2.3

vyos@vyos# run show snmp mib ifmib 
lo:     ifIndex = 1
        ifAlias = lo
        ifDescr = lo
eth0:   ifIndex = 2
        ifAlias = eth0
        ifDescr =  
eth1:   ifIndex = 3
        ifAlias = eth1
        ifDescr =  
eth2:   ifIndex = 4
        ifAlias = eth2
        ifDescr =  
eth3:   ifIndex = 5
        ifAlias = eth3
        ifDescr =
syncer changed the task status from Needs testing to Backport pending.Jan 1 2020, 1:02 PM
syncer reassigned this task from Dmitry to jestabro.
syncer triaged this task as Normal priority.
syncer moved this task from Need Triage to Finished on the VyOS 1.3 Equuleus board.
erkin renamed this task from `show snmp mib ifmib` crashed to `show snmp mib ifmib` crashes with IndexError.Sep 9 2020, 1:00 PM