configure_snmp_agent stops at its "configure" step on every Proxmox VE node and reports a failure, although /etc/snmp/snmpd.conf was written. The firewall and start steps never run, so the SNMP fix never completes.
Cause._write_snmp_agent_config (system_mixin.py:557) hands _step a command that ends in exit $s. _rc wraps every command as { <command>; } 2>&1; echo __PVE_RC=$?. An exit inside { } ends the shell (the API exec path pipes the command into sh, as does the SSH fallback), so __PVE_RC= is never printed. _rc then returns status -1, and _step reports ok: False with an empty output.
Reproduced (2026-10-22) by running the exact command _write_snmp_agent_config produces through sh -c, with install -o root replaced by cp and the target by a scratch file: the file is written, and the output is '', with no __PVE_RC=.
Fix. End the command with [ "$s" -eq 0 ] instead of exit $s, as _write_apt_file does in the branch for NetOrk/netork#1397. Add a test that runs the wrapped command through a real sh, because the existing _Node fake answers __PVE_RC=0 on its own and so hides the bug.
Prio: P2 (important and urgent): the SNMP fix fails on every Proxmox node.
`configure_snmp_agent` stops at its "configure" step on every Proxmox VE node and reports a failure, although `/etc/snmp/snmpd.conf` was written. The firewall and start steps never run, so the SNMP fix never completes.
**Cause.** `_write_snmp_agent_config` ([system_mixin.py:557](https://git.netork.io/NAPALM/napalm-proxmox/src/commit/03c7cdf/napalm_proxmox/system_mixin.py#L557)) hands `_step` a command that ends in `exit $s`. `_rc` wraps every command as `{ <command>; } 2>&1; echo __PVE_RC=$?`. An `exit` inside `{ }` ends the shell (the API exec path pipes the command into `sh`, as does the SSH fallback), so `__PVE_RC=` is never printed. `_rc` then returns status `-1`, and `_step` reports `ok: False` with an empty output.
**Reproduced** (2026-10-22) by running the exact command `_write_snmp_agent_config` produces through `sh -c`, with `install -o root` replaced by `cp` and the target by a scratch file: the file is written, and the output is `''`, with no `__PVE_RC=`.
**Fix.** End the command with `[ "$s" -eq 0 ]` instead of `exit $s`, as `_write_apt_file` does in the branch for NetOrk/netork#1397. Add a test that runs the wrapped command through a real `sh`, because the existing `_Node` fake answers `__PVE_RC=0` on its own and so hides the bug.
Found while adding apt's proxy to the driver (NetOrk/netork#1397).
Prio: P2 (important and urgent): the SNMP fix fails on every Proxmox node.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
configure_snmp_agentstops at its "configure" step on every Proxmox VE node and reports a failure, although/etc/snmp/snmpd.confwas written. The firewall and start steps never run, so the SNMP fix never completes.Cause.
_write_snmp_agent_config(system_mixin.py:557) hands_stepa command that ends inexit $s._rcwraps every command as{ <command>; } 2>&1; echo __PVE_RC=$?. Anexitinside{ }ends the shell (the API exec path pipes the command intosh, as does the SSH fallback), so__PVE_RC=is never printed._rcthen returns status-1, and_stepreportsok: Falsewith an empty output.Reproduced (2026-10-22) by running the exact command
_write_snmp_agent_configproduces throughsh -c, withinstall -o rootreplaced bycpand the target by a scratch file: the file is written, and the output is'', with no__PVE_RC=.Fix. End the command with
[ "$s" -eq 0 ]instead ofexit $s, as_write_apt_filedoes in the branch for NetOrk/netork#1397. Add a test that runs the wrapped command through a realsh, because the existing_Nodefake answers__PVE_RC=0on its own and so hides the bug.Found while adding apt's proxy to the driver (NetOrk/netork#1397).
Prio: P2 (important and urgent): the SNMP fix fails on every Proxmox node.