-
-
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
[stable25] Quota value as float for 32-bit systems #35734
Conversation
/backport to stable24 |
@PVince81 I am under the impression that this error does again only happen on 32-bit due to the php int limit. Are you sure that this does not break on 64-bit? |
same problem here... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m afraid converting int to float on 64bits may have side effects.
We should just remove the type hint and only use a phpdoc type hint of int|float, with an explanation that it may be float on 32bits.
Sounds good to me 👍 |
This comment was marked as off-topic.
This comment was marked as off-topic.
What lines should be changed? I could test it on my 32bit raspberry system. |
e4e27b2
to
885c4ab
Compare
@homeessentials1 @emc02
|
can someone else take over, possibly someone with access to a 32-bit system ? |
I am sorry, I have not the experience to do that, but I can test various possible solutions if wanted and report back |
it looks like so far there were three solutions:
maybe more changes are needed @come-nc can you take over maybe ? |
Next week if I have the time, I will. |
ffc0e7c
to
442cc3c
Compare
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Many thanks. Those two failing tests at least are exactly about what we experience here. Probably starting to investigate from what the tests do is a better approach to find the faulty int cast/declaration. |
@MichaIng My pleasure. I was in the meantime able to figure out how to run Full run logs should be available at https://j-be.github.io/nextcloud-ci/ by the time you are reading this, but it seems to me that GitHub Pages does heavy caching. So consider accessing it with cache disabled, or |
I just upgraded to stable NC26. Indeed something has changed. I can now assign the quota and it shows up correctly in GUI. It was also assigned correctly to the database: $ mysql -e "select * from nextcloud.oc_preferences where configkey = 'quota';"
+----------+-------+-----------+-------------+
| userid | appid | configkey | configvalue |
+----------+-------+-----------+-------------+
| USERNAME | files | quota | 100 GB |
+----------+-------+-----------+-------------+ However, when I try to use the files app with that user, I get a 5xx error and: {"reqId":"5nw7l5SMC4dbmgQ7kYOT","level":3,"time":"2023-03-22T13:01:32+01:00","remoteAddr":"192.168.1.1","user":"USERNAME","app":"index","method":"GET","url":"/nextcloud/apps/files/","message":"Cannot assign float to property OC\\Files\\Storage\\Wrapper\\Quota::$quota of type ?int in file '/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Quota.php' line 68","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36 OPR/98.0.0.0 (Edition developer)","version":"26.0.0.11","exception":{"Exception":"Exception","Message":"Cannot assign float to property OC\\Files\\Storage\\Wrapper\\Quota::$quota of type ?int in file '/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Quota.php' line 68","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":183,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud/lib/base.php","line":1055,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/index.php","line":36,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","Line":169,"Previous":{"Exception":"TypeError","Message":"Cannot assign float to property OC\\Files\\Storage\\Wrapper\\Quota::$quota of type ?int","Code":0,"Trace":[{"function":"getQuota","class":"OC\\Files\\Storage\\Wrapper\\Quota","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php","line":524,"function":"call_user_func_array"},{"function":"__call","class":"OC\\Files\\Storage\\Wrapper\\Wrapper","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php","line":524,"function":"call_user_func_array"},{"file":"/var/www/nextcloud/lib/private/legacy/OC_Helper.php","line":522,"function":"__call","class":"OC\\Files\\Storage\\Wrapper\\Wrapper","type":"->"},{"file":"/var/www/nextcloud/apps/files/lib/Controller/ViewController.php","line":142,"function":"getStorageInfo","class":"OC_Helper","type":"::"},{"file":"/var/www/nextcloud/apps/files/lib/Controller/ViewController.php","line":243,"function":"getStorageInfo","class":"OCA\\Files\\Controller\\ViewController","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":230,"function":"index","class":"OCA\\Files\\Controller\\ViewController","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":137,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":183,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud/lib/base.php","line":1055,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/index.php","line":36,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Quota.php","Line":68},"CustomMessage":"--"}} On This is the last commit on Still does not explain why there are issues with |
/backport to master |
I forward-ported this PR here: #37344 About the failing tests on stable25/24:
Not sure whether it makes sense to backport those fixes, as the tests do not fail in 64-bit CI and 32-bit CI will most likely never be applied on stable25/24. EDIT: Much likely on NC26 that was fixed with #36120, which never was backported to NC25. |
Upgraded to Nextcloud 26 to see if that would change anything. I… can't access to the user page to change the quota. That applying the patch again from that v26 could work ? Can someone provide guidance to me, I don't really know how to do it (what's the command) ? 🙏 |
As I reported above + fix here: #37344 cd /var/www/nextcloud
curl -sSfL 'https://github.com/nextcloud/server/pull/37344.patch' | patch -p1 |
Thanks a lot ! Thanks a lot, problem solved for me ! 🎉 edit : oh no, my bad, File app loads again partially, but the file list is still unavailable… |
Assure to force-reload the page via CTRL+C to clear browser cache, and in case restart PHP to assure OPcache and APCu are cleared. |
PHP (8.1) was restarted right away after applying the patch. To be precise, I have no longer any error shown, in the file app page nor in the logs (from admin UI). |
Mysterious. It works perfectly fine here, including navigating, uploading files via web UI etc with quota applied. And I use this as my daily driver (although with an account without quota). Please also check the browser console for errors. |
I tested without quota, same result. |
Very strange. It works perfectly fine here. NC26, the patch applied exactly as posted above, and the user is perfectly able to browse files with and without quota applied, even showing a nice correct warning that quota is nearly full with correct percentage. Without any error messages in browser or backend, difficult to find the reason. While is should not make a difference: We use PHP 8.2 here. |
I wonder if this could be linked to a quota value being set when I was in a semi-patched version. |
Upgraded to NC 26.0.0.11 on Raspberry Pi 4 32bit. I had the quota problem, this patch helped me. Thank guys! PS. I run this modified command since nextcloud files are accessible only to www-data user cd /var/www/nextcloud
curl -sSfL 'https://github.com/nextcloud/server/pull/37344.patch' | sudo -u www-data patch -p1 |
I noticed something new today : while testing this, I disabled the quota limit for my account a while ago. Today when going to the files app, I had a "You storage space is almost full (98%)" or something similar. Storage isn't full at all. I don't know where this 98% is coming from. |
That message is no longer shown. Also in server diagnostic I have this :
Indeed client sync is broken, client tries repeatedly but always fails. edit : if I set up a quota (not unlimited), this disappears. |
PR up which backports most of the changes done in #36120: #37877 |
Can we test it now ? edit : oh sorry I'm on Nextcloud 26.0.0 now, so it's irrelevant for me. |
This is the related bug ? #37940 |
I'm a bit confused about the situation right now, and the various issues/PR where this problem (if it is really the same one) is mentioned. edit : #37940 sounds very similar to the (second ?) bug I'm encountering. 32 bit system issue too, bug introduced by a new "int" typing... |
For the record migrating from 26.0.0 to 26.0.1 doesn't change anything regarding this issue. |
If your bug is the same as #37940, comment there, if your bug is different, open a ticket for it. |
Summary
TODO
Checklist