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

24.03-DEVELOPMENT - PHP Fatal error: Uncaught ValueError: range(): Argument #3

pfBlockerNG
8
29
3.3k
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.
  • R
    rtorres Rebel Alliance
    last edited by rtorres Dec 30, 2023, 2:25 AM Dec 30, 2023, 2:17 AM

    Hi there!

    Not too sure if I am suppose to post bugs here or on another page - please move if needed.

    I am currently on 24.03 (24.03.a.20231227.0600) with pfBlockerNG-devel 3.2.0_7 and had an issue when editing the DNSBL Groups lists on pfBlockerNG.

    Didn't have this issue in the previous Dev version. It's not critical as the lists I need are active but wanted to point it out to the group :)

    [29-Dec-2023 17:58:41 America/Los_Angeles] PHP Fatal error:  Uncaught ValueError: range(): Argument #3 ($step) must be greater than 0 for increasing ranges in /usr/local/www/pfblockerng/pfblockerng_category_edit.php:391
    Stack trace:
    #0 /usr/local/www/pfblockerng/pfblockerng_category_edit.php(391): range(1, 17, -1)
    #1 {main}
      thrown in /usr/local/www/pfblockerng/pfblockerng_category_edit.php on line 391
    

    🔒 Log in to view

    🔒 Log in to view

    Fatal error: Uncaught ValueError: range(): Argument #3 ($step) must be greater than 0 for increasing ranges in /usr/local/www/pfblockerng/pfblockerng_category_edit.php:391 Stack trace: #0 /usr/local/www/pfblockerng/pfblockerng_category_edit.php(391): range(1, 17, -1) #1 {main} thrown in /usr/local/www/pfblockerng/pfblockerng_category_edit.php on line 391 PHP ERROR: Type: 1, File: /usr/local/www/pfblockerng/pfblockerng_category_edit.php, Line: 391, Message: Uncaught ValueError: range(): Argument #3 ($step) must be greater than 0 for increasing ranges in /usr/local/www/pfblockerng/pfblockerng_category_edit.php:391 Stack trace: #0 /usr/local/www/pfblockerng/pfblockerng_category_edit.php(391): range(1, 17, -1) #1 {main} thrown
    
    N 1 Reply Last reply Jan 25, 2024, 3:37 AM Reply Quote 0
    • N
      N0m0fud @rtorres
      last edited by Jan 25, 2024, 3:37 AM

      @rtorres Seeing the same on my device

      R 1 Reply Last reply Jan 25, 2024, 6:41 AM Reply Quote 0
      • R
        rtorres Rebel Alliance @N0m0fud
        last edited by rtorres Jan 25, 2024, 6:42 AM Jan 25, 2024, 6:41 AM

        @N0m0fud Seems like even after a couple of dev updates, the issue is still happening. I noticed that the % of ads blocked was going lower by the hour and when I went to go reload/update it would freeze my network up. I would get a DNS Probe Possible error when trying to go to websites. I would have to reboot to get my network up and going again.

        When updating feeds I'd get an Invalid File name (type) and this is where my network would kick the can.

        I downgraded back to the 23.09.1 build. This didn't happen in older pfSense Plus dev builds :\

        1 Reply Last reply Reply Quote 0
        • C
          cwmoriarty
          last edited by Feb 26, 2024, 4:15 PM

          I too am able to reproduce this, and it continues with 24.03.a.20240226.0600 and pfBlockerNG-devel 3.2.0_8

          1 Reply Last reply Reply Quote 0
          • N
            N0m0fud
            last edited by Feb 26, 2024, 6:10 PM

            Any progress on resolving this issue? Seems like a major bug. My instance keeps throwing errors daily and the ad blocking basically isn't working.

            1 Reply Last reply Reply Quote 0
            • N
              N0m0fud
              last edited by Feb 26, 2024, 6:13 PM

              Here is the error I get multiple times a day:

              PHP ERROR: Type: 1, File: /usr/local/www/pkg_mgr_install.php, Line: 103, Message: Uncaught TypeError: be_active_name(): Argument #1 ($handle) must be of type LibbeHandle, false given in /usr/local/www/pkg_mgr_install.php:103
              Stack trace:
              #0 /usr/local/www/pkg_mgr_install.php(103): be_active_name(false)
              #1 {main}
              thrown @ 2024-02-26 12:11:33

              1 Reply Last reply Reply Quote 0
              • N
                N0m0fud
                last edited by Feb 26, 2024, 6:28 PM

                And:

                PHP ERROR: Type: 1, File: /usr/local/www/pfblockerng/pfblockerng_category_edit.php, Line: 391, Message: Uncaught ValueError: range(): Argument #3 ($step) must be greater than 0 for increasing ranges in /usr/local/www/pfblockerng/pfblockerng_category_edit.php:391
                Stack trace:
                #0 /usr/local/www/pfblockerng/pfblockerng_category_edit.php(391): range(1, 17, -1)
                #1 {main}
                thrown

                This is on the latest build

                1 Reply Last reply Reply Quote 0
                • N
                  N0m0fud
                  last edited by Feb 26, 2024, 6:31 PM

                  Here is the actual line of code that is throwing the error:

                  $options_suppression_cidr = [ 'Disabled' => 'Disabled' ] + array_combine(range(1, 17, -1), range(1, 17, -1));

                  1 Reply Last reply Reply Quote 0
                  • N
                    N0m0fud
                    last edited by Feb 26, 2024, 6:44 PM

                    And this line:

                    $list = array('Disabled' => 'Disabled') + array_combine(range(1, 17, -1), range(1, 17, -1));
                    

                    Changing both instances to:

                    $list = array('Disabled' => 'Disabled') + array_combine(range(1, 17, 1), range(1, 17, 1));
                    

                    Fixed the issue and allows editing, etc,

                    D P 2 Replies Last reply Apr 10, 2024, 5:20 AM Reply Quote 2
                    • N
                      N0m0fud
                      last edited by Feb 26, 2024, 6:47 PM

                      And the DNSBL block stats are working as expected!!!

                      1 Reply Last reply Reply Quote 1
                      • D
                        DefenderLLC @N0m0fud
                        last edited by Apr 10, 2024, 5:20 AM

                        @N0m0fud Thanks. Unfortunately I'm running into the same problem with the newest 24.03 build and this fix did not work for me - even after a fresh pfBlockerNG or pfBlockerNG-dev install with no previous saves settings. The minute I try to add an IP category I get those same two errors - both on lines 391.

                        1 Reply Last reply Reply Quote 0
                        • P
                          pst @N0m0fud
                          last edited by Apr 21, 2024, 11:56 AM

                          @N0m0fud I can confirm that the problem still exists in "24.03-RC (amd64) built on Tue Apr 16 2:05:00 CEST 2024" with pfBlockerNG-devel 3.2.0_9

                          but the suggested fix on lines 391 and 1517 still works fine.

                          1 Reply Last reply Reply Quote 0
                          • P pst referenced this topic on Apr 23, 2024, 10:21 AM
                          • B
                            Bob.Dig LAYER 8
                            last edited by Bob.Dig Apr 24, 2024, 7:09 AM Apr 24, 2024, 7:05 AM

                            Problem still exists after the final Plus release. Is someone capable to create or show a system patch?

                            P 1 Reply Last reply Apr 24, 2024, 7:48 AM Reply Quote 0
                            • P
                              pst @Bob.Dig
                              last edited by pst Apr 24, 2024, 9:22 AM Apr 24, 2024, 7:48 AM

                              @Bob-Dig In System Patches, add a new patch with these fields

                              Description:

                              pfblockerng_category_edit.php
                              

                              Patch content:

                              --- pfblockerng_category_edit.php.orig  2024-04-24 09:39:00.112790000 +0200
                              +++ pfblockerng_category_edit.php       2024-04-21 13:48:03.625881000 +0200
                              @@ -388,7 +388,7 @@
                                                                      'disabled'      => 'Null Blocking (no logging)' ];
                               }
                              
                              -$options_suppression_cidr      = [ 'Disabled' => 'Disabled' ] + array_combine(range(1, 17, -1), range(1, 17, -1));
                              +$options_suppression_cidr      = [ 'Disabled' => 'Disabled' ] + array_combine(range(1, 17, 1), range(1, 17, 1));
                              
                               $interfaces_list               = get_configured_interface_list_by_realif();
                               $src_interfaces                        = array('lo0' => 'Localhost');
                              @@ -1514,7 +1514,7 @@
                              
                               if ($gtype == 'ipv4') {
                              
                              -       $list = array('Disabled' => 'Disabled') + array_combine(range(1, 17, -1), range(1, 17, -1));
                              +       $list = array('Disabled' => 'Disabled') + array_combine(range(1, 17, 1), range(1, 17, 1));
                                      $section->addInput(new Form_Select(
                                              'suppression_cidr',
                                              'Suppression CIDR Limit',
                              

                              Path Strip Count:

                              0
                              

                              Base Directory:

                              /usr/local/www/pfblockerng/
                              
                              B 1 Reply Last reply Apr 24, 2024, 7:53 AM Reply Quote 3
                              • B
                                Bob.Dig LAYER 8 @pst
                                last edited by Apr 24, 2024, 7:53 AM

                                @pst At first sight, this seems to work. Thank you so much!

                                S 1 Reply Last reply Apr 24, 2024, 9:15 AM Reply Quote 1
                                • S
                                  SwissSteph @Bob.Dig
                                  last edited by Apr 24, 2024, 9:15 AM

                                  Hello everyone,

                                  I have the same problem. Just a question for the patch creation, is it necessary to copy ALL the text or only a part ... because I have the same problem if I put the totality of the text above.

                                  Help!

                                  I started with two "no-name" pfsense, one for use at home and the other as a backup in case of problems (which can happen when you're new to pfsense).
                                  ... And now I'm living with a Netgate 8200
                                  ... And sorry for my bad English...

                                  P 1 Reply Last reply Apr 24, 2024, 9:23 AM Reply Quote 0
                                  • P
                                    pst @SwissSteph
                                    last edited by Apr 24, 2024, 9:23 AM

                                    @SwissSteph I have updated my post, is it clearer now?

                                    S B 2 Replies Last reply Apr 24, 2024, 9:28 AM Reply Quote 1
                                    • S
                                      SwissSteph @pst
                                      last edited by SwissSteph Apr 24, 2024, 9:44 AM Apr 24, 2024, 9:28 AM

                                      @pst

                                      Thank you for your reply.

                                      I was right... BUT I have a big spit next if I want to edit

                                      🔒 Log in to view

                                      With or without the patch I get the same error

                                      [24-Apr-2024 11:22:58 Europe/Zurich] PHP Fatal error: Uncaught ValueError: range(): Argument #3 ($step) must be greater than 0 for increasing ranges in /usr/local/www/pfblockerng/pfblockerng_category_edit.php:391
                                      Stack trace:
                                      #0 /usr/local/www/pfblockerng/pfblockerng_category_edit.php(391): range()
                                      #1 {main}
                                      thrown in /usr/local/www/pfblockerng/pfblockerng_category_edit.php on line 391
                                      [24-Apr-2024 11:25:46 Europe/Zurich] PHP Fatal error: Uncaught ValueError: range(): Argument #3 ($step) must be greater than 0 for increasing ranges in /usr/local/www/pfblockerng/pfblockerng_category_edit.php:391
                                      Stack trace:
                                      #0 /usr/local/www/pfblockerng/pfblockerng_category_edit.php(391): range()
                                      #1 {main}
                                      thrown in /usr/local/www/pfblockerng/pfblockerng_category_edit.php on line 391
                                      [24-Apr-2024 11:28:32 Europe/Zurich] PHP Fatal error: Uncaught ValueError: range(): Argument #3 ($step) must be greater than 0 for increasing ranges in /usr/local/www/pfblockerng/pfblockerng_category_edit.php:391
                                      Stack trace:
                                      #0 /usr/local/www/pfblockerng/pfblockerng_category_edit.php(391): range()
                                      #1 {main}
                                      thrown in /usr/local/www/pfblockerng/pfblockerng_category_edit.php on line 391

                                      EDIT

                                      I finally followed the very clear information from "graphene" in this post

                                      https://forum.netgate.com/topic/187604/24-03-r-20240416-0005-unable-to-add-an-ipv4-entry-to-the-pfblockerng-configuration/6

                                      and manually edited the two lines by removing the "-" before the "1".

                                      It's all good, no more crashes when editing a line.

                                      I started with two "no-name" pfsense, one for use at home and the other as a backup in case of problems (which can happen when you're new to pfsense).
                                      ... And now I'm living with a Netgate 8200
                                      ... And sorry for my bad English...

                                      P 1 Reply Last reply Apr 24, 2024, 9:48 AM Reply Quote 1
                                      • B
                                        Bob.Dig LAYER 8 @pst
                                        last edited by Apr 24, 2024, 9:45 AM

                                        @pst said in 24.03-DEVELOPMENT - PHP Fatal error: Uncaught ValueError: range(): Argument #3:

                                        I have updated my post

                                        That looks perfect.

                                        1 Reply Last reply Reply Quote 0
                                        • P
                                          pst @SwissSteph
                                          last edited by pst Apr 24, 2024, 9:49 AM Apr 24, 2024, 9:48 AM

                                          @SwissSteph said in 24.03-DEVELOPMENT - PHP Fatal error: Uncaught ValueError: range(): Argument #3:

                                          With or without the patch I get the same error

                                          Did you press Apply after adding the patch in System Patches? It doesn't get applied just by adding it. The patch is the same code as you manually edited so it should have worked, if applied. The system patch works for me, and others.

                                          S 1 Reply Last reply Apr 24, 2024, 9:52 AM Reply Quote 0
                                          • First post
                                            Last post
                                          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.