-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Description
⚠️ This issue respects the following points: ⚠️
- This is a bug, not a question or a configuration/webserver/proxy issue.
- This issue is not already reported on Github OR Nextcloud Community Forum (I've searched it).
- Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
- I agree to follow Nextcloud's Code of Conduct.
Bug description
There are know problems with MacOS+WebDav+Apache+php-fpm https://docs.nextcloud.com/server/latest/user_manual/en/files/access_webdav.html#accessing-files-using-macos
If you use MacOS finder client to connect via WebDavto your nextcloud instance and php-fpm running, you will soon find that transfer crashes, giving you a -36 error. This comes from a problem with Content-Length sent to backend.
For dealing with this .htaccess file has this code
# Clients like xDavv5 on Android, or Cyberduck, use chunked requests.
# When FastCGI or FPM is used with apache, requests arrive to Nextcloud without any content.
# This leads to the creation of empty files.
# The following directive will force the problematic requests to be buffered before being forwarded to Nextcloud.
# This way, the "Transfer-Encoding" header is removed, the "Content-Length" header is set, and the request content is proxied to Nextcloud.
# Here are more information about the issue:
# - https://docs.cyberduck.io/mountainduck/issues/fastcgi/
# - https://docs.nextcloud.com/server/latest/admin_manual/issues/general_troubleshooting.html#troubleshooting-webdav
<IfModule mod_setenvif.c>
SetEnvIf Transfer-Encoding "chunked" proxy-sendcl=1
</IfModule>
However this doesn't work with Macos Webdav Darwin client beacuse the header has a capital letter -> "Chunked" (checked by logs)
So you can fix it making condition case insensitive
<IfModule mod_setenvif.c>
SetEnvIf Transfer-Encoding "(?i)chunked" proxy-sendcl=1
</IfModule>
UPDATE before PR: finally, I used an alternative method using SetEnvIfNoCase that has same effect without using regexp
<IfModule mod_setenvif.c>
SetEnvIfNoCase Transfer-Encoding "chunked" proxy-sendcl=1
</IfModule>
NOTE: apache will upload the file to their tmp folder before passing it to php. Take care of this in case you have restrictions on that folder.
Steps to reproduce
- Create a webdav connection with finder. The backend with apache and php-fpm
- Try to upload a file of a few MB (will fail)
- Modify the .htaccess as I mentioned
- Try again (will success)
Expected behavior
To be able to upload big files to nextclcoud via webdav in macos
Nextcloud Server version
28
Operating system
Debian/Ubuntu
PHP engine version
PHP 8.2
Web server
Apache (supported)
Database engine version
MariaDB
Is this bug present after an update or on a fresh install?
None
Are you using the Nextcloud Server Encryption module?
None
What user-backends are you using?
- Default user-backend (database)
- LDAP/ Active Directory
- SSO - SAML
- Other
Configuration report
not relevant
List of activated Apps
not relevant
Nextcloud Signing status
not relevant
Nextcloud Logs
not relevant
Additional info
php8.2-fpm