nextcloud_ynh icon indicating copy to clipboard operation
nextcloud_ynh copied to clipboard

Nextcloud aborts file downloads from samba external storage after 1GB

Open mdimura opened this issue 4 years ago • 7 comments

Nextcloud aborts the downloading of a file after 1GB, if it is on an external samba storage. When I download large files from the local storage via nextcloud - everything works fine. I thought it is due to the proxy_buffering:

By default, downloads will be limited to 1GB due to proxy_buffering and proxy_max_temp_file_size on the frontend.

but setting proxy_buffering off; in /etc/nginx/.../nextcloud.conf and even nginx.conf did not help. I also checked the logs, but nothing stands out:

nginx/xxx-access.log:174.11.2.119 - - [05/Sep/2019:16:02:41 +0300] "GET /nextcloud/remote.php/webdav/xxx/test3GB.mkv?downloadStartSecret=p6qwexyz12 HTTP/2.0" 200 1074641798 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0"

Note the 1074641798 in the request size. The file is actually ~3GB.

mdimura avatar Sep 05 '19 12:09 mdimura

I have the same issue. Haven't been able to fix it nor find out where the issue is coming from

sjurske avatar Oct 06 '19 14:10 sjurske

I can confirm this issue, too. For me, the limit is exactly 1,090,519,040 bytes, tried it several times.

However - and this is where things get fuzzy - I only seem to hit that limit if the download takes longer than a few minutes (I don't know exactly how long). In other words, if you are fast enough, you can download large files normally, I just don't know how fast and why this happens. As soon as the timeout is exceeded, the limit seems to be 1GB.

In my case, I tried to download the same ~18.5GB file with a 5 MBit/s limit, and it failed always at the 1GB limit. Then, I downloaded the same file without speed limit (got ~290 MBit/s) and it worked normally.

MrShoenel avatar Jan 07 '20 16:01 MrShoenel

Update: It seems the issue has something to do with the smbclient that NC uses when an external storage is configured using SMB/Cifs. If I do mount the same directory in the OS by myself (using mount.cifs) and then configure an external storage to use that local folder, the downloads seem to be working normally.

MrShoenel avatar Jan 07 '20 17:01 MrShoenel

@MrShoenel, same for me

mdimura avatar Jan 07 '20 17:01 mdimura

I'm on nextcloud 23.0.1 and have the same issue. Download of files which are stored on smb/cifs times out (download size at that point is around 500 mb). Nextcloud is behind a nginx proxy and disabling buffering doesn't have an influence. I also increased the timeout of the share according to https://github.com/nextcloud/server/pull/17258 but that didn't change anything.

XueSheng-GIT avatar Feb 08 '22 11:02 XueSheng-GIT

@XueSheng-GIT see my last comment for a working workaround, should that be an option for you. I have been using it since then without problems. For example, mount your network share under /mnt/share, and then configure an external storage in NC using the type Local and the path as configuration.

MrShoenel avatar Jun 02 '22 19:06 MrShoenel

Thanks for your suggestion! My issue was solved already: https://github.com/nextcloud/server/issues/31308#issuecomment-1048678975 Seems I forgot to mention this in this report, sorry.

XueSheng-GIT avatar Jun 02 '22 19:06 XueSheng-GIT

Thanks for reporting your issue is solved :) I close this ticket

zamentur avatar Aug 07 '23 19:08 zamentur