You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TUS upload of new files with backslashes in filename fails with 412 Precondition Failed, but rename to backslash succeeds #2803
Environment:
OpenCloud Server in Docker 4.0.7
OpenCloud Desktop Client 3.0.3.2073
macOS client
TUS upload enabled
Steps to reproduce:
Create a local file with a backslash in its filename, e.g.
DICOM\PA000001\ST000001\SE000007\IM000024
Let OpenCloud Desktop Client sync it.
Observe TUS POST:
POST /dav/spaces/$
Server returns 412 Precondition Failed.
File is added to client blacklist.
Rename the file so backslashes become slashes.
Client uploads it; server shows colons instead (behavior of MacOS: Slash is shown in Finder but on data level slashes are colons).
Rename the already uploaded file back to backslashes.
Rename sync succeeds and file is visible in Web UI with backslashes and is syncing correctly.
Expected:
Either new files with backslashes upload successfully via TUS, or the desktop client rejects them before upload with a clear unsupported-character message.
Actual:
Initial TUS upload fails with 412 Precondition Failed, but subsequent rename to the same backslash-containing name succeeds.
Setup:
Server is started via docker compose. It's standard compose file provided online.
If additional details are needed I can give it. Feel free to reach out.
Tested on a current build (OpenCloud 6.1.0, reva v2.46.x) with the desktop client 3.0.3, the web UI, and curl. The two symptoms in the title have separate causes.
The backslash rejection itself is configured policy
The ocdav name validation forbids a configured set of characters. The default set includes the backslash, alongside \f, \r, \n (reva, internal/http/services/owncloud/ocdav/config, NameValidation.InvalidChars). The validation therefore rejects any new file whose name contains \ on upload.
The create-vs-rename asymmetry is version-specific and already addressed
OpenCloud 4.0.7 vendors reva v2.40.4, which does not include:
That change added the same name validation to the MOVE and MKCOL handlers. On v2.40.4 the rename (MOVE) path did not validate the destination name. Renaming an already-uploaded file to a backslash name then succeeded and stored a literal backslash, which the web UI showed. On a current build the create (TUS) and the rename (MOVE) reject \ consistently, so the "rename succeeds" asymmetry no longer reproduces.
Consistent rejection on a current build:
# TUS create, filename carries a backslash (base64 in Upload-Metadata)
POST /dav/spaces/<spaceID> Upload-Metadata: filename <base64 of "...IM\000024">
-> 412 Precondition Failed, empty body
# same name without the backslash
PUT /dav/spaces/<spaceID>/...IM000024
-> 201 Created
# MOVE an existing file onto a backslash name (raw "\" and percent-encoded %5C)
MOVE /dav/spaces/<spaceID>/clean Destination: .../...IM\000024
-> 400 Bad Request ("destination naming rules")
The remaining issue: the TUS create path reports the rejection differently from the other write handlers
On the same name-validation failure, put.go, move.go, copy.go, and mkcol.go return 400 Bad Request with a message (via errors.Marshal). The TUS POST handler (tus.go, the ValidateName branch, current main) returns a bare 412 Precondition Failed with no body.
With no body, and a status that does not point to a naming problem, clients cannot tell the user why. The desktop client shows an empty "server replied:" and blacklists the file, with no usable message and no recovery until the name changes. The web UI shows "Unbekannter Fehler" with only an X-Request-Id. The 412 ("Precondition Failed") also reads as a protocol or header precondition rather than an invalid name.
🤖 drafted with Claude Code, reviewed before submitting.
Filed the backend part (the TUS create path returning a bare 412 on an invalid name, where the other write handlers return 400 with a message) as a separate reva issue:
Activity
michaelstingl commentedon May 31, 2026
Tested on a current build (OpenCloud 6.1.0, reva v2.46.x) with the desktop client 3.0.3, the web UI, and curl. The two symptoms in the title have separate causes.
The backslash rejection itself is configured policy
The ocdav name validation forbids a configured set of characters. The default set includes the backslash, alongside
\f,\r,\n(reva,internal/http/services/owncloud/ocdav/config,NameValidation.InvalidChars). The validation therefore rejects any new file whose name contains\on upload.The create-vs-rename asymmetry is version-specific and already addressed
OpenCloud 4.0.7 vendors reva v2.40.4, which does not include:
That change added the same name validation to the MOVE and MKCOL handlers. On v2.40.4 the rename (MOVE) path did not validate the destination name. Renaming an already-uploaded file to a backslash name then succeeded and stored a literal backslash, which the web UI showed. On a current build the create (TUS) and the rename (MOVE) reject
\consistently, so the "rename succeeds" asymmetry no longer reproduces.Consistent rejection on a current build:
The remaining issue: the TUS create path reports the rejection differently from the other write handlers
On the same name-validation failure,
put.go,move.go,copy.go, andmkcol.goreturn 400 Bad Request with a message (viaerrors.Marshal). The TUS POST handler (tus.go, theValidateNamebranch, current main) returns a bare 412 Precondition Failed with no body.With no body, and a status that does not point to a naming problem, clients cannot tell the user why. The desktop client shows an empty "server replied:" and blacklists the file, with no usable message and no recovery until the name changes. The web UI shows "Unbekannter Fehler" with only an X-Request-Id. The 412 ("Precondition Failed") also reads as a protocol or header precondition rather than an invalid name.
🤖 drafted with Claude Code, reviewed before submitting.
michaelstingl commentedon May 31, 2026
Filed the backend part (the TUS create path returning a bare 412 on an invalid name, where the other write handlers return 400 with a message) as a separate reva issue:
🤖 drafted with Claude Code, reviewed before submitting.
rhafer commentedon Jun 25, 2026
Fixed with opencloud-eu/reva#655