etingof / pysnmp

Python SNMP library
http://snmplabs.com/pysnmp/
BSD 2-Clause "Simplified" License
580 stars 200 forks source link

pysnmp.carrier.error.CarrierError: Unregistered transport with asyncio #170

Open bharatjosh opened 6 years ago

bharatjosh commented 6 years ago

Hi,

We are using pysnmp for our project with asyncio to collect SNMP data from multiple devices in single process. When the number of devices we need to collect data from, are more than 20, we see following traceback:

2018-07-22 01:50:21,125 - 24760 - asyncio - ERROR - Exception in callback AbstractTransportDispatcher._cbFun(<pysnmp.carri...x7f7b54c214e0>, ('10.0.2.66', 161), b'01\x02\x01\...:\x04\x04eth0')
handle: <Handle AbstractTransportDispatcher._cbFun(<pysnmp.carri...x7f7b54c214e0>, ('10.0.2.66', 161), b'01\x02\x01\...:\x04\x04eth0')>
Traceback (most recent call last):
  File "/usr/lib/python3.4/asyncio/events.py", line 120, in _run
    self._callback(*self._args)
  File "virtualenv/lib/python3.4/site-packages/pysnmp/carrier/base.py", line 58, in _cbFun
    'Unregistered transport %s' % (incomingTransport,)
pysnmp.carrier.error.CarrierError: Unregistered transport <pysnmp.carrier.asyncio.dgram.udp.UdpAsyncioTransport object at 0x7f7b54c214e0> 

We are using pysnmp==4.4.4 and doing this in a virtual-environment.

Please let us know if you can help us with something to fix this issue.

Regards, Bharat

etingof commented 6 years ago

This is curious... I can imagine this happening if you reinitialize the main loop every now and then.

Could you please show me your script? If you could come up with a minimal reproducer, that would be absolutely awesome! ;)

bieniu commented 4 years ago

Any additional information on this issue? We have exactly the same error in integration for Brother printers in the Home Assistant. The integration uses this library.

arunachalav commented 3 years ago

Any updates on this?

dolevha commented 2 weeks ago

Hi, I experience a similar issue in my environment when walking through multiple switches at once with asyncio. Did you get to solve this issue?

lextm commented 2 weeks ago

@dolevha This isn't the repo for PySNMP package. Please read #429 to learn more.

Besides, you need to be using a supported version, https://github.com/lextudio/pysnmp/blob/main/SECURITY.md. As new maintainers, we have fixed many bugs in the past few releases, so this might have been resolved already.