Skip to content
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

Wrong or no sizes of files/folders #5031

Closed
mara21 opened this issue May 22, 2017 · 124 comments · Fixed by #23257
Closed

Wrong or no sizes of files/folders #5031

mara21 opened this issue May 22, 2017 · 124 comments · Fixed by #23257
Labels
1. to develop Accepted and waiting to be taken care of bug feature: files
Milestone

Comments

@mara21
Copy link

mara21 commented May 22, 2017

After upgrading from NC11 to NC12, I noticed incorrect folder and file sizes. All >2GB files are pending. I checked the oc_filechache table - it looks like the sizes are fine. I trunc the oc_filechache table and executed the files: scan --all again and again filled it with the exact size, but the Files app is rendered incorrectly. There are no errors in the NC logos, there is no error in appache logos too.

Steps to reproduce

Attach external (local folder) with big files in it. Browse it in WebUI and the folder size will be incorrect or pending. Navigate to some sub folder that contains more then 2GB or have at least one file with size more than 2GB and will see "pending" in the file size column.
In my case file with 3.9G (4143738495 bytes) is shown as "pending" size. The upper folder also is with "Pending size". The same file in oc_filechache is with 4143738495 size so it is indexted currect.

Expected behaviour

Should see 3.9G

Actual behaviour

See "pending"

Server configuration

Operating system: OSMC (Debian 8.8)

Web server: Apache/2.4.10 (Debian)

Database: mysql Ver 14.14 Distrib 5.5.55, for debian-linux-gnu (armv7l) using readline 6.3

PHP version: php5 with fpm (PHP 5.6.30-0+deb8u1)

Nextcloud version: NC 12.0.0

Updated from an older Nextcloud/ownCloud or fresh install: Updated from NC 11.0.3

Where did you install Nextcloud from: from the official website

Signing status:

Signing status No errors have been found.

List of activated apps:

App list Enabled: - calendar: 1.5.3 - contacts: 1.5.3 - dav: 1.3.0 - external: 2.0.2 - federatedfilesharing: 1.2.0 - files: 1.7.2 - files_external: 1.3.0 - files_pdfviewer: 1.1.1 - files_sharing: 1.4.0 - files_texteditor: 2.4.1 - files_videoplayer: 1.1.0 - gallery: 17.0.0 - gpxpod: 2.1.2 - logreader: 2.0.0 - lookup_server_connector: 1.0.0 - nextcloud_announcements: 1.1 - notifications: 2.0.0 - oauth2: 1.0.5 - password_policy: 1.2.2 - previewgenerator: 1.0.6 - provisioning_api: 1.2.0 - serverinfo: 1.2.0 - sharebymail: 1.2.0 - theming: 1.3.0 - twofactor_backupcodes: 1.1.1 - updatenotification: 1.2.0 - workflowengine: 1.2.0 Disabled: - activity - admin_audit - admin_notifications - bruteforcesettings - comments - encryption - federation - files_downloadactivity - files_trashbin - files_versions - firstrunwizard - mail - socialsharing_email - socialsharing_facebook - socialsharing_googleplus - survey_client - systemtags - user_external - user_ldap

Nextcloud configuration:

Config report

{
"system": {
"instanceid": "ocdhcp0sm80x",
"passwordsalt": "REMOVED SENSITIVE VALUE",
"secret": "REMOVED SENSITIVE VALUE",
"trusted_domains": [
"XXX.XXX.X.XXX",
"X.XX.XXX.XX",
"XXXXXXXXX.XX"
],
"preview_libreoffice_path": "/usr/lib/libreoffice/program/soffice.bin",
"datadirectory": "/var/www/NCData",
"overwrite.cli.url": "https://XXX.XXX.X.XXX",
"dbtype": "mysql",
"version": "12.0.0.28",
"dbname": "NextCloud",
"dbhost": "127.0.0.1",
"dbtableprefix": "oc_",
"dbuser": "REMOVED SENSITIVE VALUE",
"dbpassword": "REMOVED SENSITIVE VALUE",
"logtimezone": "UTC",
"installed": true,
"memcache.local": "\OC\Memcache\APCu",
"allow_user_to_change_display_name": true,
"enable_avatars": false,
"quota_include_external_storage": false,
"updater.release.channel": "beta",
"appstore.experimental.enabled": true,
"mail_from_address": "test",
"mail_smtpmode": "php",
"mail_domain": "xxxxxxxxx.xx",
"mail_smtpsecure": "ssl",
"mail_smtpauthtype": "LOGIN",
"mail_smtpauth": 1,
"mail_smtphost": "xxxxl.xxx",
"mail_smtpport": "465 ",
"mail_smtpname": "REMOVED SENSITIVE VALUE",
"mail_smtppassword": "REMOVED SENSITIVE VALUE",
"loglevel": 0,
"maintenance": false,
"theme": "",
"htaccess.RewriteBase": "/",
"debug": true,
"updater.secret": "REMOVED SENSITIVE VALUE"
}
}

Are you using external storage, if yes which one: local

Are you using encryption: no

Are you using an external user-backend, if yes which one: No

Client configuration

Browser: 58.0.3029.110 (64-bit)

Operating system: Windows 7

Logs

Web server error log

Web server error log no errors

Nextcloud log (data/nextcloud.log)

Nextcloud log no errors

Browser log

Browser log no errors
@autoize

This comment was marked as spam.

@gbmaster
Copy link

gbmaster commented May 31, 2017

Confirmed. I also have this issue and on NC11 everything was fine.

I'm running NC12 on a raspberrypi with PostgreSQL. This kind makes me remember about the PHP problem in retrieving file sizes greater than 2GB when running on 32bit architectures.

@emc02
Copy link

emc02 commented May 31, 2017

Confirmed! Same problem here!
And it also shows wrong size of available space in client (Windows 10)

@TikayinBerlin
Copy link

Same issue here, Linux client and Rasberry Pi Server.

@k-one-e
Copy link

k-one-e commented Jun 5, 2017

Same issue here. A fresh install on Raspberry Pi 3.

@perromojado
Copy link

Same here. Raspberry Pi 3, PHP 7, MariaDB, Apache2.

@fabiopuddu
Copy link

fabiopuddu commented Jun 12, 2017

The same happens to me when a folder contains more than 2GB of files.
While the size is reported as "Pending" in the file list, in the right panel the size is reported as <1Kb and as a negative value in the tooltip that you get when you hover onto it.
The negative folder size seems to arise from the issue @gbmaster referred to.
For example I have a folder:

Summed size of content: 2,835,430,391 bytes
Tooltip size: -1,459,536,905 bytes
32-bit signed integer range: -2,147,483,648 to 2,147,483,647
Summed size exceeding the range: 687,946,744
Wrap-around from -2,147,483,648 and you end up at -1,459,536,903

Example2:
Summed sure of content: 4,261,493,373
Tooltip size: -33,473,923
Summed size exceeding the range: 2,114,009,726
Wrap-around from -2,147,483,648 and you end up at - 33,473,921

@cybero2912
Copy link

same here.
Debian Jessie, NGINX, PHP7, MySQL

@TheTimeWalker
Copy link

TheTimeWalker commented Jun 19, 2017

Same here on a Raspberry Pi 3 running nextcloud 12.0.0
Pending size with negative number in details shows up for a 2.15GB big ZIP file. Sync client is stuck on the file for some time ending with "Server version downloaded, copied changed local file into conflict file"

@Bratzmeister
Copy link

Bratzmeister commented Jun 21, 2017

can confirm on Cubieboard 4 (CC-80)
Architecture: armv7l - debian/ubuntu armhf
upgraded from 11.0.3 to 12.0 (both official downloads)
All checks passed and no errors (upgrade and/or webinterface)
Apache 2.4, PHP 7, MySQL

maybe this only affects armv7l? judging from the comments here everyone who reported their architecture was on arm

@twocoolbeans
Copy link

twocoolbeans commented Jun 21, 2017

Have same issue on 32-bit operating system. Is everyone having this issue using 32-bit hardware? Or is this issue occurring with both 64-bit and 32-bit operating systems?

Architecture is not arm.

@TheTimeWalker
Copy link

TheTimeWalker commented Jun 21, 2017

Ah! Interesting to note that. Seems like all the people here reporting are the ones noticing this on 32bit OS.
Raspberry Pi 3, which I use, has a 64bit processor but generally you still install 32bit OS because of the low memory that it has.

@ghost
Copy link

ghost commented Jun 21, 2017

Yep.. I'm having the same issue running LAMP in a Rpi 2... No solution yet? Even in the nextcloud client shows 0 B of 43 GB in use... I have 50 GB so that means that it's assuming in a wrong way that I have consumed 7 GB.

@leifkuhl
Copy link

I'm having the same issue, system: Raspberry Pi 3, PHP 7, MariaDB, Apache2 and Debian 9

@gbmaster
Copy link

The problem, as far as I can see, is due to the 32-bit version of PHP. Apparently, until NC11, developers found a workaround for this issue.

@mara21
Copy link
Author

mara21 commented Jun 22, 2017

The console (occ) is still working.... so the problem is not in PHP - it is from the source of NC12. Also NC11 is working.....

@gbmaster
Copy link

Is there a way to raise this problem to the NC developers?

@mara21
Copy link
Author

mara21 commented Jun 22, 2017

I will try in #nextcloud-dev

@akki42
Copy link

akki42 commented Jun 22, 2017

I would assume this to be a problem with parseInt(file.size, 10) in lines 100, 128 and 175 in /apps/files/js/filesummary.js.

However, some of you are suggesting this error is new in NC12, and I could not find any relevant / detrimental commit. (Last patch to these lines was by @DeepDiver1975 in 2015...)

@emc02
Copy link

emc02 commented Jun 23, 2017

on NC11 everything worked fine and I only updated to NC12 and did not change or update anything else (RPi3, PHP, MySQL, etc... is still the same)
my Desktop Client on Win10 shows different values of available and used spaces. For example: now it shows used 91MB of 56GB, correct would be used 64GB of 120GB
In browser it shows on some folders that the size will be calculated ("Ausstehend" in german), on NC11 all worked fine...
I tried to rebuild everything and did a clean install of NC12 too! But during upload of the files it suddenly showed the wrong sizes.

Maybe it is not the file summary, but the calculation of the single files (don't know where to find that code snippet)

@1manprojects
Copy link
Contributor

I have the same problem. Folder size shown as pending for a folder larger then 7GB in the root directory. Opening the folder however it shows the exact size of 7.1GB at the bottom (all files and subfolder are smaller then 2GB). This all started right after the upgrade from NextCloud 11.03 to 12.0. Also on the personal page the used space is shown as 0B while the max available space is shown as the MaxQuota-UsedSpace.

Nextcloud 12.0 on raspbian (raspberry pi 3) updated from version 11.0.3
MySql - 5.5.54
PhP -5.6.30

@akki42
Copy link

akki42 commented Jun 23, 2017

Just saw that sabre-http had a similiar problem that was solved by this workaround.

Nexcloud - DAV also was affected by this sabe issue, which was fixed by @nickvergessen for NC13.

@derkostka
Copy link
Contributor

derkostka commented Jun 25, 2017

@akki42 correct. But still, even with these two fixes, the file size is still capped at 2GB. I think you found the correct location, max integer at 32 Bit is 2147483647, so this may be the reason (see my screenshot). Note that javascript and thus parseInt can handle more then 32 Bit.

Also with the latest patches, the file is downloaded correctly, so i think it is a matter of visualization.

I can confirm this issue on an odroid SBC (32 Bit machine).

@nickvergessen , @MorrisJobke : here is another small bug, which should be solved with 12.0.1 or 13: File sizes shown in the GUI are not above 2 GB on 32 Bit machines.

image

@derkostka
Copy link
Contributor

Update: I think the function "humanFileSize" is the problem. It takes an integer as argument, which is obviously capped at 32 Bits here. The function is used also at other places. I will investigate further ..

@emc02
Copy link

emc02 commented Jul 3, 2017

Nothing new here???

@mara21
Copy link
Author

mara21 commented Jul 4, 2017

No :(

@bertmelis
Copy link

bertmelis commented Jul 4, 2017

Experiencing the same issues. In the directory list, large dirs have a "pending" size, while the correct size is shown at the bottom when going into that directory.

I've got no problems with a max filesize of 2GB (as is expectable on 32 bit systems), but the problem is that large directories are bringing the system down: I've set a quotum of 100 GB but NC says I've only got a quotum of 28 GB after transferring my files.

I've already updated sabre-http manually but that obviously doesn't solve the problem.

@derkostka
Copy link
Contributor

I did not find the root cause, i still think it has to do with humanFileSize, but as i am not used to templates nor to php that much, i cannot help further here.

@Bolkarr
Copy link

Bolkarr commented Sep 3, 2020

Exactly the same here. Have Nextcloud run stable for a long time on an Odroid HC2 (32bit system, via snap), and for some time (update to 19?) it is completely unusable. The synchronization hangs, larger files create conflicts, a fix with "occ..." did not work so far. In the logfiles the message "Broken webserver returning empty content length for non-empty file on resume", in addition to this the message "pending" instead of showing a file size for many files in the web frontend. It's incredibly frustrating, I've spent so much time trying to get this working again. And the sync is the core of Nextcloud for me; all the apps are nice, but rather nice to have. If the sync doesn't work, the whole thing is just useless 😥. Maybe I have to deal with a downgrade, has anyone tried that yet?

I also use Odroid HC2 with Openmediavault and use Nextcloud as a docker. It was working since like version 10, with no issues (with files as big as 70GB). Like you, I use it only for syncing with different computers and family members. Extremely frustrating. I guess I can find and do a fresh install of an older version like 18, but what is the point if this thing persists in the new versions and I am stuck with getting no updates and/or fixes...

I just gave up at this point, unplugged the Odroid and stopped using the system... I am manually copying files between my computers, bad bad experience. I hope developers figure the problem out and fix it with an explanation as what was the issue for this big bug.

@c-0815
Copy link

c-0815 commented Sep 9, 2020

The issue occures with files of more than 2147483647 Bytes in Nextcloud 19.0.2 on Raspberry PI OS 10 32 bit. Version 17.0.9 and 18.0.8. are not affected. So in my opinion the reason is not the php version.
filesize() returns 0x0FFFFFFF byte as expected filesize, from 0x10000000 bytes a negative integer in PHP 7.1 and 7.3.
So nextcloud seem to calculates the filesize by another way or even not at all.

@mumrau
Copy link

mumrau commented Sep 9, 2020

How could we get attention on an issue this old? Should we try and mention someone maybe?
I believe it is a fairly strong regression, I tested it using the docker image and got the same outcome as @c-0815 , works on 18, doesn't work on 19.

I believe many, many people are affected by it.

@macearl
Copy link

macearl commented Sep 9, 2020

So @skjnldsv, i'm assuming this is then also a case of wontfix like: #16431? That would really be a shame as this would break a lot of installations for good, at least without a complete OS reinstall

@KenwoodFox
Copy link

Is this really install breaking? I mean accessing files still works, its just annoying to have to run an occ command to update large folders.

@dasaweb
Copy link

dasaweb commented Sep 9, 2020

Is this really install breaking? I mean accessing files still works, its just annoying to have to run an occ command to update large folders.

Updating large folders (or folders with large files) with an occ command does not work for me, unfortunately. In my case Nextcloud isn't able to sync large files. When I try to sync a large file Nextcloud creates a copy of the file (on the client side). The file with the "conflicted copy" in it's name has the right size, but the "original" files has now a smaller size. So sync doesn't work, and this is install breaking...

BTW: I also have this issue here (nextcloud/desktop#2279). Maybe this is somehow correlated?

@KenwoodFox
Copy link

@dasaweb Ah I see, I don't have that issue, I can still sync files even if nextcloud cant display the size to me.

@macearl
Copy link

macearl commented Sep 9, 2020

running the command does not fix the issue anymore. In my case i'm still able to upload and download larger files, the size shown is just wrong, and therefore the quota and used space calculations are also off by quite a bit if you have a couple of larger files. For systems which rely on correctly reported Quota i would describe this as install breaking.

Single User systems which do not rely on quota are probably still fine though

@pjft
Copy link
Contributor

pjft commented Sep 9, 2020

At least in my case, no matter how many occ commands I run on my NC 19 installation, the size stays as Pending. On NC 18 that was not the case. Be it --unscanned or --all, it stays the same. Just tried it on a small folder to make sure I wasn't mixing things up.

My files are on external storage, and since I upgraded to NC19 from NC18 I also found that occ doesn't trigger a scan when opening the external storage, which may or may not be related (i.e. it might trigger it but it may fail silently as I see no log of it).

I can access and manage files as usual, though.

@mumrau
Copy link

mumrau commented Sep 10, 2020

The size access is completely broken on my side, the file on the storage (nextcloud) side is 2 gigs, while the real files should be way more than that. The file is then completely corrupted and it makes no sense to access it.
It's not just the "Pending", which also is a dealbreaker for quotas and stuff... And the occ command doesn't fix anything for me, neither the access nor the pending.

@MegaMarkey
Copy link

MegaMarkey commented Sep 15, 2020

Same issue here on Pi 4 B (32-bit Raspberry Pi OS). The instance worked like a charm before upgrading to Nextcloud 19. I will propably backup all data and downgrade to 18. Hopefully a fix is here soon.

Maybe we should open another issue since the current problems are connected to Nextcloud 19 only?

@Bolkarr
Copy link

Bolkarr commented Sep 15, 2020

I installed 18 from scratch and moved all the files. Everything works as before. Seems like I will not be upgrading to 19 unless there is a fix for this.
Can we at least get some info from one of the developers? Are they aware of the issue? Is there any fix coming? Are they just ignoring it? What is the prospect?

@pjft
Copy link
Contributor

pjft commented Sep 17, 2020

@MegaMarkey I'm up for a new issue being opened, and happy to chime in there.

For what it's worth, I just downgraded to a previous NC18.0.8.2 backup I had, and after a few adjustments everything seems to be up and running as intended. I'm not biting the NC19 (or any major upgrade version) bullet anytime soon, certainly not until I am confident that this is solved.

@Vigasto
Copy link

Vigasto commented Sep 22, 2020

Downgrading to NC18 also resolves this problem on XU4 32-bit system.

@Bolkarr
Copy link

Bolkarr commented Sep 22, 2020

Same issue here on Pi 4 B (32-bit Raspberry Pi OS). The instance worked like a charm before upgrading to Nextcloud 19. I will propably backup all data and downgrade to 18. Hopefully a fix is here soon.

Maybe we should open another issue since the current problems are connected to Nextcloud 19 only?

I believe this is the right way to do it. Since it seems like this is a new issue that started with the new version 19. Would you be able to take the lead and open a new issue?

@aler9
Copy link
Contributor

aler9 commented Oct 7, 2020

Hello, i developed a patch to fix the issue and opened a PR here: #23257

@Bolkarr
Copy link

Bolkarr commented Oct 7, 2020

Wonderful,
Seems like this is in for the version 21. I would appreciate when someone tries this and confirms the fix.

@aler9
Copy link
Contributor

aler9 commented Oct 7, 2020

If the PR will get merged, i'll try to have it backported to stable19.

@macearl
Copy link

macearl commented Oct 8, 2020

thanks for the fix, i just made the same changes to my 19.0.2 installation and after a ./occ files:scan --all everything seems to work like a charm again

@dasaweb
Copy link

dasaweb commented Oct 8, 2020

Sounds promising! Unfortunately I have to wait until the fix reaches Nextcloud Snap. But at least there is hope :D

@MegaMarkey
Copy link

I successfully applied the patch on Nextcloud 20.0.0, everything works fine now. Thanks a lot, I hope it gets merged!

@gjanos89
Copy link

gjanos89 commented Oct 9, 2020

Hello,
Sorry to be so stupid here, but how do I apply the patch?
Thank you!

@MegaMarkey
Copy link

You need to edit the file "lib/private/Files/Storage/Local.php" as seen in the pull request (removing three lines and adding two). Of course maintenance mode should be enabled before. After you are done, disable maintenance mode and rescan all files via
sudo -u www-data php occ files:scan --all.

@gjanos89
Copy link

You need to edit the file "lib/private/Files/Storage/Local.php" as seen in the pull request (removing three lines and adding two). Of course maintenance mode should be enabled before. After you are done, disable maintenance mode and rescan all files via
sudo -u www-data php occ files:scan --all.

Thank you a lot! Worked like a charm!

@maj0rmil4d
Copy link

I still have the problem with Nextcloud Webdav

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. to develop Accepted and waiting to be taken care of bug feature: files
Projects
None yet
Development

Successfully merging a pull request may close this issue.