Author Topic: [MAJOR BUG] Disc Quota Reported Wrong  (Read 11586 times)

0 Members and 2 Guests are viewing this topic.

[MAJOR BUG] Disc Quota Reported Wrong
« on: November 25, 2020, 02:23:12 PM »
Setting up a new large site for a client and discovered the the disc usage is being reported incorrectly. This has a major impact on how quotas are used. I believe the issue is with
/usr/local/cwpsrv/htdocs/resources/admin/modules/user_quota.php
and/or
/usr/local/cwpsrv/htdocs/resources/admin/modules/user_quota.php
Being encrypted, I can't offer a bug fix.  ::) I can determine the root cause, however: the quota for the user space is not being parsed and is returning the overall /home usage.

Code: [Select]
# du -bs /home
10290553724 /home
# du -bs /home/username
2855987724 /home/username

The result is that the user is over quota if , for example 5GB is set.



Re: [MAJOR BUG] Disc Quota Reported Wrong
« Reply #1 on: November 25, 2020, 04:05:07 PM »
« Last Edit: November 25, 2020, 04:08:20 PM by cynique »

Offline
*****
Re: [MAJOR BUG] Disc Quota Reported Wrong
« Reply #2 on: November 26, 2020, 01:52:22 PM »
Hi Remember that any file that belongs to this user affects the quota even if it is not inside / home / user / this can happen when a backup is made on the same server disk

Re: [MAJOR BUG] Disc Quota Reported Wrong
« Reply #3 on: November 26, 2020, 03:19:26 PM »
Hi,
I can assure you that the used space doesn't get updated, for some reason, even after removing a 6GB (bz2) file.
Hasn't updated overnight either - I had wishful thinking that a cron task might update that mysterious quota value.
Is there a means/method to force an update of the reported used space? Even if it means resetting the allocation and/or filesystem quota config; I don't care.

[Edit] Just deleted the uncompressed (yuk!) files for that user in /backup/daily (/backup is a separate partition) and it made not one bit of difference to the reported used space.
« Last Edit: November 26, 2020, 03:27:13 PM by cynique »

Re: [MAJOR BUG] Disc Quota Reported Wrong
« Reply #4 on: November 27, 2020, 12:06:23 AM »
Latest update (CWPpro version: 0.9.8.1024) didn't fix the issue
Code: [Select]
Filesystem              Size  Used Avail Use% Mounted on
devtmpfs                1.9G     0  1.9G   0% /dev
tmpfs                   1.9G     0  1.9G   0% /dev/shm
tmpfs                   1.9G   57M  1.8G   3% /run
tmpfs                   1.9G     0  1.9G   0% /sys/fs/cgroup
/dev/mapper/sys-root    9.8G  4.2G  5.3G  45% /
/dev/vda1               488M  231M  222M  52% /boot
/dev/mapper/sys-tmp     2.0G  3.5M  2.0G   1% /tmp
/dev/mapper/sys-var     5.8G  1.8G  3.9G  32% /var
/dev/mapper/sys-home     30G  2.6G   27G   9% /home
/dev/mapper/sys-backup  7.4G  2.5G  4.9G  34% /backup
tmpfs                   379M     0  379M   0% /run/user/0
Note that adding up all the used space, is close to what is reported for the user.  ::)

For completeness, here's the mount points with journaling set as recommended by CentOS
Code: [Select]
/dev/mapper/sys-root    /                       ext4    defaults        1 1
/dev/mapper/sys-backup  /backup                 ext2    defaults        1 2
UUID=681c0990-91f3-4fdf-9d1b-2b470c111111 /boot                   ext4    defaults        1 2
# /dev/mapper/sys-home /home ext4 rw,seclabel,relatime,quota,usrquota,grpquota,data=ordered 0 0
/dev/mapper/sys-home /home ext4 rw,seclabel,relatime,usrjquota=aquota.user,grpjquota=aquota.grp,jqfmt=vfsv0 0 0
/dev/mapper/sys-tmp     /tmp                    ext2    defaults        1 2
/dev/mapper/sys-var     /var                    ext4    defaults        1 2
/dev/mapper/sys-swap    swap                    swap    defaults        0 0
« Last Edit: November 27, 2020, 12:23:13 AM by cynique »

Re: [MAJOR BUG] Disc Quota Reported Wrong
« Reply #5 on: November 27, 2020, 03:21:52 PM »
Now that 0.9.8.1025 has been released to bring the end user File Manager back, I noticed this at the bottom..
Quote
Usage: 10204.75 MB / 12000.00 MB
Nope.

[Edit]
I ran
Code: [Select]
quotacheck -cugv /home
to recreate the quotas (done this a few times previously) and it now appears to be reporting correctly.
Interestingly, the user File Manager now doesn't have any disc usage status at the bottom.  ???
[Edit2] Some time later the status appears back. :-/ Shows correct usage.
All very strange!
« Last Edit: November 27, 2020, 03:53:37 PM by cynique »

Re: [MAJOR BUG] Disc Quota Reported Wrong
« Reply #6 on: December 01, 2020, 12:06:03 AM »
This is still a problem!

Newly created server that I'm migrating a user over from another server. Temporarily, the quota for the user is exceeded when a zip file is descompressed.
Removing the zipfile doesn't return the user to under quota.


How does one force a quota update?

Offline
*****
Re: [MAJOR BUG] Disc Quota Reported Wrong
« Reply #7 on: December 01, 2020, 08:50:30 AM »
Hello

With which migration module does this happen?

Re: [MAJOR BUG] Disc Quota Reported Wrong
« Reply #8 on: December 01, 2020, 02:25:12 PM »
Hello

With which migration module does this happen?
None. I was just explaining where a large data set suddenly arrived from: a 5GB zip from another server, which was then extracted.
Nothing to do with migration modules, much to do with how CWP handles quotas. To reiterate..
How does one force a quota update?

Try it for yourself.
1. Give a (test) user a disc quota of 100MB
2. Copy/upload files to the user's home, that is at least 100MB
3. Check what quota says - should say over quota
4. Delete the files from user
5. Check what quota says.
« Last Edit: December 01, 2020, 02:28:50 PM by cynique »

Re: [MAJOR BUG] Disc Quota Reported Wrong
« Reply #9 on: December 07, 2020, 12:35:49 PM »
This is still an issue.
Has anyone else experienced this, or even tried to see if the used space gets updated properly once quota has been exceeded?

Offline
***
Re: [MAJOR BUG] Disc Quota Reported Wrong
« Reply #10 on: December 07, 2020, 01:51:17 PM »
Best thing to do is set up a new server and try to reproduce.  No one is going to test on a live server.  That would be asking for big trouble.  Thats pixelpadres two cents.
Listen to everything Pixelpadre says.

Re: [MAJOR BUG] Disc Quota Reported Wrong
« Reply #11 on: December 07, 2020, 04:56:15 PM »
Best thing to do is set up a new server and try to reproduce.  No one is going to test on a live server.  That would be asking for big trouble.  Thats pixelpadres two cents.
All one needs to do is create a test account, with a small quota, then fill that quota. Remove some files and is the account still over quota. Delete the test account, when done. No lasting damage, as this doesn't affect other accounts - I've already checked.

Offline
*
Re: [MAJOR BUG] Disc Quota Reported Wrong
« Reply #12 on: December 07, 2020, 08:36:25 PM »
Use this
https://github.com/betterapp/cwp-users-quota

I am really not satisfied with CWP disk usage stats - they are simply off.

Re: [MAJOR BUG] Disc Quota Reported Wrong
« Reply #13 on: December 07, 2020, 10:12:34 PM »
Use this
https://github.com/betterapp/cwp-users-quota

I am really not satisfied with CWP disk usage stats - they are simply off.
You appear to be missing the point: CWP has user quotas built-in which doesn't work correctly, with adverse affects.
 

Offline
*
Re: [MAJOR BUG] Disc Quota Reported Wrong
« Reply #14 on: December 08, 2020, 01:40:12 PM »
Yes, I know that quotas are not working correctly, that's a reason why I looked for alternative :)
But, of course, even with this module, problem is present in user panel, where my clients don't see real disk usage...but hoping for fix from CWP side soon ;)