Control Web Panel

WebPanel => CentOS-WebPanel Bugs => Topic started by: cinique on November 25, 2020, 02:23:12 PM

Title: [MAJOR BUG] Disc Quota Reported Wrong
Post by: cinique 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.


Title: Re: [MAJOR BUG] Disc Quota Reported Wrong
Post by: cinique on November 25, 2020, 04:05:07 PM
(https://imgur.com/a/pcX6DLf)
https://imgur.com/a/pcX6DLf
Title: Re: [MAJOR BUG] Disc Quota Reported Wrong
Post by: josemnunez 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
Title: Re: [MAJOR BUG] Disc Quota Reported Wrong
Post by: cinique 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.
Title: Re: [MAJOR BUG] Disc Quota Reported Wrong
Post by: cinique 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
Title: Re: [MAJOR BUG] Disc Quota Reported Wrong
Post by: cinique 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!
Title: Re: [MAJOR BUG] Disc Quota Reported Wrong
Post by: cinique 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?
Title: Re: [MAJOR BUG] Disc Quota Reported Wrong
Post by: josemnunez on December 01, 2020, 08:50:30 AM
Hello

With which migration module does this happen?
Title: Re: [MAJOR BUG] Disc Quota Reported Wrong
Post by: cinique 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.
Title: Re: [MAJOR BUG] Disc Quota Reported Wrong
Post by: cinique 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?
Title: Re: [MAJOR BUG] Disc Quota Reported Wrong
Post by: Namaste 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.
Title: Re: [MAJOR BUG] Disc Quota Reported Wrong
Post by: cinique 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.
Title: Re: [MAJOR BUG] Disc Quota Reported Wrong
Post by: dp41646 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.
Title: Re: [MAJOR BUG] Disc Quota Reported Wrong
Post by: cinique 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.
 
Title: Re: [MAJOR BUG] Disc Quota Reported Wrong
Post by: dp41646 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 ;)
Title: Re: [MAJOR BUG] Disc Quota Reported Wrong
Post by: cinique on December 16, 2020, 11:52:54 PM
Leaving this here as a possible solution:

Solved with this command:
Code: [Select]
/scripts/cwp_api account update_diskquota_all

[Edit]
Nope. Still doesn't update the space used in the List Accounts page. (Disk Usage)  >:(
Title: Re: [MAJOR BUG] Disc Quota Reported Wrong
Post by: russromei on July 09, 2022, 09:08:19 AM
so this has never been resolved. CWP still wasting evryones time in 2022
shameful
Title: Re: [MAJOR BUG] Disc Quota Reported Wrong
Post by: studio4host on July 09, 2022, 02:24:16 PM
if quota is not working then you don't have it properly installed, depending on the FS type you need to install and configure quota
Title: Re: [MAJOR BUG] Disc Quota Reported Wrong
Post by: mcyahoo on July 09, 2022, 11:55:01 PM
temporary solution i did:
backup : web file + database (don't use backup feature in root, but manual backup)
remove the hosting package
recreate hosting package
restore website data
done
Title: Re: [MAJOR BUG] Disc Quota Reported Wrong
Post by: PakPos on July 15, 2022, 01:58:29 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
hello
can you check https://forum.centos-webpanel.com/index.php?topic=12171.0