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

fixing the 2GB upload size limit #158

Closed
ObfuscateTheWeb opened this issue Aug 25, 2017 · 32 comments
Closed

fixing the 2GB upload size limit #158

ObfuscateTheWeb opened this issue Aug 25, 2017 · 32 comments

Comments

@ObfuscateTheWeb
Copy link

duckduckgoing around, the first result that comes up is nextcloudpi, doesn't show anything else
I'm sure there's something out on the internet that is similar to nextcloudpi but is 64-bit?

If there exist such thing, it means I could use that and get unlimited upload sizes to nextcloud without the 32-bit php and 32-bit raspbian limiting me

@nachoparker I'm pretty sure you know of such thing?

@nachoparker nachoparker self-assigned this Aug 25, 2017
@nachoparker nachoparker changed the title Is there something similar to nextcloudpi on the internet? Is there something similar to nextcloudpi on the internet? (about 2GB size limit) Aug 25, 2017
@nachoparker
Copy link
Member

nachoparker commented Aug 25, 2017

Well, don't panic!

Even for 32bit systems, there's a workaround to the PHP limitation.

It is scheduled to land in NC13, but if you can patch it yourself today

nextcloud/server#1707 (comment)

Also, you can use NFS, SSH or SAMBA to upload the big files. See the related posts in own your bits.

https://ownyourbits.com/2017/04/18/different-ways-to-access-your-nextcloud-files/
https://ownyourbits.com/2017/04/16/share-your-files-in-your-lan-with-samba/
https://ownyourbits.com/2017/04/13/share-your-files-in-your-lan-with-nfs/

In any case, NCP will probably end up being ported to 64bit, but it's a bit lower priority

@ObfuscateTheWeb
Copy link
Author

ObfuscateTheWeb commented Aug 26, 2017

Do I just edit according to that thread?
I followed the edit and rebooted but it still doesn't work?

Am I suppose to recompile it or something? Is it as simple as edit,save, and reboot? Cause it isn't working for me :(

EDIT: Some basic sanity checks: Am I editing the correct sapi.php file?
I edited this one >> /var/www/nextcloud/3rdparty/sabre/http/lib/Sapi.php is this the correct file?

@nachoparker
Copy link
Member

No, no need to recompile, it should be instantaneous

That's the file. I don't remember if you have to make other server config changes.

@ObfuscateTheWeb
Copy link
Author

ObfuscateTheWeb commented Aug 29, 2017

Is the edit suppose to fix the upload/download sizes ?

EDIT: I keep getting request error when uploading a file > 2 GB
Some logs:

webdav

The edit made according to that thread (comment out stream_copy_to_stream and add the while clause)
code

@nachoparker
Copy link
Member

Hi,

Thanks for the help on this.

The problem is only with uploads I think.

that looks about right

Maybe there's some server configuration that you want to review, but I think everything is correct so it surprises me that still doesn't work for you. I assume you have rebooted, just in case?

I was waiting for NC13, because applying the patch as part of the build process is possible but messy, and there's more guarantee that it's going to work after upstream has released it, but if there's people interested in making it work it would be nice, to be ready for when it lands, or maybe implement it as a nextcloudpi-config extra.

I'll paste here some resources. Maybe somebody else can help review this. I need to address some bugs that came with Stretch first

https://devsidestory.com/build-a-64-bit-kernel-for-your-raspberry-pi-3/
sabre-io/http#74
nextcloud/server#1707 (comment)
https://forum.owncloud.org/viewtopic.php?f=17&t=32517
owncloud/core#9832 (comment)
https://docs.nextcloud.com/server/11/admin_manual/configuration_files/big_file_upload_configuration.html

@nachoparker nachoparker reopened this Aug 29, 2017
@nachoparker nachoparker changed the title Is there something similar to nextcloudpi on the internet? (about 2GB size limit) fixing the 2GB upload size limit Aug 29, 2017
@ObfuscateTheWeb
Copy link
Author

Yes I rebooted, and I guess I'll just have to wait for NC 13 to patch this

@nachoparker
Copy link
Member

Ok, I'll leave the help wanted tag if anybody want to try this. In that case we can reopen

@gboudreau
Copy link

In case anyone else finds this looking for a workaround, installing the Nextcloud 13 beta (beta 3 was published a few days ago) resolves the upload issues. I was able to upload 8-9GB files using the web UI with that beta installed.

@nachoparker
Copy link
Member

@gboudreau awesome, thanks for letting us know

@maanloper
Copy link

Sorry to reopen this:
I have RPI3 running NC13.0.1 with a variation of the problem:

When I upload a 5.0GB MOV file through the web interface while normally logged in everything seems to go smooth(ish).* I used microsoft FC /B (binary file compare) command to check the original and uploaded-and-synced-back-to-client versions were identical bit-to-bit.

However: when I create a share link for a folder for someone to upload their files to, say for a friend with GoPro footage of my snowboard crashes, then the file gets uploaded "successfully", but truncated at 2.0GB.
Example: Movies/Crashes/Myfriend
Create share link for Myfriend folder (no password, expire date >2 weeks away, both upload&edit capabilities)
If I upload from logged in account to that folder (so not using the share link), no problem; me, the browser, the server: all happy. If either me or my friend uploads a >2GB file through the shared link: 2.0 GB truncated file. No error, nothing. Just a 2.0 GB files synced back to my desktop through the client.

My guess: the share-link page uses different code than the normal web UI and does not have the updated code in it that handles >2GB files correctly?

*Sometimes it keeps saying "a few seconds" for a looooong time when uploading is done (no data upload according to Windows Task Manager). Then after a while desktop client starts syncing the file while the web environment still says "a few seconds". When pressing F5, file appears in the list without errors, but otherwise "a few seconds" won't disappear. This problem does not occur when the files are truncated, then the upload bar disappears when both are uploaded and truncated.

@nachoparker
Copy link
Member

nachoparker commented Apr 2, 2018

My guess: the share-link page uses different code than the normal web UI and does not have the updated code in it that handles >2GB files correctly?

Your guess sounds correct to me. Better report this in the main NC repo, or in the forums

Thanks for the feedback

@maanloper
Copy link

No problem, I have created the thread also in the main Nextcloud repo, #9053.

At first I thought my friend was completely retarded; I could upload big files and he couldn't. Guess I owe him a beer now ;)

@nachoparker
Copy link
Member

lol I guess you are right xD

keep us posted

@Serkan-devel
Copy link

shouldn't this be reopened?

@nachoparker
Copy link
Member

nachoparker commented Apr 3, 2018

mmm, if anything I would create a new issue, and close it as a external bug, so let's just leave the issue you created linked here for people investigating this in the wrong place

I am also now tracking the issue

@nachoparker
Copy link
Member

@rmufr
Copy link

rmufr commented Sep 25, 2018

I found that this fix - with 32bits OS like raspbian - unfortunatly breaks video streaming playback on Apple iOS Safari or Nextcloud iOS App (>v2.22) , as the 32bit workaround ignores the Content-Length header, which is not supported in iOS.
So I prefer to stick with the 2GB limit and be able to playback videos on my iOS device.

@stfast
Copy link

stfast commented Jun 17, 2019

The problem is tmpfs size for PHP-FPM. Since user is anonymus over shared link, temporary upload file isn't written to Nextcloud user directory (over PHP session), but is written to system tmpfs (/tmp) instead, which is 2Gb by default, thus upload file over shared link is being truncated:

[root@nextcloud ~]# df -h|grep tmp
tmpfs 2.0G 0 2.0G 0% /dev/shm

Our soution is to change PHP-FPM tmpdir settings:

[root@nextcloud ~]# cat /etc/php-fpm.d/custom.conf
[www]
env[TMP] = /Nextcloud_Data/upload_tmp_dir
env[TMPDIR] = /Nextcloud_Data/upload_tmp_dir
env[TEMP] = /Nextcloud_Data/upload_tmp_dir

[root@nextcloud ~]# systemctl restart php-fpm

Another possible solution would be tmpfs resize, but actually this is not a good idea, since tmpfs is really RAM allocation/consumption.

https://wiki.archlinux.org/index.php/Tmpfs

@delfer
Copy link

delfer commented Oct 24, 2019

Fixed by docker-library/php#901
Tested in Docker image nextcloud:17-apache (nextcloud@sha256:58836d449406b396c1c119c2661577fd7d8284ff41a7d181a0e2be232d2757fc, 2019-10-24T05:04:49.946856094Z)

@CajonCP4
Copy link

I tried to upload a video file >5GB via Desktop client to my cloud, but it seems not to work. It says it has uploaded the file, but only 1,3GB got uploaded. I have the Pi4 model on NextCloudPi 19.0.2 and I have set the maximum file size to 1000GBs.
Do I need additional apps like Flow Upload to upload files bigger then 2GBs? Or am I doing something wrong? Thanks for your help!

@nachoparker
Copy link
Member

You will have to migrate to the 64bit version. This week we'll have raspberry pi NCP image that supports 64bits

@Vergossen
Copy link

You will have to migrate to the 64bit version. This week we'll have raspberry pi NCP image that supports 64bits

Thats wonderful, because yesterday I found that I have the same problem. I have a Raspberry Pi 4 with NCP and I could't upload a mp4-File with 2,3GB.

If I understand you correctly, I can download the image and then I have a 64 bit NCP system on a Raspberry Pi 4, which actually only has 32 bit, without the 2GB limitation? That would be great! :-)

Where do we find out when the new version is ready and where can we download it? Is there a manual for people who are not so familiar with Linux?

Many greetings
David

@nachoparker
Copy link
Member

Raspberry Pi 4 is 64 bits, but Raspbian is 32bits. We are moving to a different OS that is 64 bits.

you can join the Telegram group to get a notification, also check out docs.nextcloudpi.com

@Larsene
Copy link

Larsene commented Nov 30, 2020

You can use the RaspiOS 64. It works perfectly

RaspiOS lite 64bits

@nachoparker
Copy link
Member

the latest image uses RaspiOS 64 bits. It's already downloadable

@Vergossen
Copy link

Vergossen commented Nov 30, 2020 via email

@Vergossen
Copy link

Vergossen commented Nov 30, 2020 via email

@ovpc
Copy link
Collaborator

ovpc commented Nov 30, 2020

@Vergossen

https://docs.nextcloudpi.com/en/how-to-backup-and-restore-a-nextcloudpi-instance-using-ncp-config/

@nachoparker

RaspiOS lite 64bits

does not boot on my rpi2B armv7, is that to be expected?

@nachoparker
Copy link
Member

@CajonCP4
Copy link

CajonCP4 commented Dec 1, 2020

@nachoparker Thank you very much! Installed the new update and everything worked fine!

@ovpc
Copy link
Collaborator

ovpc commented Dec 1, 2020

https://ownyourbits.com/downloads/NextCloudPi_RPi_11-27-20/
does not boot on my rpi2B (armv7), is that to be expected?

@Larsene
Copy link

Larsene commented Dec 1, 2020

does not boot on my rpi2B (armv7), is that to be expected?

yes. rpi2B cards are not ARM64.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests