From 34c14be8eea2baaf199543663e2ce41d8ff10253 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 1/2] 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 c1474e6d22ac9..2e7f0ac82d6a0 100644 --- a/src/libsync/capabilities.cpp +++ b/src/libsync/capabilities.cpp @@ -232,6 +232,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"; } From baf6cbc3c13615b2f230a5352bc27019875c5715 Mon Sep 17 00:00:00 2001 From: mosandlt <10558666+mosandlt@users.noreply.github.com> Date: Thu, 16 Jul 2026 09:25:57 +0200 Subject: [PATCH 2/2] fix(libsync): rename OWNCLOUD_BULK_UPLOAD to NEXTCLOUD_BULK_UPLOAD Per review feedback from @mgallien on PR #10300 - new env vars should use the NEXTCLOUD_ prefix, not the legacy OWNCLOUD_ one (kept only for the pre-existing OWNCLOUD_CHUNKING_NG override). Signed-off-by: mosandlt <10558666+mosandlt@users.noreply.github.com> Assisted-by: ClaudeCode:claude-sonnet-5 --- src/libsync/capabilities.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libsync/capabilities.cpp b/src/libsync/capabilities.cpp index 2e7f0ac82d6a0..8edd994c664f5 100644 --- a/src/libsync/capabilities.cpp +++ b/src/libsync/capabilities.cpp @@ -232,7 +232,7 @@ int Capabilities::maxConcurrentChunkUploads() const bool Capabilities::bulkUpload() const { - static const auto bulkUploadEnv = qgetenv("OWNCLOUD_BULK_UPLOAD"); + static const auto bulkUploadEnv = qgetenv("NEXTCLOUD_BULK_UPLOAD"); if (bulkUploadEnv == "0") return false; if (bulkUploadEnv == "1")