-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: quota S3 storage wrong WITH Q&D FIX! #34422
Comments
I do apologize, I see now that I opened a a ticket on the first of august about my previous trouble: What to do, merge? I do would like to respond to my suspicion about opcache. That does seem to delay changing the quota. But now I have tested by turning off opcache and altering the quota. no effect. Also the problem is now with an other account, not the first account, so there does not seem to be a link with the primary/first (admin) account. The only odd thing is that, again, the wrong quota value that gets stuc is that 2 Gb value.. |
Since this has been bugging me on & off for over half a year now I have spent the better part of the day figuring this out.. and I have (admitted Quick and Dirty) fixed the problem: in lib/private/Files/Storage/Wrapper/Quota.php: added: use OC_Util; (below the other use....) in public function __construct:
Somewhere (I did not find where...) the parameter[quota] gets wrongly set to 2GB.. I now simply re-read that quota.. It's not pretty but at least my headache about the subject is gone now. |
I'll re-open it, hoping that a better and more permanent fix will be implemented |
Oh a small addendum; Now that I have been digging in the code, in the earlier mentioned function: The problem of changed quota's not being seen for a while is because in the |
Thanks for investigating @mrAceT That the issue is coming from the cache is pretty weird since the cache should be cleared every 5 min. What cache engine are you using? Redis/memcached/apcu? Something that I can see is that if we fail to calculate quota for a folder we instead get the quota for the root and save that as quota for a sub folders. This is probably an issue |
If memory serves me well,, I do think that the wrong/old setting is indeed gone after say 5 minutes.
Is 'opcache' an answer to your question?
Strange, I purposely set all quota's that might have influence to anything but 2Gb.. so there wasn't any user in the system with a 2Gb quota.. but still that quota was 2Gb! |
AD: last night I upgraded my Nextcloud to version 24.0.6 As expected the "quota problem" described above returned. I implemented the fix I described above (#34422 (comment)) and after a few minutes the correct quotas were back again (that cashing thing..?). So my "Q&D fix" for this quota problem also works in version 24.0.6 |
I've tried to apply the Q&D fix. Running 25.0.2 NC Hub 3. The construct function is as follows:
Sorry for my lack of coding experience, but I do get an internal 500, meaning that I either messed up somewhere in the code or something else happened. The original problem I'm facing is similar to yours, quota on the bottom left (next to Deleted Files) is not updating right away. I have set cron to update every minute instead of 5, and for some reason it doesnt update. However, I found out that everytime I go to the User Settings after doing In the meantime, can anyone tell me what Im doing wrong in Quota.php? Thanks. |
Thank you for this! I'm still getting an internal 500 error after saving Quota.php. Did you do anything else after editing Quota.php? |
did you reset opcache? (php: opcache_reset();) (Buffering is a b*tch..) Otherwise, restore your original, error gone? I didn't change anything else then that after the upgrade.. can you give me the error? |
I did reset opcache. Made a file called flush_cache.php and had this in it:
ran So after changing Quota.php and restarting services, I go to the login page. The moment I log in, Im greeted with: ` If this happens again, please send the technical details below to the server administrator. More details can be found in the server log. Technical details I made sure I was logged into my session before changing Quota.php. I went to Admin Settings -> Logging so I could catch the error. Here it is:
If I undo all of the changes in Quota.php, it will go back to working. I log in and its as nothing ever happened. |
Did you add |
This is my Quota.php. I did |
This comment was marked as resolved.
This comment was marked as resolved.
Please check #34422 (comment) will update to 25.0.3.. but 25.0.2 still has the bug, so I'm not holding my hopes up.. |
I am now at version 25.0.9 (haven't upgraded to 26 yet) And I ran into the same problem again. I have (again) performed "my hack" and the problem was fixed. "that hack/Q&D fix" : #34422 (comment) for future reference, this is what I have now in lib/private/Files/Storage/Wrapper/Quota.php:
|
I am now at version 27.1.6 (haven't upgraded to 27.1.7 yet) Same problem again.. same solution again.. |
Hi @mrAceT - I'm unable to reproduce this. I also don't see evidence that there have been similar reports. Are you still experiencing this? If so:
|
This issue has been automatically marked as stale because it has not had recent activity and seems to be missing some essential information. It will be closed if no further activity occurs. Thank you for your contributions. |
Bug description
Primary storage S3
It worked fine, but after a while (again....) new users get a fixed quota of 2 GB and no matter what I try I can't get that changed
Steps to reproduce
Expected behavior
a 100% working quota system for S3 ;)
Installation method
Community Web installer on a VPS or web space
Operating system
RHEL/CentOS
PHP engine version
PHP 7.4
Web server
Apache (supported)
Database engine version
MySQL
Is this bug present after an update or on a fresh install?
No response
Are you using the Nextcloud Server Encryption module?
Encryption is Disabled
What user-backends are you using?
Configuration report
No response
List of activated Apps
Nextcloud Signing status
Nextcloud Logs
No response
Additional info
I have had this problem once before.
In utter dismay I (re)build my migration code to migrate back from S3 to local storage. Then the quota problem was gone..
After massive testing of my (re)built migration tool for migrating from Local > S3 I then decided to return to S3 storage.
This worked for almost exactly two months.. now I have again the exact same problem !?
Because the problem was resolved when migrating from S3 > local storage I expect the problem to reside in the filesystem handling of S3.
The strange thing is:
oc_preferences
I see the quota I set (10 Gb)!But when I see the quota in the web interface, no matter if I'm the admin or the user I get 2 GB!
When I install the software for the network drive I get the 2 Gb quota
So effectively I set it to 10GB, it it operates at 2 GB !! Even setting it to unlimited does not change the 2GB setting!?
I have looked at the code.. to keep it a s clean as possible I started debugging via the quota info of the logged in user.. (I set it to 10 GB)
I find: apps/files/ajax/getstoragestats?dir=%2F
then: apps/files/lib/Controller/AjaxController.php: public function getStorageStats
then: apps/files/lib/Helper.php: public static function buildFileStorageStatistics
then: apps/files/lib/Controller/ViewController.php: protected function getStorageInfo
then: lib/private/legacy/OC_Helper.php: public static function getStorageInfo
There I get stuc in this part:
$quota = \OCP\Files\FileInfo::SPACE_UNLIMITED; $mount = $rootInfo->getMountPoint(); $storage = $mount->getStorage(); $sourceStorage = $storage;
I can't find the "getQuota" where it goes wrong.. here:
// TODO: need a better way to get total space from storage if ($sourceStorage->instanceOfStorage('\OC\Files\Storage\Wrapper\Quota')) { /** @var \OC\Files\Storage\Wrapper\Quota $storage */ $quota = $sourceStorage->getQuota(); $logger->warning("getStorageInfo testET3: includeExtStorage:".$includeExtStorage." quota:".$quota,[]); }
Here I get the wrong quota.. can someone tell me where this function is in the code?
Al that darn "getQuota" has to do is return the quota set in
oc_preferences
whereuserid
is the user and return theconfigkey
value for 'quota'.Is there anyone who can point me in the right direction?
If needed I'll "hack the system" so that I'll at least get the right quota.. But I need to know where that darn "getQuota" is at (there are quite a few functions of that name in the source code....)
AD: the version is now the latest 24.0.5, but this problem has been here for at least half a year..
The text was updated successfully, but these errors were encountered: