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

    Error on pfblockerng.inc:5310 pfBlockerNG-devel 3.2.0_5

    Scheduled Pinned Locked Moved pfBlockerNG
    25 Posts 9 Posters 3.3k 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.
    • J
      jazzl0ver @octopilami
      last edited by

      Same here after upgrading from 2.6.0 to 2.7.0. Line 5310 is about collecting dhcpd info, but my server does not have dhcp server configured..

      5310:                if (is_array($dhcp['staticmap'])) {
                              foreach ($dhcp['staticmap'] as $smap) {
                                      $local_hosts[$smap['ipaddr']] = strtolower("{$smap['hostname']}");
                              }
                      }
      

      Any ideas how to fix it?

      1 Reply Last reply Reply Quote 0
      • J
        jazzl0ver @octopilami
        last edited by

        @octopilami I was able to fix it by adding this extra check:

        if (isset($dhcp['staticmap']) && is_array($dhcp['staticmap'])) {
        
        A S 2 Replies Last reply Reply Quote 2
        • A
          alkon_rojo @jazzl0ver
          last edited by

          @jazzl0ver said in Error on pfblockerng.inc:5310 pfBlockerNG-devel 3.2.0_5:

          @octopilami I was able to fix it by adding this extra check:

          if (isset($dhcp['staticmap']) && is_array($dhcp['staticmap'])) {
          

          Thanks!!!!!! it works and they didn't fix it yet in version pfblockerng-devel-3.2.0_6

          fireodoF A 2 Replies Last reply Reply Quote 0
          • fireodoF
            fireodo @alkon_rojo
            last edited by

            @alkon_rojo said in Error on pfblockerng.inc:5310 pfBlockerNG-devel 3.2.0_5:

            they didn't fix it yet in version pfblockerng-devel-3.2.0_6

            You should have ad @BBcan177 to your thread so he can get informed that there is an issue! 😏

            Kettop Mi4300YL CPU: i5-4300Y @ 1.60GHz RAM: 8GB Ethernet Ports: 4
            SSD: SanDisk pSSD-S2 16GB (ZFS) WiFi: WLE200NX
            pfsense 2.8.0 CE
            Packages: Apcupsd, Cron, Iftop, Iperf, LCDproc, Nmap, pfBlockerNG, RRD_Summary, Shellcmd, Snort, Speedtest, System_Patches.

            A 1 Reply Last reply Reply Quote 0
            • A
              alkon_rojo @fireodo
              last edited by alkon_rojo

              @fireodo said in Error on pfblockerng.inc:5310 pfBlockerNG-devel 3.2.0_5:

              @alkon_rojo said in Error on pfblockerng.inc:5310 pfBlockerNG-devel 3.2.0_5:

              they didn't fix it yet in version pfblockerng-devel-3.2.0_6

              You should have ad @BBcan177 to your thread so he can get informed that there is an issue! 😏

              Hi, Exist this two tickets already @BBcan177 :

              https://redmine.pfsense.org/issues/14554
              https://redmine.pfsense.org/issues/14230

              fireodoF 1 Reply Last reply Reply Quote 1
              • fireodoF
                fireodo @alkon_rojo
                last edited by

                @alkon_rojo said in Error on pfblockerng.inc:5310 pfBlockerNG-devel 3.2.0_5:

                pfBlockerNG-devel 3.2.0_5

                BTW: the actual version is 3.2.0_6

                Kettop Mi4300YL CPU: i5-4300Y @ 1.60GHz RAM: 8GB Ethernet Ports: 4
                SSD: SanDisk pSSD-S2 16GB (ZFS) WiFi: WLE200NX
                pfsense 2.8.0 CE
                Packages: Apcupsd, Cron, Iftop, Iperf, LCDproc, Nmap, pfBlockerNG, RRD_Summary, Shellcmd, Snort, Speedtest, System_Patches.

                1 Reply Last reply Reply Quote 0
                • A
                  alkon_rojo @alkon_rojo
                  last edited by

                  @fireodo said in Error on pfblockerng.inc:5310 pfBlockerNG-devel 3.2.0_5:

                  @alkon_rojo said in Error on pfblockerng.inc:5310 pfBlockerNG-devel 3.2.0_5:

                  pfBlockerNG-devel 3.2.0_5

                  BTW: the actual version is 3.2.0_6

                  Yeah, that's why I said -> The workaround is still need it in version pfblockerng-devel-3.2.0_6. I've been months without the service started, and it was because of this.

                  @alkon_rojo said in Error on pfblockerng.inc:5310 pfBlockerNG-devel 3.2.0_5:

                  @jazzl0ver said in Error on pfblockerng.inc:5310 pfBlockerNG-devel 3.2.0_5:

                  @octopilami I was able to fix it by adding this extra check:

                  if (isset($dhcp['staticmap']) && is_array($dhcp['staticmap'])) {
                  

                  Thanks!!!!!! it works and they didn't fix it yet in version pfblockerng-devel-3.2.0_6

                  A 1 Reply Last reply Reply Quote 1
                  • A
                    andrebrait @alkon_rojo
                    last edited by

                    @alkon_rojo I can send a PR for merging, but the actual merging is up to the repository maintainers.

                    A 1 Reply Last reply Reply Quote 0
                    • A
                      andrebrait @andrebrait
                      last edited by

                      Pull request sent: https://github.com/pfsense/FreeBSD-ports/pull/1305

                      1 Reply Last reply Reply Quote 1
                      • M
                        markdavis
                        last edited by markdavis

                        We have two 1537's set up and running pfsense+ 23.09.1 properly in HA mode. We call them pf1 and pf2 (with a carp of just "pf"). We decided it was time to explore using PFBlocker. Having never done this before, we decided to load the package (3.2.0_7) on our backup Netgate (pf2) first and see the options available. We don't have pfblocker fully configured yet, just looking around some. Since it is pf2, it is not actually being used in production (unless of course pf1 goes down).

                        Anyway, when we were clicking through the tabs, and we click on the Firewall> pfBlocker> Reports tab, this is what appears on the screen:

                        Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/pkg/pfblockerng/pfblockerng.inc:5310 Stack trace: #0 /usr/local/www/pfblockerng/pfblockerng_alerts.php(1726): pfb_collect_localhosts() #1 {main} thrown in /usr/local/pkg/pfblockerng/pfblockerng.inc on line 5310 PHP ERROR: Type: 1, File: /usr/local/pkg/pfblockerng/pfblockerng.inc, Line: 5310, Message: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/pkg/pfblockerng/pfblockerng.inc:5310 Stack trace: #0 /usr/local/www/pfblockerng/pfblockerng_alerts.php(1726): pfb_collect_localhosts() #1 {main} thrown

                        It also sends us a notification. Does this every time that tab is clicked on. This seems to match the same stuff on this thread. So I decided to post here as a "me too." Since we are not sure if there is some major problem that should stop us from trying to implement pfBlocker right now, or if we have some misconfiguration, or if the error can just be ignored, I opened a ticket with Netgate. Will report back any findings. UPDATE: Ooops, I don't think TAC Lite/pfSense+ comes with Email support. They will probably ignore the ticket I created :)

                        A 1 Reply Last reply Reply Quote 0
                        • A
                          andrebrait @markdavis
                          last edited by

                          @markdavis yeah, I've been working with BBcan177 in a larger patch set for pfBlockerNG, but I'm gonna suggest this gets merged and released first.

                          I've been a bit short on time to complete the full patch set.

                          M 1 Reply Last reply Reply Quote 1
                          • M
                            markdavis @andrebrait
                            last edited by

                            @andrebrait said in Error on pfblockerng.inc:5310 pfBlockerNG-devel 3.2.0_5:

                            @markdavis yeah, I've been working with BBcan177 in a larger patch set for pfBlockerNG, but I'm gonna suggest this gets merged and released first.

                            I've been a bit short on time to complete the full patch set.

                            Do you think it is safe for us to just ignore the issue with the "reports" tab and move forward with implementation? Kinda makes me nervous, though :)

                            A S 2 Replies Last reply Reply Quote 0
                            • A
                              andrebrait @markdavis
                              last edited by

                              @markdavis it should be. AFAICT the error is only for that tab. Well, there was another thing too, but nonetheless, it's for presentation on the screen. It doesn't affect the actual blocking or anything, IIRC.

                              M 1 Reply Last reply Reply Quote 1
                              • S
                                SteveITS Galactic Empire @markdavis
                                last edited by

                                @markdavis re HA be aware pfB sync doesn’t work unless you force reload on the primary.
                                https://forum.netgate.com/topic/179060/pfblockerng-sync-not-working/ (there’s a typo fix but it still doesn’t work)

                                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!

                                M 1 Reply Last reply Reply Quote 1
                                • M
                                  markdavis @andrebrait
                                  last edited by

                                  @andrebrait said in Error on pfblockerng.inc:5310 pfBlockerNG-devel 3.2.0_5:

                                  @markdavis it should be. AFAICT the error is only for that tab. Well, there was another thing too, but nonetheless, it's for presentation on the screen. It doesn't affect the actual blocking or anything, IIRC.

                                  Thanks. It is odd that nobody else reported what we are seeing with the reports tab. But it seems to be the same error as the OP, only in a different situation.

                                  M 1 Reply Last reply Reply Quote 0
                                  • M
                                    markdavis @SteveITS
                                    last edited by

                                    @SteveITS said in Error on pfblockerng.inc:5310 pfBlockerNG-devel 3.2.0_5:

                                    @markdavis re HA be aware pfB sync doesn’t work unless you force reload on the primary.
                                    https://forum.netgate.com/topic/179060/pfblockerng-sync-not-working/ (there’s a typo fix but it still doesn’t work)

                                    Wow, thanks.... yet more stuff to consider! I don't think I would have ever known that without you pointing that out.

                                    A 1 Reply Last reply Reply Quote 0
                                    • A
                                      andrebrait @markdavis
                                      last edited by

                                      @markdavis definitely not something for production, but if you want, you can test the pfBlockerNG-devel from this repo/branch:

                                      https://github.com/andrebrait/FreeBSD-ports/tree/pfblockerng-adblock

                                      In Python mode, it's also capable of parsing more types of AdBlock-style lists, including exclusions and whatnot. Should be stable, but probably needs more testing.

                                      1 Reply Last reply Reply Quote 0
                                      • M
                                        markdavis @markdavis
                                        last edited by

                                        @markdavis said in Error on pfblockerng.inc:5310 pfBlockerNG-devel 3.2.0_5:

                                        @andrebrait said in Error on pfblockerng.inc:5310 pfBlockerNG-devel 3.2.0_5:

                                        @markdavis it should be. AFAICT the error is only for that tab. Well, there was another thing too, but nonetheless, it's for presentation on the screen. It doesn't affect the actual blocking or anything, IIRC.

                                        Thanks. It is odd that nobody else reported what we are seeing with the reports tab. But it seems to be the same error as the OP, only in a different situation.

                                        We have a test pfsense install and the errors don't occur on that one. So we suspect it is because we have multiple WANs and/or HA, and/or complex interface configs, dhcp running, static mappings, and/or whatnot on our production servers (dual Netgate 1537's with 10Gb LAGG, VLANs, etc).

                                        Anyway, we installed the System_Patches package and created a patch based on other postings:
                                        https://redmine.pfsense.org/issues/14230 and applied it and it immediately solved the problems we had with the reports tab and also getting an error every hour (when pfblocker updates).

                                        Thanks to those who helped. Looks like @andrebrait is still working on getting it into official.

                                        A 1 Reply Last reply Reply Quote 1
                                        • A
                                          andrebrait @markdavis
                                          last edited by

                                          @markdavis yes, I am. We're currently reviewing the changes that will be merged and addressing some small concerns regarding logging.

                                          M 1 Reply Last reply Reply Quote 0
                                          • M
                                            michmoor LAYER 8 Rebel Alliance @andrebrait
                                            last edited by

                                            @andrebrait
                                            Ive taken a look at your pull requests so this is very interesting to see the development going on in the package.
                                            Regarding logging, not sure whats being addressed but is there a capability to have the logging rollover each day? Right now everything gets appended to a single logfile.

                                            Firewall: NetGate,Palo Alto-VM,Juniper SRX
                                            Routing: Juniper, Arista, Cisco
                                            Switching: Juniper, Arista, Cisco
                                            Wireless: Unifi, Aruba IAP
                                            JNCIP,CCNP Enterprise

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