Nextcloud AIO with apache2 reverse proxy fails on large file upload

Hi,

So I made a (actually many) fresh install of nextcloud AIO, but keep hitting the same problem. When uploading Larger files >2/3Gb (doesnt seem to be consistent) the upload often fails, or manages to upload but still shows errors to the user. Smaller files work without issues.

To note:

  • I do not use CloudFlare
  • I have a apache web server that servers as a reverse proxy
  • I use a NFS/cifs share for the nextcloud data directory

The containers are being started with the following command:
docker run --init --sig-proxy=false --name nextcloud-aio-mastercontainer --restart always --publish 8080:8080 --env APACHE_PORT=11000 --env APACHE_IP_BINDING=0.0.0.0 --env APACHE_BODY_LIMIT=0 --env NEXTCLOUD_MOUNT="/mnt/nextcloud" --env NEXTCLOUD_DATADIR="/mnt/nextcloud/nextcloudData" --env NEXTCLOUD_UPLOAD_LIMIT=64G --env PHP_UPLOAD_LIMIT=64G --env POST_MAX_SIZE=64G --env MAX_INPUT_TIME=3600 --env MAX_EXECUTION_TIME=3600 --volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config --volume /var/run/docker.sock:/var/run/docker.sock:ro --env NEXTCLOUD_MEMORY_LIMIT=4096M nextcloud/all-in-one:latest

The apache config is:

<IfModule mod_ssl.c>
<VirtualHost *:443>
        ServerName my.server.name

        ServerAdmin 
        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
        # error, crit, alert, emerg.
        # It is also possible to configure the loglevel for particular
        # modules, e.g.
        #LogLevel info ssl:warn

        ErrorLog ${APACHE_LOG_DIR}/my_server_name_error.log
        CustomLog ${APACHE_LOG_DIR}/my_server_name_access.log combined

        # Reverse proxy based on https://httpd.apache.org/docs/current/mod/mod_proxy_wstunnel.html
        RewriteEngine On
        ProxyPreserveHost On
        RequestHeader set X-Real-IP %{REMOTE_ADDR}s
        AllowEncodedSlashes NoDecode

        ProxyPass / http://10.0.102.102:11000/ nocanon
        ProxyPassReverse / http://10.0.102.102:11000/

        RewriteCond %{HTTP:Upgrade} websocket [NC]
        RewriteCond %{HTTP:Connection} upgrade [NC]
        RewriteCond %{THE_REQUEST} "^[a-zA-Z]+ /(.*) HTTP/\d+(\.\d+)?$"
        RewriteRule .? "ws://10.0.102.102:11000/%1" [P,L,UnsafeAllow3F]

        # Enable h2, h2c and http1.1
        Protocols h2 h2c http/1.1

        # Solves slow upload speeds caused by http2
        H2WindowSize 5242880

        # TLS
        SSLEngine               on
        SSLProtocol             -all +TLSv1.2 +TLSv1.3
        SSLCipherSuite          ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305
        SSLHonorCipherOrder     off
        SSLSessionTickets       off

        SSLCertificateFile /etc/letsencrypt/live/my.server.name/fullchain.pem
        SSLCertificateKeyFile /etc/letsencrypt/live/my.server.name/privkey.pem
        Include /etc/letsencrypt/options-ssl-apache.conf

        # Disable HTTP TRACE method.
        TraceEnable off
        <Files ".ht*">
                Require all denied
        </Files>

        # Support big file uploads
        LimitRequestBody 0
        Timeout 86400
        ProxyTimeout 86400

</VirtualHost>
</IfModule>

I tired:
-Full wipe of the AIO (per wiki) multiple times

  • Running the AIO on another VM
  • Not using the shares (in case this is a NFS/mount error)

The only error I see in the logs are multiple instances of:


BadRequest Expected filesize of 10485760 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 10477568 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.

Upload how? Via the web UI? One of the official client apps? etc
What precisely happens and what error is shown to the user?

It would also be helpful if you filled out the support template.

Any chance you’re on a 32-bit platform?