Snmp configuration error on 1.2.7, 1.2.8

When I tried to upgrade my router from 1.2.6 to 1.2.9 my snmp v2 configuration no longer worked

This worked fine on 1.2.6 and earlier

    snmp {
        community mynetwork {
            authorization ro
        }
        contact Joel
        location home

But on 1.2.7 and 1.2.8 I get this error message when I commit

[ service snmp ]
  File "/usr/libexec/vyos/conf_mode/snmp.py", line 630
    raise ConfigError(f'Group membership required for user "{username}"!')
                                                                        ^
SyntaxError: invalid syntax

[[service snmp]] failed
Commit failed

Any ideas? Is there some other config I need to make this work on the newer versions, or is this actually a bug? I haven’t tried 1.3 because I thought upgrading to the latest 1.2 would be easier :-/

Additional info - I tried 1.3.0 and this problem is not present there

Hello @buddyp
In version 1.2.8, the configuration was applied:

vyos@vyos# set service snmp community mynetwork authorization ro
[edit]
vyos@vyos# set service snmp location home
[edit]
vyos@vyos# set service snmp contact Joel
[edit]
vyos@vyos# commit
[edit]
vyos@vyos# show service snmp 
 community mynetwork {
     authorization ro
 }
 contact Joel
 location home
[edit]
vyos@vyos# run show version
Version:          VyOS 1.2.8
Release Train:    crux

This error occurs in the snmp v3 configuration.

Hi @buddyp,

VyOS 1.2.9 is not out (yet) and this issue was caused by a backport from 1.3 series.
The repositories already contain the fix https://github.com/vyos/vyos-1x/commit/d39187f4bde6369c1bccd547239fe1647746ecd2

You could eihter rebuild your 1.2 ISO image or edit the file /usr/libexec/vyos/conf_mode/snmp.py and drop the lines from aboves commit. Please reboot afterwards!

–
CPO

1 Like

thanks for the reply, c-po

1.3.0 seems to be working for me so far, so I am just rolling with that

Joel