Nextcloud AIO "Unknown error" / "Expected filesize difference" on some random sync uploads

Support intro

Sorry to hear you’re facing problems. :slightly_frowning_face:

The community help forum (help.nextcloud.com) is for home and non-enterprise users. Support is provided by other community members on a best effort / “as available” basis. All of those responding are volunteering their time to help you.

If you’re using Nextcloud in a business/critical setting, paid and SLA-based support services can be accessed via portal.nextcloud.com where Nextcloud engineers can help ensure your business keeps running smoothly.

Getting help

In order to help you as efficiently (and quickly!) as possible, please fill in as much of the below requested information as you can.

Before clicking submit: Please check if your query is already addressed via the following resources:

(Utilizing these existing resources is typically faster. It also helps reduce the load on our generous volunteers while elevating the signal to noise ratio of the forums otherwise arising from the same queries being posted repeatedly).

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can. :heart:

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
  • Operating system and version (e.g., Ubuntu 24.04):
    • Debian 13
  • Web server and version (e.g, Apache 2.4.25):
    • 2.4.66
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • nginx 1.28.1
  • PHP version (e.g, 8.3):
    • 8.3.29
  • Is this the first time you’ve seen this error? (Yes / No):
    • yes
  • When did this problem seem to first start?
    • since beginning
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • AIO
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • no

Summary of the issue you are facing:

I have pretty much basic Nextcloud AIO.
Sometimes files (pictures) are failing to synchronize with “Unknown error”.

Long digging got me to log entry like:

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

which is all similar to:

or:

Both tickets closed - no real conclusion.

There is a suggestion that it might be Apache mod_reqtimeout.

The thing is that changing this in AIO seems to be quite a hiccup.

I mean I can force it but …. maybe there is a better way overall why should it just reported by sync process as conflict and let end user solve it ?

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

There are no reliable ways for me to replicate this, mostly:

  1. Take a photo , the more the better

  2. Check sync status

I have mesh wi-fi, there is a chance that changing from one to another mesh node is somehow involved.
For me personally it happened ~20 times during sync of 20GB of pictures.

For my wife , 1/3 of her ~10k pictures has this issue.

Log entries

Nextcloud

Getting this in AIO is tricky but I guess this is it

{
    "reqId": "FwKGgEYNPztBgMqyTWgo",
    "level": 3,
    "time": "2026-02-10T06:23:28+00:00",
    "remoteAddr": "10.9.0.1",
    "user": "*****",
    "app": "no app in context",
    "method": "PUT",
    "url": "/remote.php/dav/files/*****/InstantUpload/Camera/PXL_20260210_062213496.MP.jpg",
    "scriptName": "/remote.php",
    "message": "Expected filesize of 4486810 bytes b
    ut read(from Nextcloud client) and wrote(to Nextcloud storage) 2482176 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(Android) Nextcloud - android / 3.35 .2 ","
    version ":"
    32.0 .4 .1 ","
    exception ":{"
    Exception ":"
    Sabre\\ DAV\\ Excep
    tion\\ BadRequest ","
    Message ":"
    Expected filesize of 4486810 bytes but read(from Nextcloud client) and wrote(to Nextcloud storage) 2482176 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 / Connec
    tor / Sabre / Directory.php ","
    line ":119,"
    function ":"
    put ","
    class ":"
    OCA\\ DAV\\ Connector\\ Sabre\\ File ","
    type ":" - > ","
    args ":[" ** * sensitive parameters replaced ** * "]},{"
    file ":" /
    var / www / html / 3 rdparty / sabre / dav / lib / DAV / Server.php ","
    line ":1098,"
    function ":"
    createFile ","
    class ":"
    OCA\\ DAV\\ Connector\\ Sabre\\ Directory ","
    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": 211,
    "function": "invokeMethod",
    "class": "Sabre\\DAV\\Server",
    "type": "->",
    "args": [{
        "__class__": "Sabre\\HTTP\\Request"
    }, {
        "__class__": "Sabre\\HTTP\\Response"
    }]
}, {
    "file": "/va
    r / www / html / apps / dav / lib / Server.php ","
    line ":424,"
    function ":"
    start ","
    class ":"
    OCA\\ DAV\\ Connector\\ Sabre\\ Server ","
    type ":" - > ","
    args ":[]},{"
    file ":" /
    var / www / html / apps / dav / appinfo / v2 / remote.php ","
    line ":22,"
    function ":"
    exec ","
    class ":"
    OCA\\ DAV\\ Server ","
    type ":" - > ","
    args ":[]},{"
    file ":" /
    var / www / html / remote.php ","
    line ":151,"
    ar
    gs ":[" /
    var / www / html / apps / dav / appinfo / v2 / remote.php "],"
    function ":"
    require_once "}],"
    File ":" /
    var / www / html / apps / dav / lib / Connector / Sabre / File.php ","
    Line ":260,"
    message ":"
    Expected filesize of 4486810 bytes but read(from Nextcloud client) and wrote(to Nextcloud storage) 2482176 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 4486810 bytes but read(from Nextcloud client) and wrote(to Nextcloud storage) 2482176 bytes.Could either be a network problem on the sending side or a problem writing to the storage on
    the server side.
    "}}

Web Browser

N/A

Web server / Reverse Proxy

N/A - Nextcloud AIO apache config is at WARN level - no log entries whatsoever.

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": "***REMOVED SENSITIVE VALUE***",
        "overwriteprotocol": "https",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "localhost",
            "nas.szus.ovh"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "pgsql",
        "version": "32.0.4.1",
        "overwrite.cli.url": "https:\/\/***REMOVED SENSITIVE VALUE***\/",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "maintenance": false,
        "updatechecker": false,
        "loglevel": 2,
        "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",
        "updatedirectory": "\/nc-updater",
        "maintenance_window_start": 100,
        "allow_local_remote_servers": true,
        "davstorage.request_timeout": 3600,
        "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_smtpsecure": "ssl",
        "mail_sendmailmode": "smtp",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "465",
        "mail_smtpauth": true,
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "mail_stmptimeout": 30,
        "config_preset": 2,
        "app_install_overwrite": [],
        "memories.db.triggers.fcu": true,
        "memories.exiftool": "\/var\/www\/html\/custom_apps\/memories\/bin-ext\/exiftool-amd64-musl",
        "memories.vod.path": "\/var\/www\/html\/custom_apps\/memories\/bin-ext\/go-vod-amd64",
        "memories.vod.ffmpeg": "\/usr\/bin\/ffmpeg",
        "memories.vod.ffprobe": "\/usr\/bin\/ffprobe",
        "DOMAIN": "***REMOVED SENSITIVE VALUE***"
    }
}

Apps

Enabled:
  - activity: 5.0.0-dev.0
  - admin_audit: 1.22.0
  - bruteforcesettings: 5.0.0-dev.0
  - calendar: 6.1.5
  - circles: 32.0.0
  - cloud_federation_api: 1.16.0
  - comments: 1.22.0
  - contacts: 8.3.0
  - contactsinteraction: 1.13.1
  - dashboard: 7.12.0
  - dav: 1.34.2
  - deck: 1.16.3
  - drawio: 3.1.2
  - federatedfilesharing: 1.22.0
  - federation: 1.22.0
  - files: 2.4.0
  - files_confidential: 4.0.0
  - files_downloadlimit: 5.0.0-dev.0
  - files_pdfviewer: 5.0.0-dev.0
  - files_reminders: 1.5.0
  - files_sharing: 1.24.1
  - files_trashbin: 1.22.0
  - files_versions: 1.25.0
  - firstrunwizard: 5.0.0-dev.0
  - guests: 4.6.0
  - logreader: 5.0.0-dev.0
  - lookup_server_connector: 1.20.0
  - memories: 7.8.1
  - nextcloud-aio: 0.8.0
  - nextcloud_announcements: 4.0.0-dev.0
  - notes: 4.12.4
  - notifications: 5.0.0-dev.0
  - notify_push: 1.3.0
  - oauth2: 1.20.0
  - password_policy: 4.0.0-dev.0
  - photos: 5.0.0-dev.1
  - privacy: 4.0.0-dev.0
  - profile: 1.1.0
  - provisioning_api: 1.22.0
  - recommendations: 5.0.0-dev.0
  - related_resources: 3.0.0-dev.0
  - richdocuments: 9.0.2
  - serverinfo: 4.0.0-dev.0
  - settings: 1.15.1
  - sharebymail: 1.22.0
  - spreed: 22.0.8
  - support: 4.0.0-dev.0
  - survey_client: 4.0.0-dev.0
  - systemtags: 1.22.0
  - tasks: 0.17.1
  - text: 6.0.1
  - theming: 2.7.0
  - twofactor_backupcodes: 1.21.0
  - twofactor_nextcloud_notification: 6.0.0-dev.0
  - twofactor_totp: 14.0.0
  - updatenotification: 1.22.0
  - user_status: 1.12.0
  - viewer: 5.0.0-dev.0
  - weather_status: 1.12.0
  - webhook_listeners: 1.3.0
  - whiteboard: 1.5.3
  - workflowengine: 2.14.0
Disabled:
  - app_api: 32.0.0 (installed 32.0.0)
  - encryption: 2.20.0
  - files_external: 1.24.0
  - suspicious_login: 10.0.0-dev.0
  - user_ldap: 1.23.0

In my case the issue was the default timeout settings of traefik proxy.

It had nothing to do with nextcloud.

When I increased them, problem solved.

readTimeout: 3600

idleTimeout: 3600

1 Like

Oh, thanks, I will update my nginx setup, hopefully this helps for future.

I just wonder, when this issue happens I can retry as much as I would like to in Android Nextcloud app - it stays forever, only thing that helps is to remove this from sync.

BUT

There is only 1 log entry with error, just like retry is not doing anything (well it does, nginx proxy registers it “http status 207”, but AIO apache obviously not, neither nextcloud log).
One of other tickets suggested that there is database entry that could be deleted/updated to solve it - if this would be the case then I would love to learn more about it.

My wife has over 3k files in this state - manual removal is not an option.

In the end I understand it as nothing more than special case of discrepancy between client and server, and would be great to have it as “Conflict” to solve with built in handling.

Is your Nginx reverse proxy configuration exactly the one in the AIO RP docs?

https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md#nginx-freenginx-openresty-angie

in short, no it is no longer like in instruction, due to earlier response I have added these 2 lines:

proxy_connect_timeout 3600s;

proxy_send_timeout 3600s;   

and I had already disabled:

# quic_bpf on;

as it is not supported by my machine.

longer version is that I originally have used nginx 1.24 (default in my linux distribution) so http3 was not supported and some of directives had to have different form.

the sync problem was there already.

eventually lack of http3 affected other things (like Collabora) so I have upgraded to official 1.28.x.
in my opinion after this change performance degraded a lot, and lot’s of quirks happens now in web dashboard (especially when using Firefox) - but that is different topic for which I don’t yet have any hard proofs.

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