Large file upload timeouts - where to fix?

Hi,

I’m running ncp in a KVM(qemu Debian 10 VM on Proxmox, using the curl installer.
I use a Nginx Proxy Manager in another Alpine VM as a reverse proxy.

When uploading files > 1 - 1.5GB to a publicly accessible file drop location the uploads fail after about 10-15%.

Looking at https://docs.nextcloud.com/server/stable/admin_manual/configuration_files/big_file_upload_configuration.html?highlight=uploading%20limit there are a lot of different places where this can go wrong so I’m trying to figure out where to start troubleshooting.

NextCloudPi diagnostics

NextCloudPi version  v1.44.5
NextCloudPi image    NextCloudPi_11-01-21
OS                   Debian GNU/Linux 10. 4.19.0-18-amd64 (x86_64)
automount            yes
USB devices          none
datadir              /data/ncdata
data in SD           no
data filesystem      ext2/ext3
data disk usage      2.1G/314G
rootfs usage         5.0G/62G
swapfile             /var/swap
dbdir                /var/lib/mysql
Nextcloud check      ok
Nextcloud version    21.0.4.1
HTTPD service        up
PHP service          up
MariaDB service      up
Redis service        up
HPB service          up
Postfix service      up
internet check       ok
port check 80        open
port check 443       open
IP                   ***REMOVED SENSITIVE VALUE***
gateway              ***REMOVED SENSITIVE VALUE***
interface            ens18
certificates         ***REMOVED SENSITIVE VALUE***
NAT loopback         no
uptime               1day

Nextcloud configuration

{
    "system": {
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": {
            "0": "localhost",
            "22": "192.168.0.107",
            "11": "88.129.115.246",
            "1": "192.168.0.107",
            "14": "nextcloudpi",
            "": "nextcloudpi",
            "20": "molnet.sfilm.se",
            "21": "nextcloud.sfilm.se"
        },
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "21.0.4.1",
        "overwrite.cli.url": "https:\/\/nextcloudpi\/",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "memcache.local": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 0,
            "timeout": 0,
            "password": "***REMOVED SENSITIVE VALUE***"
        },
        "tempdirectory": "\/data\/ncdata\/tmp",
        "mail_smtpmode": "sendmail",
        "mail_smtpauthtype": "LOGIN",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "preview_max_x": "2048",
        "preview_max_y": "2048",
        "jpeg_quality": "60",
        "overwriteprotocol": "https",
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "loglevel": "2",
        "log_type": "file",
        "maintenance": false,
        "logfile": "\/data\/ncdata\/nextcloud.log",
        "htaccess.RewriteBase": "\/",
        "theme": "",
        "ldapProviderFactory": "OCA\\User_LDAP\\LDAPProviderFactory",
        "mail_sendmailmode": "smtp",
        "mail_smtpsecure": "tls",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "587",
        "mail_smtpauth": 1
    }
}

HTTPd logs

[Thu Dec 02 00:00:01.701090 2021] [ssl:error] [pid 759:tid 140190989649024] AH02604: Unable to configure certificate localhost:4443:0 for stapling
[Thu Dec 02 00:00:01.702532 2021] [mpm_event:notice] [pid 759:tid 140190989649024] AH00489: Apache/2.4.38 (Debian) OpenSSL/1.1.1d configured -- resuming normal operations
[Thu Dec 02 00:00:01.703344 2021] [core:notice] [pid 759:tid 140190989649024] AH00094: Command line: '/usr/sbin/apache2'
[Thu Dec 02 15:24:16.767541 2021] [authz_host:error] [pid 27087:tid 140190909175552] [client 192.168.0.101:53489] AH01753: access check of 'localhost' to /ncp-output.php failed, reason: unable to get the remote host name
[Thu Dec 02 15:27:02.792597 2021] [authz_host:error] [pid 27087:tid 140190976317184] [client 192.168.0.101:53489] AH01753: access check of 'localhost' to / failed, reason: unable to get the remote host name
[Thu Dec 02 15:27:02.838968 2021] [authz_host:error] [pid 27087:tid 140190976317184] [client 192.168.0.101:53489] AH01753: access check of 'localhost' to / failed, reason: unable to get the remote host name
[Thu Dec 02 15:27:02.839255 2021] [authz_host:error] [pid 27087:tid 140190976317184] [client 192.168.0.101:53489] AH01753: access check of 'localhost' to /index.php failed, reason: unable to get the remote host name
[Thu Dec 02 15:27:02.867394 2021] [authz_host:error] [pid 27087:tid 140190976317184] [client 192.168.0.101:53489] AH01753: access check of 'localhost' to /index.php failed, reason: unable to get the remote host name
[Thu Dec 02 15:27:03.505138 2021] [authz_host:error] [pid 27087:tid 140190682572544] [client 192.168.0.101:53489] AH01753: access check of 'localhost' to /img/loading-small.gif failed, reason: unable to get the remote host name
[Thu Dec 02 15:27:03.507197 2021] [authz_host:error] [pid 27087:tid 140190976317184] [client 192.168.0.101:53489] AH01753: access check of 'localhost' to /js/minified.js failed, reason: unable to get the remote host name
[Thu Dec 02 15:27:03.507376 2021] [authz_host:error] [pid 27087:tid 140190959531776] [client 192.168.0.101:53489] AH01753: access check of 'localhost' to /js/ncp.js failed, reason: unable to get the remote host name
[Thu Dec 02 15:27:03.507696 2021] [authz_host:error] [pid 27087:tid 140190917568256] [client 192.168.0.101:53489] AH01753: access check of 'localhost' to /css/ncp.css failed, reason: unable to get the remote host name
[Thu Dec 02 15:27:03.507847 2021] [authz_host:error] [pid 27087:tid 140190674179840] [client 192.168.0.101:53489] AH01753: access check of 'localhost' to /img/ncp-logo.svg failed, reason: unable to get the remote host name
[Thu Dec 02 15:27:03.636278 2021] [authz_host:error] [pid 27087:tid 140190909175552] [client 192.168.0.101:53489] AH01753: access check of 'localhost' to /ncp-launcher.php failed, reason: unable to get the remote host name
[Thu Dec 02 15:27:03.720488 2021] [authz_host:error] [pid 27087:tid 140190959531776] [client 192.168.0.101:53489] AH01753: access check of 'localhost' to /img/favicon.png failed, reason: unable to get the remote host name
[Thu Dec 02 15:27:03.720488 2021] [authz_host:error] [pid 27087:tid 140190976317184] [client 192.168.0.101:53489] AH01753: access check of 'localhost' to /ncp-output.php failed, reason: unable to get the remote host name
[Thu Dec 02 15:27:10.342828 2021] [authz_host:error] [pid 27087:tid 140190909175552] [client 192.168.0.101:53489] AH01753: access check of 'localhost' to /ncp-launcher.php failed, reason: unable to get the remote host name
[Thu Dec 02 15:27:10.352627 2021] [authz_host:error] [pid 27087:tid 140190909175552] [client 192.168.0.101:53489] AH01753: access check of 'localhost' to /img/download.svg failed, reason: unable to get the remote host name
[Thu Dec 02 15:27:10.352660 2021] [authz_host:error] [pid 27087:tid 140190959531776] [client 192.168.0.101:53489] AH01753: access check of 'localhost' to /img/delete.svg failed, reason: unable to get the remote host name
[Thu Dec 02 15:27:10.355265 2021] [authz_host:error] [pid 27087:tid 140190959531776] [client 192.168.0.101:53489] AH01753: access check of 'localhost' to /ncp-launcher.php failed, reason: unable to get the remote host name

Database logs


Nextcloud logs

{"reqId":"kM5dIctSqm8kG7E9nOGp","level":2,"time":"2021-12-02T01:00:07+00:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"Host nextcloudpi was not connected to because it violates local access rules","userAgent":"--","version":"21.0.4.1"}
{"reqId":"hUxxWyNDMfm6rJjCzFsU","level":2,"time":"2021-12-02T01:00:07+00:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"Host nextcloudpi was not connected to because it violates local access rules","userAgent":"--","version":"21.0.4.1"}
{"reqId":"hUxxWyNDMfm6rJjCzFsU","level":2,"time":"2021-12-02T01:00:08+00:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"Host nextcloudpi was not connected to because it violates local access rules","userAgent":"--","version":"21.0.4.1"}
{"reqId":"hUxxWyNDMfm6rJjCzFsU","level":2,"time":"2021-12-02T01:00:08+00:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"Host nextcloudpi was not connected to because it violates local access rules","userAgent":"--","version":"21.0.4.1"}
{"reqId":"VDOegTm2VrdFzoRrlmFm","level":2,"time":"2021-12-02T01:00:08+00:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"Host nextcloudpi was not connected to because it violates local access rules","userAgent":"--","version":"21.0.4.1"}
{"reqId":"hUxxWyNDMfm6rJjCzFsU","level":2,"time":"2021-12-02T01:00:08+00:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"Host nextcloudpi was not connected to because it violates local access rules","userAgent":"--","version":"21.0.4.1"}
{"reqId":"kM5dIctSqm8kG7E9nOGp","level":2,"time":"2021-12-02T01:00:09+00:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"Host nextcloudpi was not connected to because it violates local access rules","userAgent":"--","version":"21.0.4.1"}
{"reqId":"VDOegTm2VrdFzoRrlmFm","level":2,"time":"2021-12-02T01:00:10+00:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"Host nextcloudpi was not connected to because it violates local access rules","userAgent":"--","version":"21.0.4.1"}
{"reqId":"VDOegTm2VrdFzoRrlmFm","level":2,"time":"2021-12-02T01:00:10+00:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"Host nextcloudpi was not connected to because it violates local access rules","userAgent":"--","version":"21.0.4.1"}
{"reqId":"kM5dIctSqm8kG7E9nOGp","level":2,"time":"2021-12-02T01:00:10+00:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"Host nextcloudpi was not connected to because it violates local access rules","userAgent":"--","version":"21.0.4.1"}
{"reqId":"kM5dIctSqm8kG7E9nOGp","level":2,"time":"2021-12-02T01:00:10+00:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"Host nextcloudpi was not connected to because it violates local access rules","userAgent":"--","version":"21.0.4.1"}
{"reqId":"VDOegTm2VrdFzoRrlmFm","level":2,"time":"2021-12-02T01:00:10+00:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"Host nextcloudpi was not connected to because it violates local access rules","userAgent":"--","version":"21.0.4.1"}
{"reqId":"kM5dIctSqm8kG7E9nOGp","level":2,"time":"2021-12-02T01:00:12+00:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"Host nextcloudpi was not connected to because it violates local access rules","userAgent":"--","version":"21.0.4.1"}
{"reqId":"hUxxWyNDMfm6rJjCzFsU","level":2,"time":"2021-12-02T01:00:12+00:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"Host nextcloudpi was not connected to because it violates local access rules","userAgent":"--","version":"21.0.4.1"}
{"reqId":"hUxxWyNDMfm6rJjCzFsU","level":2,"time":"2021-12-02T01:00:12+00:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"Host nextcloudpi was not connected to because it violates local access rules","userAgent":"--","version":"21.0.4.1"}
{"reqId":"VDOegTm2VrdFzoRrlmFm","level":2,"time":"2021-12-02T01:00:12+00:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"Host nextcloudpi was not connected to because it violates local access rules","userAgent":"--","version":"21.0.4.1"}
{"reqId":"kM5dIctSqm8kG7E9nOGp","level":2,"time":"2021-12-02T01:00:12+00:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"Host nextcloudpi was not connected to because it violates local access rules","userAgent":"--","version":"21.0.4.1"}
{"reqId":"kM5dIctSqm8kG7E9nOGp","level":2,"time":"2021-12-02T01:00:12+00:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"Host nextcloudpi was not connected to because it violates local access rules","userAgent":"--","version":"21.0.4.1"}
{"reqId":"kM5dIctSqm8kG7E9nOGp","level":2,"time":"2021-12-02T01:00:12+00:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"Host nextcloudpi was not connected to because it violates local access rules","userAgent":"--","version":"21.0.4.1"}
{"reqId":"kM5dIctSqm8kG7E9nOGp","level":2,"time":"2021-12-02T01:00:12+00:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"Host nextcloudpi was not connected to because it violates local access rules","userAgent":"--","version":"21.0.4.1"}

In ncp-config->nc-limits I have:
image

There is also a “Max transfer time” setting in ncp-config->nc-nextcloud
image
But I don’t want to touch it due to the “wipe your instance” warning.

htop while uploading a 2GB file:
image
reverse proxy on the left, ncp on the right.

It seems the problem is not the memory but some timeout setting, either in apache/php on the ncp side, or in nginx on the reverse proxy side.

Anyone have experience with this?
cheers

Did some further reading (the nextcloud page I had open in one of the previous screenshots).

It seems nginx writes the file chunks to a /tmp location before passing it onto nextcloud, since the vm is using a lvm-thin system I just made its root partition bigger and voila!

Now I will need to change fastcgi_request_buffering off; as this file drop might be used by multiple people at the same time in the future at which point the /tmp might run out of space.