Project

General

Profile

Bug #10660

Bug firewall_shaper.php

Added by Vincent Jansen about 2 months ago. Updated about 1 month ago.

Status:
Feedback
Priority:
Low
Category:
Traffic Shaper (ALTQ)
Target version:
-
Start date:
06/12/2020
Due date:
% Done:

100%

Estimated time:
Affected Version:
2.4.5-p1
Affected Architecture:

Description

Created a shaper on interface, did not apply, set bandwidth to "100%", clicked apply
Cannot open firewall_shaper.php anymore, just shows error below on fullscreen.
Revert shaper configuration via Backup & Restore solved it.

Cause seemed to be the percentage on the shaper. Perhaps it doesn't support it.
Config below.

Error:

Fatal error: Uncaught Error: Call to undefined method altq_root_queue::GetParent() in /etc/inc/shaper.inc:518 Stack trace: #0 /etc/inc/shaper.inc(1302): get_queue_bandwidth(Object(altq_root_queue)) #1 /etc/inc/shaper.inc(1516): priq_queue->CheckBandwidth(NULL, NULL) #2 /etc/inc/shaper.inc(855): priq_queue->validate_input(Array, NULL) #3 /etc/inc/shaper.inc(5052): altq_root_queue->add_queue('opt1', Array, Array, NULL) #4 /usr/local/www/firewall_shaper.php(46): read_altq_config() #5 {main} thrown in /etc/inc/shaper.inc on line 518 PHP ERROR: Type: 1, File: /etc/inc/shaper.inc, Line: 518, Message: Uncaught Error: Call to undefined method altq_root_queue::GetParent() in /etc/inc/shaper.inc:518 Stack trace: #0 /etc/inc/shaper.inc(1302): get_queue_bandwidth(Object(altq_root_queue)) #1 /etc/inc/shaper.inc(1516): priq_queue->CheckBandwidth(NULL, NULL) #2 /etc/inc/shaper.inc(855): priq_queue->validate_input(Array, NULL) #3 /etc/inc/shaper.inc(5052): altq_root_queue->add_queue('opt1', Array, Array, NULL) #4 /usr/local/www/firewall_shaper.php(46): read_altq_config() #5 {main} thrown

Shaper config:

<shaper>
    <queue>
        <interface>wan</interface>
        <name>wan</name>
        <scheduler>PRIQ</scheduler>
        <bandwidth>9</bandwidth>
        <bandwidthtype>Mb</bandwidthtype>
        <enabled>on</enabled>
        <queue>
            <name>qACK</name>
            <interface>wan</interface>
            <priority>15</priority>
            <enabled>on</enabled>
            <ecn>yes</ecn>
        </queue>
        <queue>
            <name>qDefault</name>
            <interface>wan</interface>
            <priority>0</priority>
            <enabled>on</enabled>
            <default>default</default>
            <ecn>yes</ecn>
            <codel>yes</codel>
        </queue>
    </queue>
    <queue>
        <interface>lan</interface>
        <name>lan</name>
        <scheduler>PRIQ</scheduler>
        <bandwidth>90</bandwidth>
        <bandwidthtype>Mb</bandwidthtype>
        <enabled>on</enabled>
        <queue>
            <name>qLink</name>
            <interface>lan</interface>
            <qlimit>500</qlimit>
            <priority>0</priority>
            <enabled>on</enabled>
            <default>default</default>
            <ecn>yes</ecn>
            <codel>yes</codel>
        </queue>
        <queue>
            <name>qACK</name>
            <interface>lan</interface>
            <priority>15</priority>
            <enabled>on</enabled>
            <ecn>yes</ecn>
        </queue>
    </queue>
    <queue>
        <name>opt1</name>
        <interface>opt1</interface>
        <scheduler>PRIQ</scheduler>
        <queue>
            <name>qDefault</name>
            <interface>opt1</interface>
            <qlimit></qlimit>
            <priority>0</priority>
            <description></description>
            <enabled>on</enabled>
            <default>default</default>
            <codel>yes</codel>
            <ecn>yes</ecn>
        </queue>
        <queue>
            <name>qACK</name>
            <interface>opt1</interface>
            <priority>15</priority>
            <enabled>on</enabled>
            <ecn>yes</ecn>
        </queue>
        <bandwidth>100</bandwidth>
        <bandwidthtype>%</bandwidthtype>
        <enabled>on</enabled>
    </queue>
    <queue>
        <name>opt2</name>
        <interface>opt2</interface>
        <scheduler>PRIQ</scheduler>
        <queue>
            <name>qDefault</name>
            <interface>opt2</interface>
            <qlimit></qlimit>
            <priority>0</priority>
            <description></description>
            <enabled>on</enabled>
            <default>default</default>
            <codel>yes</codel>
            <ecn>yes</ecn>
        </queue>
        <queue>
            <name>qACK</name>
            <interface>opt2</interface>
            <qlimit></qlimit>
            <priority>15</priority>
            <description></description>
            <enabled>on</enabled>
            <ecn>yes</ecn>
        </queue>
    </queue>
</shaper>

Associated revisions

Revision 734848b6 (diff)
Added by Viktor Gurov about 2 months ago

Shaper root queue percent bw fix. Issue #10660

History

#1 Updated by Vincent Jansen about 2 months ago

% on opt1 was issue. Using mbps fixed it.

#2 Updated by Vincent Jansen about 2 months ago

2.4.5-p1

#3 Updated by Viktor Gurov about 2 months ago

  • Category set to Traffic Shaper (ALTQ)
  • Affected Version set to 2.4.5-p1

#4 Updated by Viktor Gurov about 2 months ago

Vincent Jansen wrote:

2.4.5-p1

What is your interface?
I got the same issue with vtnet interface

This may be another issue, pf.conf(5):

bandwidth

The maximum bitrate for all queues on an interface may be specified
using the bandwidth keyword. The value can be specified as an ab-
solute value or as a percentage of the interface bandwidth. When
using an absolute value, the suffixes b, Kb, Mb, and Gb are used to
represent bits, kilobits, megabits, and gigabits per second, re-
spectively. The value must not exceed the interface bandwidth. If
bandwidth is not specified, the interface bandwidth is used (but
take note that some interfaces do not know their bandwidth
, or can
adapt their bandwidth rates).

#5 Updated by Vincent Jansen about 2 months ago

Opt1 = openvpn

#6 Updated by Jim Pingle about 2 months ago

  • Priority changed from Normal to Low

That is most likely because, as Viktor noted, you tried to use % bandwidth on an interface that can't properly identify its own line rate so it cannot calculate a percentage.

The code could maybe be smarter about trying to identify that situation and warn about it when configuring in the GUI, and also before crafting % rules. Someone could pick % rules on a valid interface and then reassign interfaces to something invalid, so the backend needs to be smart about checking before loading the shaper config. If it is invalid at run-time the entire shaper config would need to be tossed out.

#7 Updated by Vincent Jansen about 2 months ago

I'd at least expected the UI to load instead of just showing an full-screen error and forcing me to revert using backing & restore.
A normal user can't be confronted with a broken UI after putting UI-allowed stuff in fields and click save.

#8 Updated by Viktor Gurov about 2 months ago

Jim Pingle wrote:

That is most likely because, as Viktor noted, you tried to use % bandwidth on an interface that can't properly identify its own line rate so it cannot calculate a percentage.

I think this should be another issue

class 'altq_root_queue' has no method 'GetParent()',
this PR adds check:
https://github.com/pfsense/pfsense/pull/4358

#9 Updated by Viktor Gurov about 2 months ago

another error after applying PR:

`There were error(s) loading the rules: pfctl: interface vtnet2 bandwidth limited to 4294967295 bps because selected 
scheduler is 32-bit limited - The line in question reads [0]: @ 2020-06-17 16:08:25`

need a way to check that interface can properly identify its own line rate

#10 Updated by Renato Botelho about 1 month ago

  • Status changed from New to Feedback
  • Assignee set to Renato Botelho
  • % Done changed from 0 to 100

PR has been merged. Thanks!

Also available in: Atom PDF