Upload of Backup fails to Nextcloud via WebDAV

Hello,

I’m using the WebDAV integration to upload my daily backups to my Nextcloud server. When I set it up for the first time, it all worked fine. But since then most of the times the upload of the backup fails apparently due to file size limitations when uploading.

My NC server is running locally in Docker Swarm. I’m using the default image with MariaDB and Apache2. Within my home network, the URL is redirected to Nginx Proxy Manager, which in turn points to the the machine running the NC instance.

With the help of googling and ChatGTP, I changed the upload limits in NPM, Apache2 and php to 10 GB. The backup files are 1,8 GB. Here are the respective entries:

NPM:

client_max_body_size 10G;
proxy_connect_timeout 3600s;
proxy_send_timeout 3600s;
proxy_read_timeout 3600s;
send_timeout 3600s;

Apache2: the file is mounted to the docker volume to “/etc/apache2/conf-enabled/99-custom.conf:ro” so it stays untouched after updates:

<Directory /var/www/html>
    Options +FollowSymlinks
    AllowOverride All
    Require all granted
    # Hier das Limit setzen:
    LimitRequestBody 10737418240
</Directory>

php.ini: the file is mounted to the docker volume to “/usr/local/etc/php/conf.d/uploads.ini:ro” so it stays untouched after updates:

upload_max_filesize = 10G
post_max_size = 10G
memory_limit = 4G
max_execution_time = 3600

The first time I had this issue, I changed the limit to 3 GB. When running the automatic backup it worked, then it stopped again. Then I changed the limit to 10 GB, it worked for a short while, then it stopped working.

Here are the log files of HA:

1.:

Logger: homeassistant.components.backup
Source: util/json.py:42
integration: Backup (documentation, issues)
First occurred: October 28, 2025 at 19:12:06 (6 occurrences)
Last logged: 21:18:53

Unexpected error for webdav.01K81RZRX1WVVNRT28RS5040HA: unexpected end of data: line 1 column 37 (char 36)
Unexpected error for webdav.01K81RZRX1WVVNRT28RS5040HA: unexpected end of data: line 1 column 42 (char 41)
Unexpected error for webdav.01K81RZRX1WVVNRT28RS5040HA: unexpected end of data: line 1 column 59 (char 58)
Unexpected error for webdav.01K81RZRX1WVVNRT28RS5040HA: unexpected end of data: line 1 column 80 (char 79)
Unexpected error for webdav.01K81RZRX1WVVNRT28RS5040HA: unexpected end of data: line 1 column 55 (char 54)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/webdav/backup.py", line 74, in wrapper
    return await func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/webdav/backup.py", line 206, in async_list_backups
    return list((await self._list_cached_metadata_files()).values())
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/webdav/backup.py", line 238, in _list_cached_metadata_files
    self._cache_metadata_files = await _list_metadata_files()
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/webdav/backup.py", line 235, in _list_metadata_files
    if (metadata_content := await _download_metadata(file_name))
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/webdav/backup.py", line 226, in _download_metadata
    return AgentBackup.from_dict(json_loads_object(metadata))
                                 ~~~~~~~~~~~~~~~~~^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/util/json.py", line 56, in json_loads_object
    value: JsonValueType = json_loads(obj)
                           ~~~~~~~~~~^^^^^
  File "/usr/src/homeassistant/homeassistant/util/json.py", line 42, in json_loads
    return orjson.loads(obj)  # type:ignore[no-any-return]
           ~~~~~~~~~~~~^^^^^
orjson.JSONDecodeError: unexpected end of data: line 1 column 37 (char 36)

2.:

Logger: homeassistant.components.backup
Source: components/backup/manager.py:604
integration: Backup (documentation, issues)
First occurred: October 26, 2025 at 04:14:10 (6 occurrences)
Last logged: 21:23:59

Upload failed for webdav.01K81RZRX1WVVNRT28RS5040HA: Backup operation failed: No connection with xxxxx.com/remote.php/dav/files/user
Upload failed for webdav.01K81RZRX1WVVNRT28RS5040HA: Backup operation failed: Request to xyz.com/remote.php/dav/files/user/Backups/HA/Automatic_backup_2025.10.4_2025-10-27_23.30_00004852.tar failed with code 413 and message: b''
Upload failed for webdav.01K81RZRX1WVVNRT28RS5040HA: Backup operation failed: Request to xyz.com/remote.php/dav/files/user/Backups/HA/Automatic_backup_2025.10.4_2025-10-28_23.30_00002643.tar failed with code 413 and message: b''
Upload failed for webdav.01K81RZRX1WVVNRT28RS5040HA: Backup operation failed: Request to xyz.com/remote.php/dav/files/user/Backups/HA/Automatic_backup_2025.10.4_2025-10-29_23.30_00002620.tar failed with code 413 and message: b''
Upload failed for webdav.01K81RZRX1WVVNRT28RS5040HA: Backup operation failed: Request to xyz.com/remote.php/dav/files/user/Backups/HA/Automatic_backup_2025.10.4_2025-10-30_21.22_52724099.tar failed with code 413 and message: b''

There is no log entry in Nextcloud itself. There is a quite irrelevant entry in the Portainer log entry of the container:

10.0.3.4 - user [30/Oct/2025:20:23:58 +0000] "PROPFIND /remote.php/dav/files/user/Backups/HA/ HTTP/1.1" 207 1094 "-" "HomeAssistant/2025.10.4 aiohttp/3.12.15 Python/3.13"

All my apps are up-to-date. I’m not sure what else to do. I also added the WebDAV connection to the file manager of my Samsung S22 Ultra and I was able to upload the exact same backup files from my phone directly with no issues. Do you guys have any ideas?

Maybe try to simplify your setup and take nginx out of the equation ?

I need nginx so that the URL points to the proper location, in my case the docker swarm service running nextcloud. I could move to NFS instead I suppose, since the backups don’t need to be in the cloud.