Page 1 of 1

Quotas disappeared

Posted: Sun Oct 29, 2017 1:11 am
by maphew
This evening I edited one of the existing quotas which applied to an IP range, to change the throttling rates. After I saved and applied changes all of the range rules disappeared, leaving only 2 ALL rules. I then rebooted the router, and now there are no quotas at all. This has happened 2 or 3 times before, several months ago.

Based on viewtopic.php?f=12&t=5056 I had a look at

Code: Select all

/overlay/upper/usr/data/quotas
via ssh, and all of the old rules are still present.

Code: Select all

root@gateway:/overlay/upper/usr/data/quotas# ls
quota_192.168.1.121-192.168.1.140_combined
quota_192.168.1.141-192.168.1.160_combined
quota_192.168.1.161-192.168.1.180_combined
quota_192.168.1.99-192.168.1.120_combined
quota_ALL_OTHERS_INDIVIDUAL_A_combined
quota_ALL_combined
And don't appear (to me) to be malformed:

Code: Select all

root@gateway:/overlay/upper/usr/data/quotas# cat *
1509248551
0.0.0.0         4291379352
1509248551
0.0.0.0         14502371026
1509248551
0.0.0.0         14214741734
1509248551
0.0.0.0         13080820529
1509248551
192.168.1.3     304
192.168.1.50    0
192.168.1.202   21296
192.168.1.203   0
192.168.1.206   0
192.168.1.219   0
192.168.1.237   0
192.168.1.242   0
192.168.1.249   0
1509252430
0.0.0.0         191973669519
The quota management page now:
Image

Device Name:gateway
Gargoyle Version:1.9.2
Model:TP-Link Archer C7 v2
Device Configuration:Gateway
Memory Usage:42.4MB / 123.1MB (34.4%)
Connections:350/4096
CPU Load Averages:0.08 / 0.08 / 0.08 (1/5/15 minutes)

Re: Quotas disappeared

Posted: Sun Oct 29, 2017 1:38 am
by Lantis
Those are the quota statuses, not the configuration for the quota itself.

This commonly happens with multiple tabs/windows open.
You unfortunately can’t recover them at this point.

Re: Quotas disappeared

Posted: Sun Oct 29, 2017 6:47 pm
by maphew
Lantis wrote:Those are the quota statuses, not the configuration for the quota itself.

This commonly happens with multiple tabs/windows open.
You unfortunately can’t recover them at this point.
Urgh. Ok, thanks. That's bad news about multiple tabs. When working out quota adjustments I usually have a 2nd open to look at the usage distribution, and a 3rd for ip assignments. (I have a hard time remembering which users/machines are in which ip range.)

Re: Quotas disappeared

Posted: Sun Oct 29, 2017 10:08 pm
by Lantis
Definitely understand where you’re coming from.
Unfortunately it’s a single instance interface

Re: Quotas disappeared

Posted: Wed Nov 01, 2017 11:20 pm
by maphew
I've got things back to where they were before, and learned that the location of the quota rules appears to be `/etc/config/firewall`. Edit that file and add something like the below is enough to have the rule show up in the web interface (`http://gateway.example.net/quotas.sh`)
I don't know if that's safe, so for for good measure after editing the file and I load the web page and hit [save changes].

Code: Select all

config quota 'quota_5'
        option combined_limit '12884901888'
        option exceeded_up_speed '64'
        option exceeded_down_speed '128'
        option reset_interval 'week'
        option ip '192.168.1.121-192.168.1.139'
        option id '192.168.1.121-192.168.1.139'
        option enabled '1'
I'm curious about the `option id` line. Where is that used/re-used? Could I change that to something meaningful like `option id 'Kids: .121 to .139'`?

Re: Quotas disappeared

Posted: Wed Nov 01, 2017 11:25 pm
by Lantis
No, please don’t edit that option.
It is used internally for loading iptables modules.

Re: Quotas disappeared

Posted: Wed Oct 09, 2019 5:22 pm
by maphew
Through testing and extended waiting to see if something unexpected broke I figured out that changing `config quota 'quota_3'` to something like `config quota 'the_kids'` works.

This helps me when I edit the file manually through ssh but it's not exposed anywhere in the web UI. Is that something that can be changed?

Re: Quotas disappeared

Posted: Mon Jan 13, 2020 4:45 pm
by pkkrusty
Lantis wrote:Those are the quota statuses, not the configuration for the quota itself.

This commonly happens with multiple tabs/windows open.
You unfortunately can’t recover them at this point.
I've had this happen a few times also, and had to rebuild the quota list. Can you give any more specifics on behavior to avoid? I only had one window open, but was impatient waiting for a DHCP assighment to save, and edited the URL to go straight to the quota page to enter that, and noticed that 70% were missing. Do I need to wait the 45 seconds for the tables to get fully re-written before I navigate somewhere else?

Re: Quotas disappeared

Posted: Mon Jan 13, 2020 6:13 pm
by Lantis
Yes, absolutely.
Many functions cause the firewall to restart and reload configuration. If you start another function midway through this, you're asking for trouble.