Page MenuHomeVyOS Platform

Unhandled exception in SNMP v3 configuration without engineid.
Closed, ResolvedPublicBUG

Description

Unhandled exception in SNMP v3 configuration without engineid.

configure
set service snmp listen-address 192.168.5.100
set service snmp v3 view snmpview1 oid 1.2.3.4.5.6.7
set service snmp v3 group group1 mode ro
set service snmp v3 group group1 seclevel priv
set service snmp v3 group group1 view snmpview1
set service snmp v3 user user1 auth plaintext-password Password1
set service snmp v3 user user1 auth type sha
set service snmp v3 user user1 group group1
set service snmp v3 user user1 privacy plaintext-password Password1
set service snmp v3 user user1 privacy type aes
commit
[ service snmp ]
Traceback (most recent call last):
  File "/usr/libexec/vyos/services/vyos-configd", line 145, in run_script
    script.generate(c)
  File "/usr/libexec/vyos//conf_mode/service_snmp.py", line 221, in generate
    tmp = hash(dict_search('auth.plaintext_password', user_config),
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/vyos/snmpv3_hashgen.py", line 48, in plaintext_to_sha1
    engine = bytearray.fromhex(engine)
             ^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: fromhex() argument must be str, not None

[[service snmp]] failed
Commit failed
[edit]

We need to add a verification on the existence of engineid

Details

Version
1.5-rolling-202502190007, 1,4,1
Is it a breaking change?
Perfectly compatible
Issue type
Bug (incorrect behavior)

Event Timeline

a.apostoliuk triaged this task as Normal priority.

Engineid cli is not ok:

vyos@vyos# set service snmp v3 
Possible completions:
   engineid             <No help text available>
+> group                Specifies the group with name groupname
+> trap-target          Defines SNMP target for inform or traps for IP
+> user                 Specifies the user with name username
+> view                 Specifies the view with name viewname

      
[edit]
vyos@vyos# set service snmp v3 engineid 
Possible completions:
                        

      
[edit]
vyos@vyos# set service snmp v3 engineid
a.apostoliuk changed the task status from Open to In progress.Feb 25 2025, 1:54 PM
a.apostoliuk changed the task status from In progress to Needs testing.Feb 25 2025, 4:55 PM
c-po moved this task from Open to Finished on the VyOS 1.5 Circinus board.
c-po moved this task from Backlog to Finished on the VyOS 1.4 Sagitta (1.4.2) board.
c-po moved this task from Need Triage to Completed on the VyOS Rolling board.