Skip to content

Replace deprecated pysnmp-lextudio dependency#35

Open
NeoMod wants to merge 1 commit into
speedarr:mainfrom
NeoMod:fix-pysnmp-deprecated-package
Open

Replace deprecated pysnmp-lextudio dependency#35
NeoMod wants to merge 1 commit into
speedarr:mainfrom
NeoMod:fix-pysnmp-deprecated-package

Conversation

@NeoMod

@NeoMod NeoMod commented May 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Replaces the deprecated pysnmp-lextudio dependency with the official pysnmp package.

Speedarr currently emits this warning on startup:

/app/app/services/snmp_monitor.py:8: RuntimeWarning: The 'pysnmp-lextudio' package is deprecated and will be removed in future releases. Please use 'pysnmp' instead.
  from pysnmp.hlapi.asyncio import (

This PR updates the dependency from:

pysnmp-lextudio==6.3.0

to:

pysnmp==6.2.6

No SNMP code changes were required. The existing import path in backend/app/services/snmp_monitor.py remains compatible with pysnmp==6.2.6.

Why pysnmp==6.2.6

The deprecated package guidance recommends migrating back to the official pysnmp package while staying in the >=6.2.0,<7.0.0 range.

pysnmp 7.x includes breaking API changes, so this PR uses 6.2.6 to preserve current Speedarr behavior and avoid a larger SNMP refactor.

coreyeaston added a commit that referenced this pull request Jul 3, 2026
Replaces the deprecated pysnmp-lextudio package (which pinned pyasn1<0.6.1
and blocked the fix for the pyasn1 unbounded-recursion DoS, CVE-2026-30922)
with the maintained pysnmp 7.1.x line. Code changes required by 7.x:
snake_case get_cmd/next_cmd imports, awaited UdpTransportTarget.create()
at all four call sites, engine.close_dispatcher(), and a flattened
_walk_oid loop since next_cmd now returns a flat tuple of ObjectType
instead of 6.x's list-of-rows. Adds walk regression tests pinning the
flat shape and drops the now-dead pysnmp-lextudio warning filter.

Supersedes PR #35 (which proposed pysnmp 6.2.6, an unmaintained
migration-helper release, and kept the vulnerable pyasn1 pin).
Credit to @NeoMod for flagging the deprecated dependency.
@coreyeaston

Copy link
Copy Markdown
Contributor

Thanks for this — pysnmp-lextudio's deprecation was a real problem and this PR correctly identified the maintained pysnmp package as its replacement.

Superseded by 7bf1e9d on develop, which makes the same swap but to the current maintained line — pysnmp==7.1.27 with pyasn1==0.6.3 — rather than 6.2.6: pysnmp-lextudio's pyasn1<0.6.1 pin was also blocking the fix for CVE-2026-30922 (pyasn1 unbounded-recursion DoS), and the pysnmp changelog describes 6.2.6 as a migration-helper release that no longer receives fixes. The 7.x API needed small code changes in snmp_monitor.py (snake_case get_cmd/next_cmd, awaited UdpTransportTarget.create(), flat next_cmd result shape, close_dispatcher()), so the change went in as a commit rather than a revision of this PR. Credited in the commit message — thanks again for surfacing it.

@coreyeaston coreyeaston mentioned this pull request Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants