FreeBSD 12.3 python38-3.8.15
The error is not specific til 5.5.2 since I am upgrading from NAV 5.2.1.
ipdevpoll will not start:
Traceback (most recent call last): File "/usr/local/bin/ipdevpolld", line 19, in <module> from nav.ipdevpoll.epollreactor2 import install File "/usr/local/lib/python3.8/site-packages/nav/ipdevpoll/epollreactor2.py", line 24, in <module> from twisted.internet import epollreactor File "/usr/local/lib/python3.8/site-packages/twisted/internet/epollreactor.py ", line 16, in <module> from select import epoll, EPOLLHUP, EPOLLERR, EPOLLIN, EPOLLOUT ImportError: cannot import name 'epoll' from 'select' (/usr/local/lib/python3.8/lib-dynload/select.cpython-38.so)
Am I missing a library or a module?
This is a bit urgent since I really don't want to downgrade...
--Ingeborg
On Thu, 10 Nov 2022 13:10:21 +0100 Ingeborg Hellemo ingeborg.hellemo@uit.no wrote:
ipdevpoll will not start:
Traceback (most recent call last): File "/usr/local/bin/ipdevpolld", line 19, in <module> from nav.ipdevpoll.epollreactor2 import install File "/usr/local/lib/python3.8/site-packages/nav/ipdevpoll/epollreactor2.py", line 24, in <module> from twisted.internet import epollreactor File "/usr/local/lib/python3.8/site-packages/twisted/internet/epollreactor.py ", line 16, in <module> from select import epoll, EPOLLHUP, EPOLLERR, EPOLLIN, EPOLLOUT ImportError: cannot import name 'epoll' from 'select' (/usr/local/lib/python3.8/lib-dynload/select.cpython-38.so)
Am I missing a library or a module?
This is a bit urgent since I really don't want to downgrade...
This is definitely not 5.5 specific, and this is what you get for jumping across multiple feature releases in one go :)
As you know, we don't test on FreeBSD, and in this case, ipdevpoll has inadvertently been made Linux-specific, by forcing the use of the epoll interface for SNMP I/O.
Twisted defaults to the epollreactor on Linux, but it had a problem we needed to work around, so we built our own epollreactor2 and we install that at the start of the ipdevpoll process.
The epoll interface doesn't exist on FreeBSD, so Twisted would probably normally default to some other reactor implementation on that platform. I don't know whether that reactor has the same issue we experienced with the epollreactor, but:
You should be able to work around this on FreeBSD by simply removing lines 19-22 in bin/ipdevpolld: https://github.com/Uninett/nav/blob/a1268fb5c4e248dd82e6c14e76b82838add756b3...
Then Twisted would default to whatever reactor it prefers on FreeBSD.
Oh, and please file a bug, so we remember to find a more permanent workaround for non-Linux in NAV :)
morten.brekkevold@sikt.no said:
You should be able to work around this on FreeBSD by simply removing lines 19-22 in bin/ipdevpolld:
Yes! It works!
morten.brekkevold@sikt.no said:
Oh, and please file a bug, so we remember to find a more permanent workaround for non-Linux in NAV :)
Will do!
--Ingeborg