Nextcloud version (eg, 12.0.2): 18.0.6
Operating system and version (eg, Ubuntu 17.04): U18.0.4
Apache or nginx version (eg, Apache 2.4.25): Apache/2.4.41
PHP version (eg, 7.1): PHP 7.3.12
Download of large files takes an excrutiating time to START… (transfer rates are fine)
Good day to all,
I’ve been having this problem for quite some time now, and can’t seem to get my head around it.
Downloading any large file (>500Mo) through the web interface, or through a share link, takes an awfully long time to start.
Once “Download” is selected, the browser starts loading, like when you load a large or slow page, and then eventually starts the download after minutes. Sometimes after a minute or two, but for larger files (>2Go) can take about 15 minutes. I haven’t tried for files larger than 4Go, but can only imagine…
Transfer rates are fine once download starts, it’s just the time it takes to start.
This is of course extremely frustrating. And have no idea where to start looking…
Description screenshots with a 1,5GB test file on internal data drive :
Is this the first time you’ve seen this error? (Y/N): N
Steps to replicate it:
- Select “download” from three dots action button of a file, or from download button of a share link
- Wait for download to start…
HOWEVER :
If I disable (a2dismod) http2, the problem vanishes…
The output of your Nextcloud log in Admin > Logging:
None related (warnings from news app regarding empty streams, and other debug notifications from music app)
The output of your config.php file in /path/to/nextcloud
(make sure you remove any identifiable information!):
<?php
$CONFIG = array (
'instanceid' => '---',
'passwordsalt' => '---',
'secret' => '---',
'trusted_domains' =>
array (
0 => '---',
1 => '---',
),
'datadirectory' => '---',
'dbtype' => 'mysql',
'version' => '18.0.6.0',
'overwrite.cli.url' => 'https://---',
'dbname' => '---',
'dbhost' => '---',
'dbport' => '',
'dbtableprefix' => '---',
'dbuser' => '---',
'dbpassword' => '---',
'installed' => true,
'maintenance' => false,
'enable_previews' => true,
'enabledPreviewProviders' =>
array (
0 => 'OC\\Preview\\PNG',
1 => 'OC\\Preview\\JPEG',
2 => 'OC\\Preview\\GIF',
3 => 'OC\\Preview\\BMP',
4 => 'OC\\Preview\\XBitmap',
5 => 'OC\\Preview\\Movie',
6 => 'OC\\Preview\\PDF',
7 => 'OC\\Preview\\MP3',
8 => 'OC\\Preview\\TXT',
9 => 'OC\\Preview\\MarkDown',
10 => 'OC\\Preview\\TIFF',
),
'filesystem_check_changes' => 0,
'filelocking.enabled' => 'true',
'integrity.check.disabled' => false,
'knowledgebaseenabled' => false,
'logfile' => '/var/log/nextcloud.log',
'loglevel' => 2,
'logtimezone' => 'Europe/---',
'log_rotate_size' => 104857600,
'memcache.local' => '\\OC\\Memcache\\APCu',
'memcache.locking' => '\\OC\\Memcache\\Redis',
'overwriteprotocol' => 'https',
'preview_max_x' => 1024,
'preview_max_y' => 768,
'preview_max_scale_factor' => 1,
'redis' =>
array (
'host' => '/var/run/redis/redis-server.sock',
'port' => 0,
'timeout' => 0.0,
),
'quota_include_external_storage' => false,
'share_folder' => '/',
'skeletondirectory' => '',
'theme' => '',
'trashbin_retention_obligation' => 'auto, 7',
'updater.release.channel' => 'stable',
'mysql.utf8mb4' => true,
'app_install_overwrite' =>
array (
0 => 'files_reader',
),
'updater.secret' => '---',
);
The output of your Apache/nginx/system log in /var/log/____
:
-IP- - - [10/Jun/2020:21:29:17 +0200] "PROPFIND /remote.php/dav/files/---/requested file HTTP/2.0" 207 4471 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:77.0) Gecko/20100101 Firefox$
-IP- - - [10/Jun/2020:21:29:17 +0200] "GET /ocs/v2.php/apps/text/workspace?path=%path-to-requested-file HTTP/2.0" 404 182 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:77.0) Gecko/20100101 Firefox/$
-IP- - - [10/Jun/2020:21:29:18 +0200] "GET /index.php/apps/files/ajax/getstoragestats.php?dir=path-to-requested-file HTTP/2.0" 200 285 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv$
-IP- - - [10/Jun/2020:21:30:36 +0200] "GET /remote.php/webdav/requested-file?downloadStartSecret=--- HTTP/2.0" 200 927091088 "-"$
This 1.4Go file actually took about 5 whole minutes before download actually started...
.htaccess file at nextcloud root :
<IfModule mod_headers.c>
<IfModule mod_setenvif.c>
<IfModule mod_fcgid.c>
SetEnvIfNoCase ^Authorization$ "(.+)" XAUTHORIZATION=$1
RequestHeader set XAuthorization %{XAUTHORIZATION}e env=XAUTHORIZATION
</IfModule>
<IfModule mod_proxy_fcgi.c>
SetEnvIfNoCase Authorization "(.+)" HTTP_AUTHORIZATION=$1
</IfModule>
</IfModule>
<IfModule mod_env.c>
Header onsuccess unset Referrer-Policy
Header always set Referrer-Policy "no-referrer"
Header onsuccess unset X-Content-Type-Options
Header always set X-Content-Type-Options "nosniff"
Header onsuccess unset X-Download-Options
Header always set X-Download-Options "noopen"
Header onsuccess unset X-Frame-Options
Header always set X-Frame-Options "SAMEORIGIN"
Header onsuccess unset X-Permitted-Cross-Domain-Policies
Header always set X-Permitted-Cross-Domain-Policies "none"
Header onsuccess unset X-Robots-Tag
Header always set X-Robots-Tag "none"
Header onsuccess unset X-XSS-Protection
Header always set X-XSS-Protection "1; mode=block"
SetEnv modHeadersAvailable true
</IfModule>
# Add cache control for static resources
<FilesMatch "\.(css|js|svg|gif)$">
Header set Cache-Control "max-age=15778463"
</FilesMatch>
# Let browsers cache WOFF files for a week
<FilesMatch "\.woff2?$">
Header set Cache-Control "max-age=604800"
</FilesMatch>
</IfModule>
<IfModule mod_php7.c>
php_value mbstring.func_overload 0
php_value default_charset 'UTF-8'
php_value output_buffering 0
<IfModule mod_env.c>
SetEnv htaccessWorking true
</IfModule>
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} DavClnt
RewriteRule ^$ /remote.php/webdav/ [L,R=302]
RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteRule ^\.well-known/host-meta /public.php?service=host-meta [QSA,L]
RewriteRule ^\.well-known/host-meta\.json /public.php?service=host-meta-json [QSA,L]
RewriteRule ^\.well-known/webfinger /public.php?service=webfinger [QSA,L]
RewriteRule ^\.well-known/nodeinfo /public.php?service=nodeinfo [QSA,L]
RewriteRule ^\.well-known/carddav /remote.php/dav/ [R=301,L]
RewriteRule ^\.well-known/caldav /remote.php/dav/ [R=301,L]
RewriteRule ^remote/(.*) remote.php [QSA,L]
RewriteRule ^(?:build|tests|config|lib|3rdparty|templates)/.* - [R=404,L]
RewriteCond %{REQUEST_URI} !^/\.well-known/(acme-challenge|pki-validation)/.*
RewriteRule ^(?:\.|autotest|occ|issue|indie|db_|console).* - [R=404,L]
</IfModule>
<IfModule mod_mime.c>
AddType image/svg+xml svg svgz
AddEncoding gzip svgz
</IfModule>
<IfModule mod_dir.c>
DirectoryIndex index.php index.html
</IfModule>
AddDefaultCharset utf-8
Options -Indexes
<IfModule pagespeed_module>
ModPagespeed Off
</IfModule>
ErrorDocument 403 //
ErrorDocument 404 //
NC Data drive, Internal Sata drive, 4To, Ext4 formatted, mounted with fstab as such :
UUID=0d39d317-6a21-4860-b1c4-5e317ebc561e /media/INT4To auto nosuid,nodev,nofail,x-gvfs-show,x-gvfs-name=INT4To 0 0