NC AIO crashes router on sync

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • 31.0.2
  • Operating system and version (e.g., Ubuntu 24.04):
    • Linux 6.8.12-8-pve x86_64
  • Web server and version (e.g, Apache 2.4.25):
    • Apache/2.4.63 (Unix)
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • caddy 2.9.1 on opnsense router
  • PHP version (e.g, 8.3):
    • 8.3.17
  • Is this the first time you’ve seen this error? (Yes / No):
    • no
  • When did this problem seem to first start?
    • upon installation
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • AIO on Proxmox priv-LXC with host volume binding to synology nfs share
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • CF for DNS only. Firewall on Opnsense router

Summary of the issue you are facing:

Initiating a sync from desktop client will result in freezing the opnsense router.

I haven’t tried on a different computer or a phone yet. Those are my next steps.

I know it’s possible this isn’t an NC_AIO issue but it’s the ONLY service that I’ve installed that’s done anything like this, and I have a fair few services installed:

  • OPNSense
  • AdGuard Home
  • Home Assistant
  • Plex
  • BitWarden
  • Synology
  • Proxmox
  • NextCloud

As such, I figured I would start my investigation outsourcing here.

Steps to replicate it (hint: details matter!):

  1. Install, start, configure AIO
  2. Install, start, configure NC on Windows desktop
  3. Save files to NC folder
  4. Wait for sync. Uncertain whether wait is based on time, number of bytes, number of files, or number of “batches” (as per log, 100 files per batch)
  5. Eventually network goes down. Rebooting router resolves.

:warning: This does NOT occur if syncing is turned off.

Troubleshooting steps

  • Turned on and analyzed Debug logging on NC, router, caddy
  • Analyzed system logs on router, synology, proxmox, and lxc
  • Ran iperf3 to and from router, synology, client, and lxc in all directions, resulting in totally stable gigabit throughputs
  • Updated containers and lxc a few times thoughout the process. I’m aware they are (again) not up to date.
  • Observed resource usage on all related machines, no spikes seen

Log entries

Nextcloud

Logs only had these errors, which basically say the upload was ended prematurely, as one would expect if the network went down in the middle of upload.

Set log level to debug. Rotation occured so the drive file is only a snippet, ending in the error I’ve pasted. Note that this error has occurred many times. This is only an example of one instance.

{"reqId":"ahmAiBSTzLCJpoOI5Hbz","level":3,"time":"2025-03-30T17:19:49+00:00","remoteAddr":"ROUTER_IP_ADDR","user":"REDACTED","app":"no app in context","method":"PUT","url":"/remote.php/dav/uploads/REDACTED/2004586140/00006","message":"Expected filesize of 20971520 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 1310720 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.","userAgent":"Mozilla/5.0 (Windows) mirall/3.16.2 (build 20250319) (Nextcloud, windows-10.0.26100 ClientArchitecture: x86_64 OsArchitecture: x86_64)","version":"31.0.2.1","exception":{"Exception":"Sabre\\DAV\\Exception\\BadRequest","Message":"Expected filesize of 20971520 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 1310720 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.","Code":0,"Trace":[{"file":"/var/www/html/apps/dav/lib/Connector/Sabre/Directory.php","line":116,"function":"put","class":"OCA\\DAV\\Connector\\Sabre\\File","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/apps/dav/lib/Upload/UploadFolder.php","line":28,"function":"createFile","class":"OCA\\DAV\\Connector\\Sabre\\Directory","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php","line":1098,"function":"createFile","class":"OCA\\DAV\\Upload\\UploadFolder","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":504,"function":"createFile","class":"Sabre\\DAV\\Server","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpPut","class":"Sabre\\DAV\\CorePlugin","type":"->","args":[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->","args":["method:PUT",[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]]},{"file":"/var/www/html/apps/dav/lib/Connector/Sabre/Server.php","line":49,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->","args":[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"/var/www/html/apps/dav/lib/Server.php","line":397,"function":"start","class":"OCA\\DAV\\Connector\\Sabre\\Server","type":"->","args":[]},{"file":"/var/www/html/apps/dav/appinfo/v2/remote.php","line":21,"function":"exec","class":"OCA\\DAV\\Server","type":"->","args":[]},{"file":"/var/www/html/remote.php","line":145,"args":["/var/www/html/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/html/apps/dav/lib/Connector/Sabre/File.php","Line":259,"message":"Expected filesize of 20971520 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 1310720 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.","exception":{},"CustomMessage":"Expected filesize of 20971520 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 1310720 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side."}}
{"reqId":"ahmAiBSTzLCJpoOI5Hbz","level":0,"time":"2025-03-30T17:19:49+00:00","remoteAddr":"ROUTER_IP_ADDR","user":"REDACTED","app":"webdav","method":"PUT","url":"/remote.php/dav/uploads/REDACTED/2004586140/00006","message":"Expected filesize of 20971520 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 1310720 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.","userAgent":"Mozilla/5.0 (Windows) mirall/3.16.2 (build 20250319) (Nextcloud, windows-10.0.26100 ClientArchitecture: x86_64 OsArchitecture: x86_64)","version":"31.0.2.1","exception":{"Exception":"Sabre\\DAV\\Exception\\BadRequest","Message":"Expected filesize of 20971520 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 1310720 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.","Code":0,"Trace":[{"file":"/var/www/html/apps/dav/lib/Connector/Sabre/Directory.php","line":116,"function":"put","class":"OCA\\DAV\\Connector\\Sabre\\File","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/apps/dav/lib/Upload/UploadFolder.php","line":28,"function":"createFile","class":"OCA\\DAV\\Connector\\Sabre\\Directory","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php","line":1098,"function":"createFile","class":"OCA\\DAV\\Upload\\UploadFolder","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":504,"function":"createFile","class":"Sabre\\DAV\\Server","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpPut","class":"Sabre\\DAV\\CorePlugin","type":"->","args":[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->","args":["method:PUT",[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]]},{"file":"/var/www/html/apps/dav/lib/Connector/Sabre/Server.php","line":49,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->","args":[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"/var/www/html/apps/dav/lib/Server.php","line":397,"function":"start","class":"OCA\\DAV\\Connector\\Sabre\\Server","type":"->","args":[]},{"file":"/var/www/html/apps/dav/appinfo/v2/remote.php","line":21,"function":"exec","class":"OCA\\DAV\\Server","type":"->","args":[]},{"file":"/var/www/html/remote.php","line":145,"args":["/var/www/html/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/html/apps/dav/lib/Connector/Sabre/File.php","Line":259,"message":"Expected filesize of 20971520 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 1310720 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.","exception":{},"CustomMessage":"Expected filesize of 20971520 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 1310720 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side."}}

Web server / Reverse Proxy / Router

No warnings or errors in any logs I can find. No record of the freeze exists as far as I can tell.

Configuration

Nextcloud

{
    "system": {
        "one-click-instance": true,
        "one-click-instance.user-limit": 100,
        "memcache.local": "\\OC\\Memcache\\APCu",
        "apps_paths": [
            {
                "path": "\/var\/www\/html\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/www\/html\/custom_apps",
                "url": "\/custom_apps",
                "writable": true
            }
        ],
        "check_data_directory_permissions": false,
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "password": "***REMOVED SENSITIVE VALUE***",
            "port": 6379
        },
        "overwritehost": "next.sushifries.com",
        "overwriteprotocol": "https",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "localhost",
            "next.sushifries.com"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "pgsql",
        "version": "31.0.2.1",
        "overwrite.cli.url": "https:\/\/next.sushifries.com\/",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "maintenance": false,
        "updatedirectory": "\/nc-updater",
        "loglevel": 2,
        "app_install_overwrite": [
            "nextcloud-aio"
        ],
        "log_type": "file",
        "logfile": "\/var\/www\/html\/data\/nextcloud.log",
        "log_rotate_size": 10485760,
        "log.condition": {
            "apps": [
                "admin_audit"
            ]
        },
        "preview_max_x": 2048,
        "preview_max_y": 2048,
        "jpeg_quality": 60,
        "enabledPreviewProviders": {
            "1": "OC\\Preview\\Image",
            "2": "OC\\Preview\\MarkDown",
            "3": "OC\\Preview\\MP3",
            "4": "OC\\Preview\\TXT",
            "5": "OC\\Preview\\OpenDocument",
            "6": "OC\\Preview\\Movie",
            "7": "OC\\Preview\\Krita",
            "0": "OC\\Preview\\Imaginary",
            "23": "OC\\Preview\\ImaginaryPDF"
        },
        "enable_previews": true,
        "upgrade.disable-web": true,
        "mail_smtpmode": "smtp",
        "trashbin_retention_obligation": "auto, 30",
        "versions_retention_obligation": "auto, 30",
        "activity_expire_days": 30,
        "simpleSignUpLink.shown": false,
        "share_folder": "\/Shared",
        "one-click-instance.link": "https:\/\/nextcloud.com\/all-in-one\/",
        "upgrade.cli-upgrade-link": "https:\/\/github.com\/nextcloud\/all-in-one\/discussions\/2726",
        "maintenance_window_start": 100,
        "allow_local_remote_servers": true,
        "davstorage.request_timeout": 246000,
        "documentation_url.server_logs": "https:\/\/github.com\/nextcloud\/all-in-one\/discussions\/5425",
        "htaccess.RewriteBase": "\/",
        "dbpersistent": false,
        "auth.bruteforce.protection.enabled": true,
        "ratelimit.protection.enabled": true,
        "files_external_allow_create_new_local": false,
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "preview_imaginary_url": "***REMOVED SENSITIVE VALUE***",
        "preview_imaginary_key": "***REMOVED SENSITIVE VALUE***",
        "mail_sendmailmode": "smtp",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauth": true,
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "465",
        "mail_smtpsecure": "ssl",
        "forbidden_filename_basenames": [
            "con",
            "prn",
            "aux",
            "nul",
            "com0",
            "com1",
            "com2",
            "com3",
            "com4",
            "com5",
            "com6",
            "com7",
            "com8",
            "com9",
            "com\u00b9",
            "com\u00b2",
            "com\u00b3",
            "lpt0",
            "lpt1",
            "lpt2",
            "lpt3",
            "lpt4",
            "lpt5",
            "lpt6",
            "lpt7",
            "lpt8",
            "lpt9",
            "lpt\u00b9",
            "lpt\u00b2",
            "lpt\u00b3"
        ],
        "forbidden_filename_characters": [
            "<",
            ">",
            ":",
            "\"",
            "|",
            "?",
            "*",
            "\\",
            "\/"
        ],
        "forbidden_filename_extensions": [
            " ",
            ".",
            ".filepart",
            ".part"
        ],
        "twofactor_enforced": "true",
        "twofactor_enforced_groups": [
            "admin",
            "standard"
        ],
        "twofactor_enforced_excluded_groups": [],
        "files.chunked_upload.max_size": 20971520,
        "DOMAIN": "next.sushifries.com"
    }
}

Apps

Enabled:
  - admin_audit: 1.21.0
  - bruteforcesettings: 4.0.0
  - cloud_federation_api: 1.14.0
  - comments: 1.21.0
  - dav: 1.33.0
  - federatedfilesharing: 1.21.0
  - files: 2.3.1
  - files_antivirus: 6.0.0
  - files_downloadlimit: 4.0.0
  - files_pdfviewer: 4.0.0
  - files_reminders: 1.4.0
  - files_sharing: 1.23.1
  - files_trashbin: 1.21.0
  - files_versions: 1.24.0
  - firstrunwizard: 4.0.0
  - logreader: 4.0.0
  - lookup_server_connector: 1.19.0
  - nextcloud-aio: 0.7.0
  - notes: 4.11.0
  - notifications: 4.0.0
  - notify_push: 1.0.0
  - oauth2: 1.19.1
  - password_policy: 3.0.0
  - photos: 4.0.0-dev.1
  - privacy: 3.0.0
  - profile: 1.0.0
  - provisioning_api: 1.21.0
  - richdocuments: 8.6.3
  - serverinfo: 3.0.0
  - settings: 1.14.0
  - sharebymail: 1.21.0
  - survey_client: 3.0.0
  - systemtags: 1.21.1
  - tasks: 0.16.1
  - text: 5.0.0
  - theming: 2.6.1
  - twofactor_backupcodes: 1.20.0
  - twofactor_totp: 13.0.0-dev.0
  - viewer: 4.0.0
  - webhook_listeners: 1.2.0
  - whiteboard: 1.0.5
  - workflowengine: 2.13.0
Disabled:
  - activity: 4.0.0 (installed 4.0.0)
  - app_api: 5.0.2 (installed 5.0.2)
  - calendar: 5.2.0 (installed 5.2.0)
  - circles: 31.0.0 (installed 31.0.0)
  - contacts: 7.0.4 (installed 7.0.4)
  - contactsinteraction: 1.12.0 (installed 1.12.0)
  - dashboard: 7.11.0 (installed 7.11.0)
  - deck: 1.15.0 (installed 1.15.0)
  - encryption: 2.19.0
  - federation: 1.21.0 (installed 1.21.0)
  - files_external: 1.23.0
  - nextcloud_announcements: 3.0.0 (installed 3.0.0)
  - recommendations: 4.0.0 (installed 4.0.0)
  - related_resources: 2.0.0 (installed 2.0.0)
  - spreed: 21.0.1 (installed 21.0.1)
  - support: 3.0.0 (installed 3.0.0)
  - suspicious_login: 9.0.1
  - twofactor_nextcloud_notification: 5.0.0
  - user_ldap: 1.22.0
  - user_status: 1.11.0 (installed 1.11.0)
  - weather_status: 1.11.0 (installed 1.11.0)

I have two NC instances hosted behind different OPNsense firewalls, and I haven’t seen such an issue.

In your setup, is communication between this desktop and Nextcloud intended to traverse the firewall? Are you seeing this when accessed on the same network?

1 Like

This is all local connections but with a real qfdn. It’s set up so remote access can only occur over wire guard (rethinking this for share links). So in theory and it would appear, practice, the connection would go:

Client
Edge switch
Main switch
Router (DNS hairpins, then fw, then caddy reverse proxy)
Main switch
Proxmox bridge
Next LXC

This communication all happened without a hitch. Web interface is stable, Synology is reliable, Pve has been stable for other services.

Adding to my initial post, I also reviewed resource usage on all machines and never saw a spike anywhere.

Checked and what do you know, my minipc running OPNSense has Realtek NICs. I installed Realtek’s driver instead of using FreeBSD’s generic Realtek driver re(4) and was able to complete the upload multiple times. (For testing, I would just delete the folder and re-upload it). So from what I can tell, this is solved. I will re-open this if I run into the issue on my main folder which is much bigger than 3.5GB lol

1 Like

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