Unable to download folder with multiple files

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version: 21.0.3
Operating system and version: RPI 4 (8gb ram) - Linux raspberrypi 5.10.17-v7l+
Apache : Server version: Apache/2.4.38 (Raspbian)
Server built: 2021-06-10T10:13:06
PHP version : PHP 7.3.29-1~deb10u1 (cli) (built: Jul 2 2021 04:04:33) ( NTS )

The issue :

Can not download a folder containing multiple files in it. Always results in “Internal Server Error” response.

I can download a large single fine just fine but small multiple files can not be downloaded at all.

Is this the first time you’ve seen this error? N

Steps to replicate it:

  1. Open a folder with multiple files in it
  2. Click Download on the folder
  3. Get redirected to “Internal Server Error” page.

Where did you install your system from?
A link to instructions or howto you followed should do.

What do the server logs say?

Thanks for the response.
I followed these instructions: https://pimylifeup.com/raspberry-pi-nextcloud-server/

Server logs when I try to download a folder:

{“reqId”:“QQYg2GXOoXECcMlzAwgJ”,“level”:3,“time”:“August 08, 2021 11:28:26”,“remoteAddr”:“223.177.147.195”,“user”:“sanyog”,“app”:“index”,“method”:“GET”,“url”:"/index.php/apps/files/ajax/download.php?dir=%2F&files=Kashmir&downloadStartSecret=zypj8x830b",“message”:{“Exception”:“TypeError”,“Message”:“Argument 2 passed to OC\Streamer::__construct() must be of the type int, float given, called in /var/www/nextcloud/lib/private/legacy/OC_Files.php on line 164”,“Code”:0,“Trace”:[{“file”:"/var/www/nextcloud/lib/private/legacy/OC_Files.php",“line”:164,“function”:"__construct",“class”:“OC\Streamer”,“type”:"->",“args”:[{“class”:“OC\AppFramework\Http\Request”},18396232783,1108]},{“file”:"/var/www/nextcloud/apps/files/ajax/download.php",“line”:64,“function”:“get”,“class”:“OC_Files”,“type”:"::",“args”:["/",“Kashmir”,{“head”:false}]},{“file”:"/var/www/nextcloud/lib/private/Route/Route.php",“line”:156,“args”:["/var/www/nextcloud/apps/files/ajax/download.php"],“function”:“require_once”},{“function”:“OC\Route\{closure}”,“class”:“OC\Route\Route”,“type”:"->",“args”:["*** sensitive parameters replaced ***"]},{“file”:"/var/www/nextcloud/lib/private/Route/Router.php",“line”:310,“function”:“call_user_func”,“args”:[{“class”:“Closure”},{"_route":“files_ajax_download”}]},{“file”:"/var/www/nextcloud/lib/base.php",“line”:993,“function”:“match”,“class”:“OC\Route\Router”,“type”:"->",“args”:["/apps/files/ajax/download.php"]},{“file”:"/var/www/nextcloud/index.php",“line”:37,“function”:“handleRequest”,“class”:“OC”,“type”:"::",“args”:}],“File”:"/var/www/nextcloud/lib/private/Streamer.php",“Line”:56,“CustomMessage”:"–"},“userAgent”:“Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36”,“version”:“21.0.3.1”}

Error when I try to download multiple files by selecting:

image

Server logs when try to download multiple files by selecting:

{“reqId”:“9Ujz2QbVpeALxq2KCu8c”,“level”:3,“time”:“August 08, 2021 11:31:23”,“remoteAddr”:“223.177.147.195”,“user”:“sanyog”,“app”:“index”,“method”:“GET”,“url”:"/index.php/apps/files/ajax/download.php?dir=%2FKashmir&files=Phone&downloadStartSecret=7apmc0x9juk",“message”:{“Exception”:“TypeError”,“Message”:“Argument 2 passed to OC\Streamer::__construct() must be of the type int, float given, called in /var/www/nextcloud/lib/private/legacy/OC_Files.php on line 164”,“Code”:0,“Trace”:[{“file”:"/var/www/nextcloud/lib/private/legacy/OC_Files.php",“line”:164,“function”:"__construct",“class”:“OC\Streamer”,“type”:"->",“args”:[{“class”:“OC\AppFramework\Http\Request”},13759309304,404]},{“file”:"/var/www/nextcloud/apps/files/ajax/download.php",“line”:64,“function”:“get”,“class”:“OC_Files”,“type”:"::",“args”:["/Kashmir",“Phone”,{“head”:false}]},{“file”:"/var/www/nextcloud/lib/private/Route/Route.php",“line”:156,“args”:["/var/www/nextcloud/apps/files/ajax/download.php"],“function”:“require_once”},{“function”:“OC\Route\{closure}”,“class”:“OC\Route\Route”,“type”:"->",“args”:["*** sensitive parameters replaced ***"]},{“file”:"/var/www/nextcloud/lib/private/Route/Router.php",“line”:310,“function”:“call_user_func”,“args”:[{“class”:“Closure”},{"_route":“files_ajax_download”}]},{“file”:"/var/www/nextcloud/lib/base.php",“line”:993,“function”:“match”,“class”:“OC\Route\Router”,“type”:"->",“args”:["/apps/files/ajax/download.php"]},{“file”:"/var/www/nextcloud/index.php",“line”:37,“function”:“handleRequest”,“class”:“OC”,“type”:"::",“args”:}],“File”:"/var/www/nextcloud/lib/private/Streamer.php",“Line”:56,“CustomMessage”:"–"},“userAgent”:“Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36”,“version”:“21.0.3.1”}

Please help me diagnose this and fix this :’(

Looks like I fixed the issue myself.

In /var/www/nextcloud/lib/private/Streamer.php

replaced
public function __construct(IRequest $request, int $size, int $numberOfFiles)

with
public function __construct(IRequest $request, float $size, int $numberOfFiles)

Now when I click on Download All button or download multiple files, it creates a zip and starts downloading.

For “request URL too long error”,

Open /etc/apache2/apache2.conf

and insert under AccessFileName .htaccess:

LimitRequestLine 1000000
LimitRequestFieldSize 1000000

Now I found a new issue. Suppose a folder is of 10GB
I click download and it gets zipped and starts to download. The download always ends after 4GB of data downloaded. I open zip and it seems a bit corrupt and has less files. It seems its not downloading more than 4 GB. Or it is not zipping more than 4Gb of data.

Please help with this

Well that seems to be my OS issue. Im running Raspbian 32 bit. Upgrading to 64 bit shall fix the 4GB limit issue.

1 Like

Hello!

Do I need I complete reinstall for that or is it possible to upgrade that from NCP panel?