-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Trash bin: AbstractTrash::getSize() must be of the type integer, float returned #13160
Comments
Same here, fresh install Nextcloud 15. Is there a clean way to manually remove deleted files? |
It might be related to FileInfo Size Function not converting the data field to integer properly, if it is already float. |
Same behaviour with Nextcloud 15.0.2.0. Return value of OCA\Files_Trashbin\Sabre\AbstractTrash::getSize() must be of the type integer, float returned
|
I fixed it locally by explicitly casting to int in method getSize() in AbstractTrash.php. It now looks like this now:
|
It works for me too, thanks! |
Had the same problem, found this issue by Google, thanks for the exact Nextcloud-log. Solved it by the following answer
|
This worked for me |
Bad idea. If you running nextcloud on a raspberry pi (and use a 32bit operating system) files larger than ~4gb are to big for int. What is wrong here is the typed return type. |
this worked for me too but the files were 2,5 GB not bigger than 4 |
Same for me, fix doesn´t work cause it´s already applied in AbstractTrash.php. |
Update: When I change the "public function getSize(): int {" to "public function getSize(): float {" in AbstractTrash.php, trashbin page loads immediately. So where the int is a fix for some, it gets me in big troubles. Definitely NOT closed! |
@rullzer @MorrisJobke https://github.com/brick/math could be a possible solution. I'm not affected by this problem but it would be cool to have it fixed. Keep in mind you recommend nextcloud for raspberry. Using |
This is still a problem in nextcloud version 15.0.8.1. I got around it by editing AbstractTrash.php and putting intval around the return statement for getSize. I tried using changing the return value to float and that worked too. |
I can confirm the problem at the image NextCloudPi_RPi_03-09-19. I updated to nextcloud 16.0.1.1. The trash bin has been unusable after I dropped a 3.8 gb file in it. |
I have faced the same issue. |
Thx for the info! I can confirm that helped. |
Hello, |
As openterprise stated the following console command forces the trashbin to empty: You either have to login to the nextcloud locally or via ssh. In my case it is a nextcloudpi and it said it didn't the file occ. In that case I had to change the command to where my occ is, i. e. : |
I doubt that Nextcloud is mostly used in home environments, maybe installations but not (paying) users. There are alot of high volume installations referenced on the website. (Siemens, German Goverment, French Government) Anyway, the fix has some implications. Just casting away the float means, you loose information. These implications have to be analyzed and understood and they might not be immediately visible. I guess, this issue is not on the top priority of the payed NC devs and nobody has volunteered to work on this either. If somebody is willing to make the commitment, I doubt that the patch won't get merged. ;-) Maybe it's even better to fail when reaching the 4 GB limit in the trash bin. |
I hope somebody will come up with a stat that shows whether home or business, 32bit or 64bit (paying) users are more. Till that time I just want to point out the non-paying users also create value for the NextCloud org by testing in various environments and reporting issues free of charge. If their needs are ignored, they might get pissed off and stop caring about NextCloud in general. This particular issue is open since almost 2 years, and the amount of comments, workaround discussions clearly show that people are bothered. In order to put things into perspective and continue discussing in a language that everyone understands, can an expert (NextCloud) PHP dev estimate how much effort in hours it would take to fix this clean or implement a workaround? If this would be e.g. 1 month effort, costing 10K€, I would understand the hesitation immediately and just give up on this. |
Hello, some days ago i decided to investigate more into issues that occur when running Nextcloud on 32-bit machines, with the hope of helping fixing the getSize() issue and a lot more. I ran all unit tests in a 32-bit environment, and tried to fix most failures, but soon i stumbled upon some PHP functions that can't be adapted to handle large files, in particular the Therefore i decided to switch to the Raspberry Pi OS 64bit (currently in beta), and this solved most of my problems. I know that this can't be a solution for everyone, since it works only with the Raspberry Pi 3 or 4, but is PHP itself that is not fit for this application. I'm also a little sorry since this bug was on my TODO list for years - but it's time to move on. |
So does this basically mean the end of it? Not salty or something, just wanting to know if this is final. I have created a patch file which I will simply apply after each update. I am aware that running a 32 bit Server in 2021 is not really viable, but as I cannot just get a newer one, that's what I'll have to live with. |
Hello It worked for me, I can see my deleted files but there is a problem: before I have activated the encryption but the file is not decrypted how can I fix it ? |
Being in the field, I know there are a lot of businesses running in 32 bit environments still for multitudes of reasons. This ranges from simple cost saving to inter-software compatibility with legacy programs the businesses depend on. It will be this way for a great deal of time to come yet too. It's only a matter of time before a business user in a 32-bit environment notices accessing their trash generates tons of errors and appears to make their files vanish. Then a patch will be rolled out to help them, and indirectly to the rest of us too. I gotta say though, something as fundamental as the trash not working in a file-management-first software without user intervention hacks every update... does not instill a lot of confidence. It has also hurt the times I tried recommending Nextcloud (even for the users in 64-bit environments), which I otherwise highly praise. Above all though, I'm still not sure why this is even an issue in the first place. Surely they can do a 64/32 bit check (why not PHP_INT_SIZE == 4?) and then act accordingly. This way 64-bit+ logic can stay the same as it is now, and 32-bit logic can do the casting solution so users can have working software. All at the cost of one if. Certainly a lot better than the bold and rather wishful bet that every device under the sun is 64-bit and is additionally is running a 64-bit environment. |
Worked for me too. Thank you. |
I can confirm that this issue still persists with NC v22.1 on a Raspberry Pi 4, forcing the conversion to int however still fixes it, and the bin can be opened afterwords without any issues... |
I can too confirm the issue in NC 22.1 RPi4. The int casting fix solves the issue. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Guys, storage/Snap issues with a 64-bit system are pretty OOT here. I suggest to discuss such things on the community forum. |
How is it that there is a literal one-line fix for this and it hasn't been merged in well over a year? The whole "32 bit is outdated" bit seems stupid to begin with, but I'm hitting this issue on ARM, and I bet I'm not the only one - which makes this a problem on a huge amount of Pi-based setups as well as low-end NASes. Come on guys, why isn't this just merged into the actual application/if casting to int is a problem, why aren't other possible fixes being investigated? This seems like a pretty serious issue, and it just looks like nobody cares beyond the users who need their files back. |
I may have fix for this. I was forced to look into this issue after switching from nextcloudpi to snap and was unable to edit the After I cleand the trashbin with Hope this will help anyone. |
Thanks for these posts as always. I've had to implement this fix, not frequently, but enough over the past few years that I always remember that there's something to look for. Is there no upstream way to fix this kind of weird issue or is it something to do with all of my nextcloud instances? fsck's are run a lot but doing full file scans seems tedious and interruptive. It really seems like there should be a fix. Am I just being a pest? Thanks. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
Closing due to nextcloud/documentation#9071 |
You're kidding, right? The fix is seriously just to declare Nextcloud no longer works on a large chunk of low-end NAS boxes with 32-bit ARM processors? 32-bit may be long dead on x86, but best I can tell it's still alive and well on ARM... can't tell for the latest generation, but I know plenty of NASes from just a few years ago (including mine) are now officially unsupported due to this. |
I am not kidding. It was already kind of unsupported before as you can see by the duration this issue was open. Now it was made official. |
Steps to reproduce
(I am unsure about this, as I cannot set up another test instance.)
Expected behaviour
The trash bin should open, showing deleted files.
Actual behaviour
In the web client, the trash bin does nothing but show the loading spinner.
The Android app shows an error instead.
Server configuration
Operating system: Raspbian stretch
Web server: Apache 2.4.25-3
Database: MariaDB 10.1.37-0
PHP version: PHP 7.0.30
Nextcloud version: 15.0.0
Updated from an older Nextcloud/ownCloud or fresh install: upgraded from 14.0.4, 13.0.6, 12.0.4
Where did you install Nextcloud from: zip file
Signing status:
Signing status
List of activated apps:
App list
Nextcloud configuration:
Config report
Are you using external storage, if yes which one: no
Are you using encryption: no
Are you using an external user-backend, if yes which one: no
Client configuration
Browser: Firefox 64
Operating system: Windows 10
Logs
Web server error log
Web server error log
Nextcloud log (data/nextcloud.log)
Nextcloud log
Browser log
Browser log
The text was updated successfully, but these errors were encountered: