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

    PHP error when editing and saving an IPV4 custom list

    Scheduled Pinned Locked Moved pfBlockerNG
    4 Posts 2 Posters 647 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.
    • P
      PeaAre
      last edited by

      Hi everyone,

      I have scoured the web and these forums for days and I have not found the exact problem I am experiencing.

      I am running pfSense 23.01 and pfBlockerNG-devel 3.2.0_3

      I have previously been able to, until now, edit a Whitelist under pfBlockerNG | IP | IPV4 | Whitelist. Now upon saving the changes to that custom list, I get an error. I believe the problem started happening after upgrading to level 3.2.0_3. I am able to see the IPv4 Custom_List, I make my changes and click "Save IPv4 Settings" and I get this error:

      PHP ERROR: Type: 1, File: /usr/local/www/pfblockerng/pfblockerng_category_edit.php, Line: 448, Message: Uncaught TypeError: array_key_exists(): Argument #2 ($array) must be of type array, null given in /usr/local/www/pfblockerng/pfblockerng_category_edit.php:448
      Stack trace:
      #0 {main}
      thrown

      I have removed pfBlockerNG-devel 3.2.0_3 and reinstalled the non-devel version whilst keeping settings, also reinstalled whilst NOT keeping settings. I thought it could be a mistake in my list (extra non-printable characters, for example) so I removed everything in the "IPv4 Custom_List" box and tried to save and I always get the exact same thing (error above).

      I'm at a loss. I feel like it is something in the pfblockerng_category_edit.php code, as reported in the error message, but I cannot confirm this. I'm pulling what little hair I have out of my head! :)

      Any assistance would be greatly appreciated! Thank you!

      1 Reply Last reply Reply Quote 0
      • P
        PeaAre
        last edited by PeaAre

        Hi everyone,

        I'm sorry to bump this post but I am still having issues saving a Custom IPV4 Whitelist. I get a PHP error (above) and I cannot save changes.

        If there is a way to update my Custom IPV4 Whitelist via the shell, I'm perfectly comfortable editing files directly, I'm just not familiar with the proper method to do it that way. I would at least be able to edit the list until this issue is resolved in a forthcoming version (assuming it is a code issue).

        Thank you!

        1 Reply Last reply Reply Quote 0
        • P
          PeaAre
          last edited by

          I just poked around a bit more and I have additional information.

          In Firewall | pfBlockerNG | IP | IPv4 I have a Blacklist entry and a Whitelist entry. (The one I am having trouble with is the Whitelist). I tried editing the Blacklist entry by adding a commented line at the top of the IPv4 Custom_List. It saved just fine. I tried the same thing to the Whitelist entry and I get the same PHP error.

          I know these are categorically different files and functions, but since they are both IPV4 custom lists, are they using the same process to edit the files via PHP? If so, could there be a problem with the actual Whitelist file itself that is causing the error?

          Just for giggles, I created a new entry, Whitelist2. I configured it the same as the troublesome Whitelist and I am getting PHP errors on that entry, too. They are different errors, nonetheless, I am still getting PHP errors.

          S 1 Reply Last reply Reply Quote 0
          • S
            SteveITS Galactic Empire @PeaAre
            last edited by

            @peaare With the large amount of code changes for moving from PHP 7 to 8 it is likely a bug, as I've seen posts for similar Uncaught TypeError messages since the release of 23.01. Since you can duplicate it I would create an issue at redmine.pfsense.org.

            I'm not sure how to tell you to do it via shell, but since it would be in the XML config file you could save/export that, edit it, and import it again (which reboots pfSense).

            Pre-2.7.2/23.09: 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 restart, or more depending on packages and device speed.
            Upvote 👍 helpful posts!

            1 Reply Last reply Reply Quote 0
            • First post
              Last post
            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.