• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login
Netgate Discussion Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login

Unbound crashes enabling Python Module

Scheduled Pinned Locked Moved DHCP and DNS
4 Posts 2 Posters 767 Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C
    compsmith
    last edited by Aug 24, 2022, 3:28 PM

    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.

    G 1 Reply Last reply Aug 24, 2022, 3:56 PM Reply Quote 0
    • G
      Gertjan @compsmith
      last edited by Aug 24, 2022, 3:56 PM

      @compsmith said in Unbound crashes enabling Python Module:

      enable Python Module in unbound with pfblocker

      You are using :

      c1091116-a5e3-4c34-9056-7bf441b6786a-image.png

      right ?

      No "help me" PM's please. Use the forum, the community will thank you.
      Edit : and where are the logs ??

      C 1 Reply Last reply Aug 24, 2022, 4:02 PM Reply Quote 0
      • C
        compsmith @Gertjan
        last edited by Aug 24, 2022, 4:02 PM

        @gertjan Yes

        pfblocker.png

        G 1 Reply Last reply Aug 25, 2022, 7:31 AM Reply Quote 0
        • G
          Gertjan @compsmith
          last edited by Aug 25, 2022, 7:31 AM

          @compsmith

          So you have this :

          b553bebb-74cd-4bff-b095-6df1e7801c1a-image.png

          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.

          No "help me" PM's please. Use the forum, the community will thank you.
          Edit : and where are the logs ??

          1 Reply Last reply Reply Quote 0
          1 out of 4
          • First post
            1/4
            Last post
          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
            This community forum collects and processes your personal information.
            consent.not_received