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

    PHP Fatal error: Allowed memory size exhausted in /usr/local/bin/kea2unbound

    Scheduled Pinned Locked Moved Problems Installing or Upgrading pfSense Software
    4 Posts 2 Posters 70 Views 2 Watching
    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.
    • flederohrF Offline
      flederohr
      last edited by flederohr

      Hi,

      after upgrading to version 2.8.1 I'm seeing regular crash reports in the pfSense UI.

      Crash report begins.  Anonymous machine information:
      
      amd64
      15.0-CURRENT
      FreeBSD 15.0-CURRENT #21 RELENG_2_8_1-n256095-47c932dcc0e9: Thu Aug 28 16:27:48 UTC 2025     root@pfsense-build-release-amd64-1.eng.atx.netgate.com:/var/jenkins/workspace/pfSense-CE-snapshots-2_8_1-main/obj/amd64/AupY3aTL/var/jenkins/workspace/pfSense-CE-
      
      Crash report details
      
      PHP Errors:
      [04-Nov-2025 18:39:05 Europe/Berlin] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in /usr/local/bin/kea2unbound on line 528
      [04-Nov-2025 18:39:39 Europe/Berlin] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in /usr/local/bin/kea2unbound on line 528
      [04-Nov-2025 18:40:13 Europe/Berlin] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in /usr/local/bin/kea2unbound on line 528
      [04-Nov-2025 18:40:48 Europe/Berlin] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in /usr/local/bin/kea2unbound on line 528
      [04-Nov-2025 18:41:21 Europe/Berlin] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in /usr/local/bin/kea2unbound on line 528
      [04-Nov-2025 18:41:56 Europe/Berlin] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in /usr/local/bin/kea2unbound on line 528
      [04-Nov-2025 18:42:30 Europe/Berlin] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in /usr/local/bin/kea2unbound on line 528
      [04-Nov-2025 18:43:04 Europe/Berlin] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in /usr/local/bin/kea2unbound on line 528
      [04-Nov-2025 18:43:38 Europe/Berlin] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in /usr/local/bin/kea2unbound on line 528
      [04-Nov-2025 18:44:12 Europe/Berlin] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in /usr/local/bin/kea2unbound on line 528
      [04-Nov-2025 18:44:47 Europe/Berlin] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in /usr/local/bin/kea2unbound on line 528
      [04-Nov-2025 18:45:21 Europe/Berlin] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in /usr/local/bin/kea2unbound on line 528
      [04-Nov-2025 18:45:55 Europe/Berlin] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in /usr/local/bin/kea2unbound on line 528
      [04-Nov-2025 18:46:29 Europe/Berlin] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in /usr/local/bin/kea2unbound on line 528
      [04-Nov-2025 18:47:03 Europe/Berlin] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in /usr/local/bin/kea2unbound on line 528
      [04-Nov-2025 18:47:37 Europe/Berlin] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in /usr/local/bin/kea2unbound on line 528
      [04-Nov-2025 18:48:12 Europe/Berlin] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in /usr/local/bin/kea2unbound on line 528
      [04-Nov-2025 18:48:46 Europe/Berlin] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in /usr/local/bin/kea2unbound on line 528
      [04-Nov-2025 18:49:20 Europe/Berlin] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in /usr/local/bin/kea2unbound on line 528
      [04-Nov-2025 18:49:54 Europe/Berlin] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in /usr/local/bin/kea2unbound on line 528
      [04-Nov-2025 18:50:28 Europe/Berlin] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in /usr/local/bin/kea2unbound on line 528
      [04-Nov-2025 18:51:02 Europe/Berlin] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in /usr/local/bin/kea2unbound on line 528
      [04-Nov-2025 18:51:36 Europe/Berlin] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in /usr/local/bin/kea2unbound on line 528
      [04-Nov-2025 18:52:10 Europe/Berlin] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in /usr/local/bin/kea2unbound on line 528
      [04-Nov-2025 18:52:45 Europe/Berlin] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in /usr/local/bin/kea2unbound on line 528
      [04-Nov-2025 18:53:19 Europe/Berlin] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in /usr/local/bin/kea2unbound on line 528
      [04-Nov-2025 18:53:53 Europe/Berlin] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in /usr/local/bin/kea2unbound on line 528
      [04-Nov-2025 18:54:27 Europe/Berlin] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in /usr/local/bin/kea2unbound on line 528
      [04-Nov-2025 18:55:01 Europe/Berlin] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in /usr/local/bin/kea2unbound on line 528
      [04-Nov-2025 18:55:29 Europe/Berlin] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in /usr/local/bin/kea2unbound on line 528
      [04-Nov-2025 18:56:10 Europe/Berlin] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in /usr/local/bin/kea2unbound on line 528
      [04-Nov-2025 18:56:44 Europe/Berlin] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in /usr/local/bin/kea2unbound on line 528
      [04-Nov-2025 18:57:18 Europe/Berlin] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in /usr/local/bin/kea2unbound on line 528
      
      
      
      No FreeBSD crash data found.
      
      
      

      I have searched the forum and found a similar issue reported in the previous version of pfSense.
      Related topics:

      • https://forum.netgate.com/post/1216303
      • https://forum.netgate.com/topic/198381
      • https://forum.netgate.com/topic/198764

      The general solution in these topics is to use python mode in pfBlocker DNSBL.
      Unfortunately this is not helping in my case
      I already have DNSBL Mode set to Unbound python mode
      and Python Module in DNS Recorder is enabled as well.

      Investigation

      Process that is executed:

      [2.8.1-RELEASE][admin@pfSense.local.lan]/root: ps aux | grep kea2unbound
      root     7072   0.0  0.0   14644    3096  -  S    18:44      0:00.00 /bin/sh /conf/kea4_scripts.d/kea2unbound.sh lease4_update
      root     7116   0.0  0.2   62232   38196  -  S    18:44      0:00.04 php /usr/local/bin/kea2unbound --kea-conf /usr/local/etc/kea/kea-dhcp4.conf --unbound-conf /var/unbound/unbound.conf --include-file /var/unbound/leases/leases4.conf sync --subnet-id 1
      root     7821   0.0  0.0   14076    2692  0  S+   18:44      0:00.00 grep kea2unbound
      

      referenced files from kea2unbound script:

      [2.8.1-RELEASE][admin@pfSense.local.lan]/root: ls -lisah  /usr/local/etc/kea/kea-dhcp4.conf /var/unbound/unbound.conf  /var/unbound/leases/leases4.conf
      33307 5 -rw-r--r--  1 root    wheel     12K Nov  4 17:56 /usr/local/etc/kea/kea-dhcp4.conf
        189 5 -rw-r--r--  1 root    unbound   95B Nov  4 18:33 /var/unbound/leases/leases4.conf
      32688 5 -rw-r--r--  1 unbound unbound  3.2K Nov  4 18:31 /var/unbound/unbound.conf
      
      

      content of unbound.conf:

      [2.8.1-RELEASE][admin@pfSense.local.lan]/root: tail /var/unbound/unbound.conf
      include: /var/unbound/remotecontrol.conf
      
      # Python Module
      
      
      
      server:include: /var/unbound/pfb_dnsbl.*conf
      
      python:
      python-script: pfb_unbound.py
      

      this is including this large config file pfb_dnsbl.conf:

      [2.8.1-RELEASE][admin@pfSense.local.lan]/root: ls -lisah /var/unbound/pfb_dnsbl.*conf
      32625 14813 -rw-r--r--  1 root unbound   77M Nov  4 18:32 /var/unbound/pfb_dnsbl.conf
      

      execution of kea2unbound with debug output:

      [2.8.1-RELEASE][admin@pfSense.local.lan]/root: php -d display_errors=1 -d display_startup_errors=1 -d error_reporting=E_ALL /usr/local/bin/kea2unbound --kea-conf /usr/local/etc/kea/kea-dhcp4.conf --unbound-conf /var/unbound/unbound.conf --include-file /var/unbound/leases/leases4.conf sync --subnet-id 1
      
      Warning: Undefined array key "domain-search" in /usr/local/bin/kea2unbound on line 467
      
      Warning: Trying to access array offset on null in /usr/local/bin/kea2unbound on line 467
      
      Warning: Undefined array key "domain-search" in /usr/local/bin/kea2unbound on line 467
      
      Warning: Trying to access array offset on null in /usr/local/bin/kea2unbound on line 467
      
      Warning: Undefined array key "domain-search" in /usr/local/bin/kea2unbound on line 467
      
      Warning: Trying to access array offset on null in /usr/local/bin/kea2unbound on line 467
      
      Warning: Undefined array key "domain-search" in /usr/local/bin/kea2unbound on line 467
      
      Warning: Trying to access array offset on null in /usr/local/bin/kea2unbound on line 467
      
      Warning: Undefined array key "domain-search" in /usr/local/bin/kea2unbound on line 467
      
      Warning: Trying to access array offset on null in /usr/local/bin/kea2unbound on line 467
      
      Warning: Undefined array key "domain-search" in /usr/local/bin/kea2unbound on line 467
      
      Warning: Trying to access array offset on null in /usr/local/bin/kea2unbound on line 467
      
      Warning: Undefined array key "domain-search" in /usr/local/bin/kea2unbound on line 467
      
      Warning: Trying to access array offset on null in /usr/local/bin/kea2unbound on line 467
      
      Warning: Undefined array key "domain-search" in /usr/local/bin/kea2unbound on line 467
      
      Warning: Trying to access array offset on null in /usr/local/bin/kea2unbound on line 467
      
      Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in /usr/local/bin/kea2unbound on line 528
      
      S 1 Reply Last reply Reply Quote 0
      • S Offline
        SteveITS Galactic Empire @flederohr
        last edited by

        @flederohr Change to python mode.
        https://forum.netgate.com/topic/198381/kea2unbound-is-using-too-much-memory-in-the-process-of-upgrading-to-25.07/2

        Only install packages for your version, or risk breaking it. Select your branch in System/Update/Update Settings.
        When upgrading, allow 10-15 minutes to reboot, or more depending on packages, CPU, and/or disk speed.
        Upvote 👍 helpful posts!

        1 Reply Last reply Reply Quote 0
        • flederohrF Offline
          flederohr
          last edited by

          @SteveITS I am already using the python mode
          In -> Firewall -> pfBlockerNG -> DNSBL
          a61c8554-4b1b-4258-beb1-8e5126c47e51-image.png
          In -> Services -> DNS Resolver -> General Settings:
          dc1f7d18-ef5f-41ba-acd5-012cd667a4d7-image.png

          Am I missing a setting?

          1 Reply Last reply Reply Quote 0
          • flederohrF Offline
            flederohr
            last edited by flederohr

            I noticed that the kea2unbound version shipped with pfsense 2.8.1 equals this commit in the pfsense git repository
            Bring in Kea enhancements from Plus (marcos-ng comitted on Mar 26)

            After updating the version of /usr/local/bin/kea2unbound with this version:
            kea2unbound: use the new unbound fast-reload feature in v1.23 (rcmcdonald91 committed on Jul 2)
            the error seems to be gone.

            Steps
            # downlaod kea2unbound Commit 146391a
            curl https://raw.githubusercontent.com/pfsense/pfsense/146391aa0c5c25348f8f6fa36120332ccbb74ce0/src/usr/local/bin/kea2unbound -o ~/kea2unbound
            
            # set permissions
            chmod +x ~/kea2unbound
            
            # backup previous version
            cp /usr/local/bin/kea2unbound ~/kea2unbound.bak_RELEASE_2.8.1 
            
            # overwrite version 
            mv ~/kea2unbound /usr/local/bin/kea2unbound
            
            1 Reply Last reply Reply Quote 3
            • GertjanG Gertjan referenced this topic
            • First post
              Last post
            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.