From a061b60fe406f1d09e9fe803cb756badfc48f45f Mon Sep 17 00:00:00 2001 From: mosandlt <10558666+mosandlt@users.noreply.github.com> Date: Sat, 4 Jul 2026 20:03:02 +0200 Subject: [PATCH] fix(libsync): add OWNCLOUD_BULK_UPLOAD env override to force-disable bulk upload Mirrors the existing OWNCLOUD_CHUNKING_NG override pattern in the same file. Bulk upload (POST .../dav/bulk) is enabled automatically whenever the server advertises the dav.bulkupload capability, with no client-side way to opt out if that endpoint is broken or blocked somewhere in the network path (reverse proxy, WAF, etc). Observed against a self-hosted Nextcloud instance where every single bulk-upload POST failed immediately with UnknownNetworkError, while regular per-file uploads succeeded without issue. Because the failure is deterministic and the client re-attempts bulk upload from scratch on every sync invocation (the in-memory per-file blacklist does not survive across the max-sync-retries restarts, let alone separate nextcloudcmd invocations), affected files never converge and the sync stays permanently red for that server. Setting OWNCLOUD_BULK_UPLOAD=0 lets an operator route around a broken bulk endpoint without needing a custom build, matching the escape hatch already available for chunking via OWNCLOUD_CHUNKING_NG. Signed-off-by: mosandlt <10558666+mosandlt@users.noreply.github.com> --- src/libsync/capabilities.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/libsync/capabilities.cpp b/src/libsync/capabilities.cpp index 73b796fa2b212..83085765633ab 100644 --- a/src/libsync/capabilities.cpp +++ b/src/libsync/capabilities.cpp @@ -250,6 +250,11 @@ int Capabilities::maxConcurrentChunkUploads() const bool Capabilities::bulkUpload() const { + static const auto bulkUploadEnv = qgetenv("OWNCLOUD_BULK_UPLOAD"); + if (bulkUploadEnv == "0") + return false; + if (bulkUploadEnv == "1") + return true; return _capabilities["dav"].toMap()["bulkupload"].toByteArray() >= "1.0"; }