Bug 2368372 - pysnmp broken: ModuleNotFoundError: No module named 'pyasn1.compat.octets'
Summary: pysnmp broken: ModuleNotFoundError: No module named 'pyasn1.compat.octets'
Keywords:
Status: ON_QA
Alias: None
Product: Fedora
Classification: Fedora
Component: pysnmp
Version: 42
Hardware: Unspecified
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Fabian Affolter
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2025-05-24 16:10 UTC by Ronald Wahl
Modified: 2025-05-29 06:12 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Ronald Wahl 2025-05-24 16:10:52 UTC
On Fedora 42 with pyasn1 0.6.1 the pysnmp module will not work anymore and gives a backtrace.

This problem was initialle reported against pyasn1 here:
https://github.com/pyasn1/pyasn1/issues/76
The actual fix is in pysnmp:
https://github.com/lextudio/pysnmp/issues/113

Looks like that the packed version in Fedora is rather old.

Reproducible: Always

Steps to Reproduce:
1.Install python3-pyasn1 and python3-pysnmp
2. Call: python
3. Run: from pysnmp.hlapi import ObjectIdentity
Actual Results:
Traceback (most recent call last):
  File "<python-input-0>", line 1, in <module>
    from pysnmp.hlapi import ObjectIdentity
  File "/usr/lib/python3.13/site-packages/pysnmp/hlapi/__init__.py", line 7, in <module>
    from pysnmp.proto.rfc1902 import *
  File "/usr/lib/python3.13/site-packages/pysnmp/proto/rfc1902.py", line 9, in <module>
    from pysnmp.proto import rfc1155, error
  File "/usr/lib/python3.13/site-packages/pysnmp/proto/rfc1155.py", line 10, in <module>
    from pysnmp.proto import error
  File "/usr/lib/python3.13/site-packages/pysnmp/proto/error.py", line 9, in <module>
    from pysnmp import debug
  File "/usr/lib/python3.13/site-packages/pysnmp/debug.py", line 8, in <module>
    from pyasn1.compat.octets import octs2ints
ModuleNotFoundError: No module named 'pyasn1.compat.octets'


Expected Results:
no output

Comment 1 fedepell 2025-05-25 04:14:18 UTC
I did a MR (https://src.fedoraproject.org/rpms/pysnmp/pull-request/2) to bump to 7.1.16 that was even merged after some struggle, but then was never built (note in MR comments I've asked for that again couple of times) and pushed to updates so never got in.

I use that version (of course rebuilding with local facilities) in production since some time (not sure about your specific report, but never bumped in any problem till now).

Sadly seems the maintainer is quite unresponsive.

Comment 2 Fedora Update System 2025-05-28 22:01:51 UTC
FEDORA-2025-878c0f02b7 (pysnmp-7.1.16-1.fc42) has been submitted as an update to Fedora 42.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-878c0f02b7

Comment 3 Fedora Update System 2025-05-29 01:18:49 UTC
FEDORA-2025-878c0f02b7 has been pushed to the Fedora 42 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2025-878c0f02b7`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2025-878c0f02b7

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 4 fedepell 2025-05-29 06:12:20 UTC
The update pushed to QA should have solved this. Please note API changed so ie. a check (but is done as well in automatic test now in RPM build with the import check tests) can be instead:
```
>>> from pysnmp.hlapi.v3arch.asyncio import ObjectIdentity
>>> from pysnmp.hlapi.v1arch.asyncio import ObjectIdentity
```


Note You need to log in before you can comment on or make changes to this bug.