NLnetLabs / unbound

Unbound is a validating, recursive, and caching DNS resolver.
https://nlnetlabs.nl/unbound
BSD 3-Clause "New" or "Revised" License
3.17k stars 361 forks source link

Unbound 1.17.1 module python failed #829

Closed pengelana closed 1 year ago

pengelana commented 1 year ago

Describe the bug Unbound 1.17.1 Successfully build with python 3.6 but failed after start.

unbound: [7930:0] error: pythonmod: can't parse Python script script.py
unbound: [7930:0] error: pythonmod: python error: NoneType: None
unbound: [7930:0] error: module init for module python failed
unbound: [7930:0] fatal error: failed to setup modules

Expected behavior Working fine until Unbound 1.17.0

System:

Version 1.17.1

Configure line: --prefix=/usr/local --disable-maintainer-mode --disable-dependency-tracking --disable-rpath --sysconfdir=/etc --with-pidfile=/run/unbound.pid
--with-libevent --with-pythonmodule --with-pyunbound --enable-subnet --enable-dnstap --enable-systemd --with-dnstap-socket-path=/run/dnstap.sock --disable-flto --enable-tfo-client --enable-tfo-server
Linked libs: libevent 2.1.8-stable (it uses epoll), OpenSSL 1.1.1  11 Sep 2018
Linked modules: dns64 python subnetcache respip validator iterator
TCP Fastopen feature available
wcawijngaards commented 1 year ago

There has been a bug fix, slated for upcoming releases, that is in the code repository. https://github.com/NLnetLabs/unbound/commit/4517dcd439562cb1df07e77738153c0c906bb069 could solve the issue, perhaps.

This fix deals with install paths. Different python components can report different install paths. And the fix picks the ones that seem most relevant given the python version.

Does that fix the issue for you, the version from the code repository?

pengelana commented 1 year ago

Thanks @wcawijngaards Unbound 1.17.1 with patch from https://github.com/NLnetLabs/unbound/commit/4517dcd439562cb1df07e77738153c0c906bb069 working fine.

AskAlice commented 1 year ago

I'm experiencing this on 1.17.1_2

2023-02-20T14:25:24-07:00 Critical unbound [89033:0] fatal error: failed to setup modules  
2023-02-20T14:25:24-07:00 Error unbound [89033:0] error: module init for module python failed  
2023-02-20T14:25:24-07:00 Error unbound [89033:0] error: pythonmod: python error: NoneType: None  
2023-02-20T14:25:24-07:00 Error unbound [89033:0] error: pythonmod: can't parse Python script dnsbl_module.py