Unable to upload files above 5MB - Docker AIO behind Traefik

Hi,

I have been encountering an issue with my nextcloud install after doing a clean install.
It’s really really frustrating because I can’t get to find a solution that would make sense. And I don’t see why just 5MB when I set all the right limits everywhere.
I am unable to upload files above 5MB. I tried from the desktop client, the web browser ( Firefox, Edge ), mobile app on Android. Still the same issue.
The desktop client is just stating there’s an error and check the logs.
When looking it says :

Error
Error transfering https://cloud.example.org/remote.php/dav/files/user/file.pdf - server replied: Not Found

Troubleshooting :

  • I tried changing values for maxRequestBodyBytes in the traefik middeware configuration file, without success.
  • I changed the values for maxChunkSize in the desktop client configuration file.
  • I used the occ command to change the files.chunked_upload.max_size value to 0 using : config:system:set --type int --value 0 files.chunked_upload.max_size
  • I changed the value max_chunk_size too : config:app:set files max_chunk_size --value 524288000
  • Restarted Nextcloud, restarted the client, logged in and out, used occ files:scan

Errors in the logs (from the UI under Administration->Logging)

Error	no app in context	
BadRequest Expected filesize of 12884654 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 4808704 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.
Debug	webdav	
NotAuthenticated No 'Authorization: Basic' header found. Either the client didn't send one, or the server is misconfigured, No 'Authorization: Bearer' header found. Either the client didn't send one, or the server is mis-configured
Debug	webdav	
NotAuthenticated No public access to this resource., No 'Authorization: Basic' header found. Either the client didn't send one, or the server is misconfigured, No 'Authorization: Bearer' header found. Either the client didn't send one, or the server is mis-configured, No 'Authorization: Basic' header found. Either the client didn't send one, or the server is misconfigured
Debug	no app in context	
Exception No parameters in call to OC\DB\QueryBuilder\ExpressionBuilder\ExpressionBuilder::orX
Calling OCP\DB\QueryBuilder\IQueryBuilder::orX without parameters is deprecated and will throw soon. 
Debug	no app in context	
Exception dirty table reads: SELECT `fileid` FROM `*PREFIX*filecache` WHERE (`storage` = :dcValue1) AND (`path_hash` = :dcValue2)

Current Configuration and installation method:

Configuration:

I am running Nextcloud Docker AIO in a virtual machine in proxmox.
The nextcloud data folder is mounted via an NFS share from my Synology NAS.

  • Nextcloud AIO v10.5.0
  • Nextcloud Hub 9 (30.0.5)

System:

Operating System: Linux 6.8.0-53-generic x86_64
CPU: QEMU Virtual CPU version 2.5+ (4 threads)
Memory: 11.40 GB
(running in a virtual machine on proxmox using Docker AIO)

PHP:

Version: 8.3.16
Memory limit: 8.8 GB
Max execution time: 7200
Upload max size: 12 GB
OPcache Revalidate Frequency: 60
Extensions: Core, date, libxml, openssl, pcre, sqlite3, zlib, ctype, curl, dom, fileinfo, filter, hash, iconv, json, mbstring, SPL, session, PDO, pdo_sqlite, bz2, posix, random, readline, Reflection, standard, SimpleXML, tokenizer, xml, xmlreader, xmlwriter, mysqlnd, cgi-fcgi, apcu, bcmath, Phar, exif, ftp, gd, gmp, igbinary, imagick, imap, intl, ldap, memcached, pcntl, pdo_pgsql, pgsql, redis, smbclient, sodium, sysvsem, zip, libsmbclient, Zend OPcache

Database:

Type: pgsql
Version: PostgreSQL 16.6 on x86_64-pc-linux-musl, compiled by gcc (Alpine 14.2.0) 14.2.0, 64-bit
Size: 156.3 MB

Docker configuration

Docker-compose.yml

services:
  nextcloud-aio-mastercontainer:
    image: nextcloud/all-in-one:latest
    init: true
    restart: unless-stopped
    container_name: nextcloud-aio-mastercontainer
    volumes:
      - nextcloud_aio_mastercontainer:/mnt/docker-aio-config 
      - /var/run/docker.sock:/var/run/docker.sock:ro 
    ports:
      - 8080:8080
    environment: 
      - APACHE_PORT=11000 
      - APACHE_IP_BINDING=10.x.x.x
      - NEXTCLOUD_DATADIR=/mnt/nfs/nextcloud/data 
      - SKIP_DOMAIN_VALIDATION=true
      - NEXTCLOUD_UPLOAD_LIMIT=12G 
      - NEXTCLOUD_MAX_TIME=7200 
      - NEXTCLOUD_MEMORY_LIMIT=9000M 
      - NEXTCLOUD_ADDITIONAL_APKS=imagemagick 
      - NEXTCLOUD_ADDITIONAL_PHP_EXTENSIONS=imagick
      - NEXTCLOUD_ENABLE_DRI_DEVICE=false
    networks:
      nextcloud-aio:
        ipv4_address: 10.x.x.x

networks:
  nextcloud-aio:
    external: true

   
volumes:
  nextcloud_aio_mastercontainer:
    name: nextcloud_aio_mastercontainer
    driver: local
    driver_opts:
      type: none
      o: bind
      device: /opt/docker-data/nextcloud/nextcloud_aio_mastercontainer

Traefik Middleware configuration

http:
  middlewares:
    redirect-to-https:
      redirectScheme:
        scheme: https
        permanent: true
    nextcloud-secure-headers:
      headers:
        hostsProxyHeaders:
          - "X-Forwarded-Host"
        referrerPolicy: "same-origin"
    nextcloud-redirectregex:
      redirectRegex:
        permanent: true
        regex: "^/.well-known/ca(l|rd)dav"
        replacement: "/remote.php/dav/"
    nextcloud-chain:
      chain:
        middlewares:
          # - ... (e.g. rate limiting middleware)
          - redirect-to-https
          - nextcloud-secure-headers
          - nextcloud-redirectregex

Thanks for your help in advance

I have no experience with AiO but I’m running Docker installation since ages behind traefik and never hit such an issue.

looks like your datadir is on NFS - I would try with local storage, NFS likely adds complexity and possible issues. Maybe a dedicated tmpfs would already help (so store upload chunks more faster).

Regarding traefik - more modern way to https redirect is on entrypoints [1] rather using middleware but I don’t think this is a problem.

entryPoints:
  web:
    address: :80
    http:
      redirections:
        entryPoint:
          to: websecure
          scheme: https

  websecure:
    address: :443

  1. ↩︎

This doesn’t sound like a chunking matter. If anything you may be able to workaround it by lowering the chunk size to something <5 MiB. However that’s just a band-aid.

And AIO itself has no limits at 5 MiB.

Something else in the stack or your web/network infrastructure is the culprit here.

Can you share a bit more about your infrastructure?

Are Traefik + AIO + NFS all on the same local network?

Are there any errors in the host OS around that time frame?

Are the test clients local to the server or elsewhere?

Everything is in a different network.
There’s no issues from the host.
Proxmox on the same network as the nas
The vm on a different network
And Traefik and Nextcloud are both in different networks

Nextcloud is the only one using Nfs where the clients is passing through Traefik.

I’ll try by adjusting the firewall rules to see if there’s nothing blocking the traffic. Maybe after a bit the connection gets reset. I didn’t see anything in particular in the host. I’ll check again

Edit : I have thought of a test. I am going to test uploading large files using an nfs share the same way Nextcloud is using and see if it’s still having issues. Helping narrowing if the issue is on the infra side or the application side (Nextcloud)

Update:

I made some tests, and it works with large files now at the exceptions of my windows machine.
I tried every settings I can find that is related to networking and nothing.
I just tested via ubuntu on the same machine, sent a 100MB file via the browser and it was very fast without issues.

Seems to be related to Windows for some weird reasons. I can close the issues.
Thanks for everyone for the help, I would have not look into some of the other aspects for troubleshooting without it.

1 Like

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.