Unbound crashes enabling Python Module
-
Im having a issue at one of my pfSense locations not being able to enable Python Module in unbound with pfblocker enabled without unbound crashing.
Here is the error thrown that causes unbound service to stop
The generated config file cannot be parsed by unbound. Please correct the following errors: Traceback (most recent call last): File "<string>", line 1, in <module> File "/usr/local/lib/python3.8/distutils/sysconfig.py", line 18, in <module> from .util import get_platform, get_host_platform File "/usr/local/lib/python3.8/distutils/util.py", line 9, in <module> import importlib.util ValueError: source code string cannot contain null bytes Traceback (most recent call last): File "<string>", line 1, in <module> NameError: name 'distutils' is not defined Traceback (most recent call last): File "<string>", line 1, in <module> ModuleNotFoundError: No module named 'unboundmodule' [1661348595] unbound-checkconf[24803:0] error: pythonmod: cannot initialize core module: unboundmodule.py [1661348595] unbound-checkconf[24803:0] fatal error: bad config for python module
I have uninstalled pfblocker wiping all setting then reinstalled but the same error is thrown resulting in unbound service stopping/unable to restart.
-
@compsmith said in Unbound crashes enabling Python Module:
enable Python Module in unbound with pfblocker
You are using :
right ?
-
@gertjan Yes
-
So you have this :
Note that this python module can be found here :
[22.05-RELEASE][admin@pfSenselocal.net]/var/unbound: ls -al pfb_unbound.py -rw-r--r-- 1 root unbound 66760 Aug 24 17:02 pfb_unbound.py
On the Services > DNS Resolver > General Settings page, the Custom options should be empty.
This file "unboundmodule.py" is a core Python 3.8 file :
[22.05-RELEASE][admin@pfSense.local.net]/var/unbound: find / -name unboundmodule.py /usr/local/lib/python3.8/site-packages/unboundmodule.py /var/unbound/usr/local/lib/python3.8/site-packages/unboundmodule.py
The second one is a mapped version of the first one, as /usr/local/lib/python3.8/ is mapped into /var/unbound/ for unbound chroot reasons.
Your are running 2.6.0, right ?
Packages are always build against the latest pfSense version, as that one includes the latest support files.
For example, pfSEnse versions before 2.6.0 didn't had the needed Python version installed. That would explain your issue : this internal file couldn't be found.
So, it's true, using an old version is a pain.If you use 2.6.0 (or 22.05) : core system files are absent or corrupt. Don't look any further ; re install.