Zip file download often fails

Nextcloud version (eg, 20.0.5):
Operating system and version (eg, Ubuntu 20.04): Debian 4.19.260-1
Apache or nginx version (eg, Apache 2.4.25): Apache
PHP version (eg, 7.4): 8.1

I’m trying to download a collection of photos as a zip file via the Download all button (in Firefox Android). The file size of the full archive is ~175 MB but more often than not, the download stalls at ~160 MB-173 MB for no apparent reason and eventually fails. Sometimes it succeeds, though, but it seems more or less random. I’m quite certain it is not the internet connection and I’m suspecting some mis-configuration, maybe php or caching options etc… I don’t remember having these problems with NC 24 but maybe I was just lucky.

The other threads I found with a similar issue were all talking about much larger files (500 MB-1.5GB).


$CONFIG = array (
  'passwordsalt' => 'xxx',
  'secret' => 'xxx',
  'trusted_domains' => 
  array (
    0 => 'localhost',
    1 => '',
    2 => 'xxx.x',
    3 => '',
  'datadirectory' => '/data/web/xxx/html/nc/data',
  'overwrite.cli.url' => 'http://localhost',
  'dbtype' => 'mysql',
  'version' => '',
  'dbname' => 'xxx',
  'dbhost' => 'localhost:/data/sockets/mysql80/mysqld.sock',
  'dbport' => '3307',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'xxx',
  'dbpassword' => 'xxx',
  'installed' => true,
  'instanceid' => 'xxx',
  'maintenance' => false,
  'default_phone_region' => 'at',
  'theme' => '',
  'loglevel' => 2,
  'defaultapp' => 'files',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'mail_smtpmode' => 'smtp',
  'mail_smtphost' => 'xxx',
  'mail_smtpauthtype' => 'PLAIN',
  'mail_sendmailmode' => 'smtp',
  'mail_smtpsecure' => 'ssl',
  'mail_from_address' => 'nc-admin',
  'mail_domain' => 'xxx',
  'mail_smtpauth' => 1,
  'mail_smtpname' => 'xxx',
  'mail_smtppassword' => 'xxx',
  'mail_smtpport' => '465',

The first step is to inspect the error logs of your NC/PHP. It might be memory limitations or similar.

Another thing you can do is open your browser’s developer tools and check in the Network tab if there is anything to find in the request and its result.

Either way, establishing the exact symptoms of the problem is arguably the very first step (even before checking the logs).

The admin log just shows these (unrelated?) messages:

Debug	cron	Finished OCA\Files_Versions\BackgroundJob\ExpireVersions job with ID 11 in 0 seconds	
Debug	cron	Run OCA\Files_Versions\BackgroundJob\ExpireVersions job with ID 11	
Debug	cron	WebCron call has selected job with ID 11	
Debug	logreader	Could not find resource file "/apps/logreader/css/../js/logreader-main.css"	

Expanding on the symptoms I’ve written already: When I download an on-the-fly generated zip file (that should contain multiple files), the download is somehow streamed to the browser (no definitive size is given). A temporary file is being created whose file size steadily increases, but just before the whole file size is reached (some kB missing; the amount changes), the download just stops! The temporary file is then converted to but that file is corrupt, probably due to some of the data missing.

Unfortunately, I don’t have developer tools on Firefox Android available.

The download in Firefox Desktop succeeds most of the time but I remember I also had it failing sometimes. Right now, I tried it multiple times on FF Desktop and it worked, and multiple times on FF Mobile and it failed. It sometimes succeeded in Chrome Android but the last two times I tried it, it also failed with the same symptoms as in FF.
Maybe it’s an Android problem…?

Why do you not use the Nextcloud Android app ? I think nobody uses the browser on Android to access Nextcloud.

The reason is that I send download links to others not using NextCloud.