Server: Sabre\DAV\Exception\NotFound: HTTP/1.1 404 - when uploading files via WEBDAV

Created on 29 Dec 2016  Â·  67Comments  Â·  Source: nextcloud/server

Steps to reproduce

  1. Install NC on shared host (all-inkl with SSL Lets encrypt in my case) using mySQL
  2. Create user
  3. OS X - Finder - Cmd+K: Connect to https://host.url/remote.php/webdav using user credentials
  4. Try to upload a file

Expected behaviour

File should be uploaded.

Actual behaviour

File with 0 kB is created, but Finder shows error message (German) "Der Finder konnte diesen Vorgang nicht abschließen, da einige Daten in „coupon2.pdf“ nicht gelesen oder geschrieben werden konnten.
(Fehler: -36)" Error:-36

Upload with Cyberduck via WebDAV (HTTPS) works.

Server configuration

Operating system:
Linux 3.13.0-105-generic #152-Ubuntu SMP Fri Dec 2 15:37:11 UTC 2016 x86_64
Web server:
Apache
Database:
MySQL Server-Version: 5.6.33-nmm1-log - (Ubuntu)
PHP version:
7.0.10-NMM1 as CGI/FPM
Nextcloud version: (see Nextcloud admin page)
11.0.0
Updated from an older Nextcloud/ownCloud or fresh install:
10.0.2 / same behavior for fresh install
Where did you install Nextcloud from:
tar file from nextcloud.com
Signing status:


Signing status
No errors have been found.

List of activated apps:


App list
Contacts
Calendar

The content of config/config.php:


Config report
$CONFIG = array (
'instanceid' => '[REMOVED]',
'passwordsalt' => '[REMOVED]',
'secret' => '[REMOVED]',
'trusted_domains' =>
array (
0 => '[REMOVED].[REMOVED].[REMOVED]',
),
'datadirectory' => '/www/htdocs/[REMOVED]/[REMOVED]_data',
'tempdirectory' => '/www/htdocs/[REMOVED]/[REMOVED]_temp',
'overwrite.cli.url' => 'https://[REMOVED].[REMOVED].it',
'dbtype' => 'mysql',
'version' => '11.0.0.10',
'dbname' => '[REMOVED]',
'dbhost' => 'localhost',
'dbport' => '',
'dbtableprefix' => 'oc_',
'dbuser' => '[REMOVED]',
'dbpassword' => '[REMOVED]',
'logtimezone' => 'UTC',
'installed' => true,
'mail_from_address' => '[REMOVED]',
'mail_smtpmode' => 'php',
'mail_domain' => '[REMOVED].[REMOVED]',
'loglevel' => 0,
'mail_smtpsecure' => 'ssl',
'theme' => '',
'maintenance' => false,
);

Are you using external storage, if yes which one: No.

Are you using encryption: yes, but same behavior without encryption (tested with new installation)

Are you using an external user-backend, if yes which one: No.

Client configuration

Browser:
Finder (Browser upload works)
Operating system:
Mac OS X 10.12.2

Logs

Nextcloud log (data/nextcloud.log)


Nextcloud log
{"reqId":"[REMOVED]","remoteAddr":"[REMOVED]","app":"webdav","message":"Exception: {"Message":"HTTP\/1.1 404 File with name coupon2.pdf could not be located","Exception":"Sabre\\DAV\\Exception\\NotFound","Code":0,"Trace":"#0 \/www\/htdocs\/[REMOVED]\/[REMOVED]\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(939): OCA\\DAV\\Connector\\Sabre\\ObjectTree->getNodeForPath('coupon2.pdf')\n#1 \/www\/htdocs\/[REMOVED]\/[REMOVED]\/3rdparty\/sabre\/dav\/lib\/DAV\/CorePlugin.php(336): Sabre\\DAV\\Server->getPropertiesForPath('coupon2.pdf', Array, 0)\n#2 [internal function]: Sabre\\DAV\\CorePlugin->httpPropFind(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))\n#3 \/www\/htdocs\/[REMOVED]\/[REMOVED]\/3rdparty\/sabre\/event\/lib\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\n#4 \/www\/htdocs\/[REMOVED]\/[REMOVED]\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(479): Sabre\\Event\\EventEmitter->emit('method:PROPFIND', Array)\n#5 \/www\/htdocs\/[REMOVED]\/[REMOVED]\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(254): Sabre\\DAV\\Server->invokeMethod(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))\n#6 \/www\/htdocs\/[REMOVED]\/[REMOVED]\/apps\/dav\/appinfo\/v1\/webdav.php(60): Sabre\\DAV\\Server->exec()\n#7 \/www\/htdocs\/[REMOVED]\/[REMOVED]\/remote.php(165): require_once('\/www\/htdocs\/w01...')\n#8 {main}","File":"\/www\/htdocs\/[REMOVED]\/[REMOVED]\/apps\/dav\/lib\/Connector\/Sabre\/ObjectTree.php","Line":173,"User":"Michael"}","level":0,"time":"2016-12-29T18:34:33+00:00","method":"PROPFIND","url":"/remote.php/webdav/coupon2.pdf","user":"Michael","version":"11.0.0.10"}

dav needs info

Most helpful comment

Happens also when using a Synology Disk Station as client...

All 67 comments

## I can confirm, same here!

## Specs:
NC 11 (Upgrade history: OC8 -> OC9 -> NC10 -> NC11)
Debian Jessie, Kernel 4.8.11
PHP-fpm 7.1.0 / Mariadb 10.1.20 / Nginx 1.11.8 / Redis-Server: 3.2.6

## Client:
MacOS Sierra 10.12.2
(But same happens on windows)

## Error LOG:

{"reqId":"ThoNKi4BTLghTgvx9MOa","remoteAddr":"95.82.34.78","app":"webdav","message":"Exception: {\"Message\":\"HTTP\\\/1.1 500 No subsystem set a valid HTTP status code. Something must have interrupted the request without providing further detail.\",\"Exception\":\"Sabre\\\\DAV\\\\Exception\",\"Code\":0,\"Trace\":\"#0 \\\/server\\\/WWW\\\/nextcloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(254): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#1 \\\/server\\\/WWW\\\/nextcloud\\\/apps\\\/dav\\\/appinfo\\\/v1\\\/webdav.php(60): Sabre\\\\DAV\\\\Server->exec()\\n#2 \\\/server\\\/WWW\\\/nextcloud\\\/remote.php(165): require_once('\\\/server\\\/WWW\\\/nex...')\\n#3 {main}\",\"File\":\"\\\/server\\\/WWW\\\/nextcloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php\",\"Line\":495,\"User\":\"rama\"}","level":4,"time":"2016-12-30T20:00:46+00:00","method":"LOCK","url":"\/remote.php\/webdav\/MIX\/.DS_Store","user":"rama","version":"11.0.0.10"}
{"reqId":"Vdv3mNePhxkGqhpjXF1j","remoteAddr":"95.82.34.78","app":"webdav","message":"Exception: {\"Message\":\"HTTP\\\/1.1 500 No subsystem set a valid HTTP status code. Something must have interrupted the request without providing further detail.\",\"Exception\":\"Sabre\\\\DAV\\\\Exception\",\"Code\":0,\"Trace\":\"#0 \\\/server\\\/WWW\\\/nextcloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(254): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#1 \\\/server\\\/WWW\\\/nextcloud\\\/apps\\\/dav\\\/appinfo\\\/v1\\\/webdav.php(60): Sabre\\\\DAV\\\\Server->exec()\\n#2 \\\/server\\\/WWW\\\/nextcloud\\\/remote.php(165): require_once('\\\/server\\\/WWW\\\/nex...')\\n#3 {main}\",\"File\":\"\\\/server\\\/WWW\\\/nextcloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php\",\"Line\":495,\"User\":\"rama\"}","level":4,"time":"2016-12-30T20:00:53+00:00","method":"LOCK","url":"\/remote.php\/webdav\/MIX\/.DS_Store","user":"rama","version":"11.0.0.10"}
{"reqId":"GmyxbggTnIT\/mlDGGKKX","remoteAddr":"95.82.34.78","app":"webdav","message":"Exception: {\"Message\":\"HTTP\\\/1.1 500 No subsystem set a valid HTTP status code. Something must have interrupted the request without providing further detail.\",\"Exception\":\"Sabre\\\\DAV\\\\Exception\",\"Code\":0,\"Trace\":\"#0 \\\/server\\\/WWW\\\/nextcloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(254): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#1 \\\/server\\\/WWW\\\/nextcloud\\\/apps\\\/dav\\\/appinfo\\\/v1\\\/webdav.php(60): Sabre\\\\DAV\\\\Server->exec()\\n#2 \\\/server\\\/WWW\\\/nextcloud\\\/remote.php(165): require_once('\\\/server\\\/WWW\\\/nex...')\\n#3 {main}\",\"File\":\"\\\/server\\\/WWW\\\/nextcloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php\",\"Line\":495,\"User\":\"rama\"}","level":4,"time":"2016-12-30T20:01:01+00:00","method":"LOCK","url":"\/remote.php\/webdav\/.DS_Store","user":"rama","version":"11.0.0.10"}

## Easy Log from Admin Panel:

Sabre\DAV\Exception: HTTP/1.1 500 No subsystem set a valid HTTP status code. Something must have interrupted the request without providing further detail.
0. /server/WWW/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 254: Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
1. /server/WWW/nextcloud/apps/dav/appinfo/v1/webdav.php - line 60: Sabre\DAV\Server->exec()
2. /server/WWW/nextcloud/remote.php - line 165: require_once('/server/WWW/nex...')
3. {main}

Cheers :-)

Happens also when using a Synology Disk Station as client...

+1. The same on a fresh Nextcloud 11.0.1 (daily) Build:2017-01-07T21:01:17+00:00 2c2c4cc6c7b547752a9030f4da6df43cf7decddb install.

Please fix, not able to use :(

Can you try connecting to remote.php/dav/files instead of remote.php/webdav?

@nickvergessen
I can connect, but if i try to upload a file, it asks me to login, but i cant login...

here is the error:

{"reqId":"TZo7QUYqgIC69rmesI+R","remoteAddr":"91.67.59.56","app":"webdav","message":"Exception: {\"Message\":\"HTTP\\\/1.1 405 Listing members of this collection is disabled\",\"Exception\":\"Sabre\\\\DAV\\\\Exception\\\\MethodNotAllowed\",\"Code\":0,\"Trace\":\"#0 \\\/server\\\/WWW\\\/nextcloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Tree.php(195): Sabre\\\\DAVACL\\\\AbstractPrincipalCollection->getChildren()\\n#1 \\\/server\\\/WWW\\\/nextcloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(893): Sabre\\\\DAV\\\\Tree->getChildren('files')\\n#2 \\\/server\\\/WWW\\\/nextcloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(947): Sabre\\\\DAV\\\\Server->addPathNodesRecursively(Array, Object(Sabre\\\\DAV\\\\PropFind))\\n#3 \\\/server\\\/WWW\\\/nextcloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/CorePlugin.php(336): Sabre\\\\DAV\\\\Server->getPropertiesForPath('files', Array, 1)\\n#4 [internal function]: Sabre\\\\DAV\\\\CorePlugin->httpPropFind(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#5 \\\/server\\\/WWW\\\/nextcloud\\\/3rdparty\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n#6 \\\/server\\\/WWW\\\/nextcloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(479): Sabre\\\\Event\\\\EventEmitter->emit('method:PROPFIND', Array)\\n#7 \\\/server\\\/WWW\\\/nextcloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(254): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#8 \\\/server\\\/WWW\\\/nextcloud\\\/apps\\\/dav\\\/lib\\\/Server.php(227): Sabre\\\\DAV\\\\Server->exec()\\n#9 \\\/server\\\/WWW\\\/nextcloud\\\/apps\\\/dav\\\/appinfo\\\/v2\\\/remote.php(30): OCA\\\\DAV\\\\Server->exec()\\n#10 \\\/server\\\/WWW\\\/nextcloud\\\/remote.php(165): require_once('\\\/server\\\/WWW\\\/nex...')\\n#11 {main}\",\"File\":\"\\\/server\\\/WWW\\\/nextcloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAVACL\\\/AbstractPrincipalCollection.php\",\"Line\":95,\"User\":\"alka\"}","level":4,"time":"2017-01-15T01:34:35+00:00","method":"PROPFIND","url":"\/remote.php\/dav\/files\/","user":"pipi","version":"11.0.1.1"}

I've updated to NC 11.0.1RC1 nothing changed :-(

@nickvergessen
Maybe an nginx problem?
Does webdav work for you on nc11?

I can post nginx config or anything else you want:-)
Ask me what you need:-)

Ps,
Just tryed on centos7, exactly same error...
Tryed first with kernel 3.10, now ive updated to 4.9.1, nothing helps...
Centos7 kernel 4.9.1 / php71w-fpm / mariadb 10.1 / redis 3.2.6

Hope to fix that soon xD
Cheers

I'm seeing this on OpenSuse 42.2 w/ Apache. Looking through the forums, the one thing that everybody with this issue seems to have in common is PHP 7.x.

This issue is still marked as "needs info". Is more information still needed?

@nickvergessen
"Can you try connecting to remote.php/dav/files instead of remote.php/webdav?"
I was to stupid, now: "remote.php/dav/files/USERNAME/"
i can connect, but behavior is exactly same as "remote.php/webdav"

i can see files, i can even create folders, but if i try to upload, i get empty 0kb files (and error)
here is a log from /remote.php/dav/files/user/

{"reqId":"3deOafcyaIVnNRrQlDQ0","remoteAddr":"95.88.31.99","app":"webdav","message":"Exception: {\"Message\":\"HTTP\\\/1.1 500 No subsystem set a valid HTTP status code. Something must have interrupted the request without providing further detail.\",\"Exception\":\"Sabre\\\\DAV\\\\Exception\",\"Code\":0,\"Trace\":\"#0 \\\/server\\\/WWW\\\/nextcloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(254): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#1 \\\/server\\\/WWW\\\/nextcloud\\\/apps\\\/dav\\\/lib\\\/Server.php(227): Sabre\\\\DAV\\\\Server->exec()\\n#2 \\\/server\\\/WWW\\\/nextcloud\\\/apps\\\/dav\\\/appinfo\\\/v2\\\/remote.php(30): OCA\\\\DAV\\\\Server->exec()\\n#3 \\\/server\\\/WWW\\\/nextcloud\\\/remote.php(165): require_once('\\\/server\\\/WWW\\\/nex...')\\n#4 {main}\",\"File\":\"\\\/server\\\/WWW\\\/nextcloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php\",\"Line\":495,\"User\":\"rama\"}","level":4,"time":"2017-01-17T01:19:55+00:00","method":"LOCK","url":"\/remote.php\/dav\/files\/rama\/rechnung.odt","user":"rama","version":"11.0.1.2"}

Cheers :-)

This is probably related to the underlying filesystem not supporting flock. Flock is for example not supported on CIFS (Samba Shares) and the old FAT Filesystem. The only way to make it work would be to not use flock in the sabredav Lock plugin.

@Flole998
Im using ext4 on the debian server
And xfs on the centos server

Its definitive some thing with php, because create folders on webdav works.
If i upload a file i get empty 0kb files... So something is interrupting php...
Its like php execution time or sth like that... But ive set it already to 600...

Would be nice if someone with working webdav could post php.ini and nginx config...
That would help a lot, because its not working on both (all) servers...

same problem here. debian, apache, php 5.6.28. nextcloud 11.0.0
Sabre\DAV\Exception: HTTP/1.1 500 No subsystem set a valid HTTP status code. Something must have interrupted the request without providing further detail.

i tried different clients:

  • using latest cyberduck 5.3.3 (23221) on Win10 doesn't work (Error 405)
  • Windows Explorer (WinHTTP?) doesn't work (Error 0x8000FFFF "Fatal Error?")
  • I don't have a Mac to tes it myself, but i've got a report stating it doesn't work (Error 36)
  • one user reported that totalcommander as webdav client works.
  • keepass to access a database directly via webdav works.
  • WinSCP as WebDAV client works.

Same with NC11.0.1. According to https://fossies.org/diffs/nextcloud/10.0.2_vs_11.0.0/3rdparty/sabre/dav/lib/DAV/Server.php-diff.html , the check in 3rdparty/sabre/dav/lib/DAV/Server.php lines 494-496 which throws the exception "No subsystem set a valid HTTP status code" was added since NC10. Commenting them out restores functionality, at least using Windows10 as client.

Thanks @andreas-p
It gots somehow better, I can transfer now half of the file, but it stucks on transferring...
However, i try to replace some more from the old code...

Seems like this bug doesnt interrest anyone, i think there are much more guys with this problem...

Cheers

For the record, we have the problem here too, c.f. https://github.com/nextcloud/server/issues/3053

Nothing helps, nc11 is not useable

Identique error please help me !

@Oz246 Your comment is not helping, provide either information about your environment, a solution or just wait for someone to solve the problem. It seems to be PHP7 related.

The reason why it works on some clients is, that some WebDAV clients create a file, then lock it and start transferring (if locking fails you get an empty file). Other clients do not lock the file or ignore errors. When creating a directory no locking is necessary, that should always work.

Hello
Additional information:

Ubuntu 16.04
Nexrcloud 11.0.1
MariaDB

I have a problem with the WebDav connection several problems:

If I create the network location: "https: //c.s**e.com: 666 / nextcloud / remote.php / webdav /", it works but can not upload files, File of 0 KB this Create with an error message: "Target: A device attached to the system does not work properly"

ERROR NEXTCLOUD: Saber DAV Exception: HTTP / 1.1 500 No subsystem set to valid HTTP status code. Something must have interrupted the request without having further detail.

On the other hand I can create a second network location: https: //c.s**e.com: 666 / remote.php / dav / files / Administrator, it works in upload, with an error message Nextcloud:

Saber DAV Exception NotImplemented: HTTP / 1.1 501 There was no plugin in the system that was willing to handle this LOCK method.

I can not reconnect to this one I delete my first network location ..

Please HELP ME

Debian testing with Nginx, just installing Nextcloud 11.0.1 without precise configuration same problem

@Oz246 PHP Version? Nginx and Apache version? Filesystem of data partition? What client are you using? Fill out the standard issue report, all information is needed to debug and reproduce the issue.

PHP 7.0.13 FPM // Apache2 // Data Partition : Ubuntu 16.04 // Client using : Windows 10 .

@Flole998 Also see https://github.com/nextcloud/server/issues/3053, with logs and co.

This is clearly a locking problem, yes. The first thing to enhance is probably the error message: HTTP/1.1 500 No subsystem set a valid HTTP status code. Something must have interrupted the request without providing further detail. With a more precise message, most people would be able to understand it better and maybe fix it (underlying FS not supporting locks, whatever, there may even be different problems leading to this 500, each of us don't know which one is.)

This is way more messed up than I thought it was. It seems as if the Lock Plugin was never enabled, its just that now a non-implemented method is no longer returning Status Code 200 (OK) but instead Error Code 500 (Server Error). Its supposed to be error code 501 (Not implemented). Even enabling the Lock plugin is not really working as there is way more stuff messed up. To me it seems like LOCK and UNLOCK was never working the way it was intended, it's just that it was never really noticed. A patch that just works is in the attachments, it's not beautiful and it is really messed up as it just ignores the error but someone has to take care of the entire sabredav-stuff and do it properly!
Server.txt

I can confirm a lock issue. I connect via davfs (Debian 8) using the fstab entry:

https://server/nextcloud/remote.php/webdav /media/nextcloud davfs rw,noauto,_netdev,user,uid=user 0 1

On upgrading to Nextcloud 11.1, mounting the webdav share results in the warning: "/sbin/mount.davfs: warning: the server does not support locks". However, I can access the file system and write files (so webdav is usable for me).

Nextcloud 11.1 is running on a Ubuntu 14.04 server with PHP 7. Previously, there was no warning on mount.

@Flole998
Thank you very much!
Now webdav is working with Windows Clients again!

OSX Still have problems, however, its now much better! Thanks!

Hello Fole,

First of all thank you for the help.

Following the modification of the file: 3rdparty / saber / dav / lib / DAV / Server.php as indicate in the text file.

I find myself with a new error: A weblink of nextcloud Error: This directory is not available

Error Nextcloud Administration:
ParseError: syntax error, unexpected ','

/var/www/nextcloud/lib/composer/composer/ClassLoader.php - line 322: Composer \ Autoload \ includeFile ('/ var / www / nextcl ...')
[Internal function] Composer \ Autoload \ ClassLoader-> loadClass ('Saber \\ DAV \\ Serve ...')
/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Server.php - line 35: spl_autoload_call ('Saber \\ DAV \\ Serve ...')
/var/www/nextcloud/lib/composer/composer/ClassLoader.php - line 440: include ('/ var / www / nextcl ...')
/var/www/nextcloud/lib/composer/composer/ClassLoader.php - line 322: Composer \ Autoload \ includeFile ('/ var / www / nextcl ...')
[Internal function] Composer \ Autoload \ ClassLoader-> loadClass ('OCA \\ DAV \\ Connect ...')
/var/www/nextcloud/apps/dav/lib/Connector/Sabre/ServerFactory.php - line 105: spl_autoload_call ('OCA \\ DAV \\ Connect ...')
/var/www/nextcloud/apps/dav/appinfo/v1/webdav.php - line 57: OCA \ DAV \ Connector \ Saber \ ServerFactory-> createServer ('/ remote.php / web ...', '/ remote .php / web ... ', Object (OCA \ DAV \ Connector \ Saber \ Auth), Object
/var/www/nextcloud/remote.php - line 165: require_once ('/ var / www / nextcl ...')
{hand}

The webdav still does not work

@Oz246 On your installation something else seems to be messed up, the error message says "Saber" in it, its not supposed to. I can not give you any further support, if the patch is not compatible it should give an error when being applied using the patch command. Try reinstalling the newest version.

@Ramalama2

Can you transfer me your server.txt file

@Flole998

Thanks for help

Server.php.zip

Hope someone can fix osx too :-)
Cheers :-)

@Ramalama2 Could you share some details about the osx problem? I do not use osx anymore, it would be helpful to get server logs (apache/nginx access log), nextcloud log and the osx error message. Maybe we need to do further traffic investigation using charles if the logs show no obvious problems.

without your commit:
'''
- if ($response->getStatus() === null) {
+ if ($response->getStatus() === null && !($method === "LOCK" || $method === "UNLOCK")) {
'''
I get on OSX an error message, so i can post all logs without problems.

with your commit:
I get on osx no error message, it tryes to upload the file endless, till i restart osx.... so its harder to share logs in this situation... but i can try if you want...

or if you want, i can setup virtual MacOSx vm. (and a vm cloud, so you can test yourself)
this is in most times faster for experimenting, as waiting for my reply's...
Cheers :-)

I have probably figured out where that OSX Problem is coming from, I still need to do some more tests and once it's working I'll publish a patch.

Thanks @Flole998 your server.php workaround also fixes WebDAV access from Windows (getting rid of write failures / "A device attached to the system is not functioning").

Available here to test Win7 / Server 2008 R2 WebDAV client connections (we use them at two schools for direct WebDAV Nextcloud access from shared PCs) for the eventual fix.

@awnz You still have issues with Win 7 as a client? I had some issues that i fixed today but i thought they are related to my setup. I can publish the patch for that if others also receive a Error 67 (if i remember correctly, could also be 68, not sure) that says that the Network name doesn't exist.

Sorry I should have clarified, we're on 11.0.1 release (we use the greyltc/nextcloud Docker container), I haven't tried 11.1. I forgot that when suggesting we could test. I could however use greyltc's Dockerfile to build my own container with 11.1.

Interestingly - this probably isn't related and I put it down to a Windows bug rather then Nextcloud - we did have an error 57 when trying to use "net use" or AutoIt script's equivalent DriveMapAdd() to map a network drive to either \nextcloud.[email protected] or https://nextcloud.server/remote/php/webdav which I found I could work around by attempting to map to the server by IP address insteadfirst. The IP map would fail (SSL cert mismatch) but after it did, _then_ mapping my DNS name would succeed. shrug

@awnz It is indeed a Windows Bug (which doesn't mean we can't fix it in nextcloud ;) )and I don't even want to know how that happened, but sometimes Windows just sends a OPTIONS request to the root of the Webserver instead of the actual URL specified. Nextcloud redirects it to the /login page which is of course no valid Webdav endpoint. The attached patch redirects the UserAgent that is used by Windows to access the WebDav Server to the appropriate directory.
WinProblem.patch.txt

Thanks. Yeah it's weird, 53 implies that name lookup failed or similar (I think) which is why I then tried it by IP, which of course failed anyway due to SSL name mismatch ... but then when I repeated the previous command I was surprised that it worked!

So in the end I'm doing this:
net use x: \\123.45.67.[email protected]
net use x: \\nextcloud.server.dns.[email protected]

where 123.45.67.89 is your Nextcloud server's IP. Of course you need a valid SSL cert.

The first command fails but - and I have no idea why - running it then allows the second one to succeed.

Once you tried my patch please let us know if that solved the issue for you. At least for me it solved the issue, but a second opinion is always good. To everyone using those patches: Be aware that those patches break the auto update and integrity check as the checksums of the files are no longer matching. However, at least for me a working WebDav was more important than a working AutoUpdate (reverting the changes will allow AutoUpdate to work again, probably changing the required checksum in one file is going to have a similar result)

Just to clarify, do you mean the Server.php patch (the one that ignores LOCK/UNLOCK methods), or the .htaccess patch for Windows WebDAV connections?

I have the Server.php one in place on 11.0.1 and it's working (using a docker -v option to replace Server.php in the greyltc/nextcloud container with your patched one for now)

Can try the .htaccess one too if you want :)

The .htaccess one should no longer make it required to connect to the IP-Address first. If you could verify that, I would appreciate it.
Also while that patch is a nice one, the server.php one is just dirty and should not be used unless it's absolutely necessary. I am still investigating the problem to get a real fix done as OSX doesn't like the dirty patch.

@Flole998 Yes can confirm test of .htaccess patch is successful when connecting over WebDAV from a freshly rebooted Windows Server 2008 R2 client (tested with net use, both \host@SSL and https://host syntaxes) - thanks :)

Wonderful, I also have a Mac OS Patch ready to be tested but I am pretty sure it's not working properly yet on OS X. If this really doesn't work on OS X I will publish another one tomorrow which also takes care of creating files when a LOCK request is sent if it doesn't exist as described in RFC4918. This should also make the other Lock Patch no longer required. Everybody please revert back and use the new one. The other one is hereby deprecated and is never to be used or talked about again (unless this patch doesn't work everywhere as well as it does here). ;)

AGAIN: REVERT PREVIOUS LOCK PATCH BEFORE APPLYING THIS ONE OR UNEXPECTED THINGS MIGHT HAPPEN!!!

Just to prevent confusion: This patch is compatible with the htaccess patch. They can be used at the same time.
WebDavLockFinal.patch.txt

Looks good here - can open, modify and save text documents (Notepad) and MS Word* docs into the mapped WebDAV share.

To verify: I reverted the first 3rdparty/sabre/dav/lib/DAV/Server.php patch before applying the second patch to apps/dav/lib/Server.php and apps/dav/lib/Connector/Sabre/FakeLockerPlugin.php.

  • one day I must find out why MS Office re-prompts for WebDAV credentials on opening a file from a WebDAV share and if there's a way to stop that...

Thank you.
Your Patch is working.
I can now open MS Excel or Word Files and are also able to edit.
But after saving, ther is no new Version created. Versions after Edit are empty.
Best regards

Just went back and checked, versions look ok for me... :/

i have opened and edited the excel file several times.
versions are still empty.

@apg1980 Can you confirm it was working before applying the patch? If not that's a new issue and should not be covered here.

@Flole998
your winproblem patch for nginx would look like this:

if ($http_user_agent ~ DavClnt ) {
return 301 https://$http_host/remote.php/webdav;
}

or:

location = / {
if ($http_user_agent = DavClnt) {
return 301 https://$http_host/remote.php/webdav;
}
}

What means [L,R=302] ?
Cannot translate that to nginx...

Cheers

Hi,

It seems that I have the same issue with syncing my contacts after upgrading from OC 9.x to NC 11.0.1

This is what I found in nextcloud/data/nextcloud.log

T12:18:57+00:00","method":"GET","url":"/nextcloud/index.php/apps/passman/api/v2/language?lang=en","user":"SOMEUSER","version":"11.0.1.2"}
{"reqId":"CqWwEgfipZfdc8hUgmL3","remoteAddr":"SOME_IP_HERE","app":"PHP","message":"Method OC_L10N_String::__toString() must return a string value at /var/www/nextcloud/lib/private/L10N/L10N.php#85","level":3,"time":"2017-02-06T12:18:57+00:00","method":"GET","url":"/nextcloud/index.php/apps/passman/api/v2/language?lang=en","user":"SOMEUSER","version":"11.0.1.2"}
{"reqId":"cxnuE0JTL4bX6ur3aJ58","remoteAddr":"SOME_OTHER_IP_HERE","app":"webdav","message":"Exception: {"Message":"HTTP\/1.1 404 File not found: groups in 'addressbooks'","Exception":"Sabre\\DAV\\Exception\\NotFound","Code":0,"Trace":"#0 \/var\/www\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Tree.php(76): Sabre\\DAV\\SimpleCollection->getChild('groups')\n#1 \/var\/www\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Tree.php(71): Sabre\\DAV\\Tree->getNodeForPath('addressbooks\/gr...')\n#2 \/var\/www\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(939): Sabre\\DAV\\Tree->getNodeForPath('addressbooks\/gr...')\n#3 \/var\/www\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/CorePlugin.php(336): Sabre\\DAV\\Server->getPropertiesForPath('addressbooks\/gr...', Array, 1)\n#4 [internal function]: Sabre\\DAV\\CorePlugin->httpPropFind(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))\n#5 \/var\/www\/nextcloud\/3rdparty\/sabre\/event\/lib\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\n#6 \/var\/www\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(479): Sabre\\Event\\EventEmitter->emit('method:PROPFIND', Array)\n#7 \/var\/www\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(254): Sabre\\DAV\\Server->invokeMethod(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))\n#8 \/var\/www\/nextcloud\/apps\/dav\/lib\/Server.php(227): Sabre\\DAV\\Server->exec()\n#9 \/var\/www\/nextcloud\/apps\/dav\/appinfo\/v2\/remote.php(30): OCA\\DAV\\Server->exec()\n#10 \/var\/www\/nextcloud\/remote.php(165): require_once('\/var\/www\/nextcl...')\n#11 {main}","File":"\/var\/www\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/SimpleCollection.php","Line":91,"User":"SOMEUSER"}","level":0,"time":"2017-02-06T12:22:43+00:00","method":"PROPFIND","url":"/nextcloud/remote.php/dav/addressbooks/groups/admin/","user":"SOMEUSER","version":"11.0.1.2"}
{"reqId":"lbQCtOEwZC1uF7BVw/TW","remoteAddr":"SOME_IP_HERE","app":"DeleteOrphanedItems","message":"0 orphaned system tag relations deleted","level":0,"time":"2017-02-06T12:23:00+00:00","method":"GET","url":"/nextcloud/cron.php","user":"--","version":"11.0.1.2"}
{"reqId":"lbQCtOEwZC1uF7BVw/TW","remoteAddr":"SOME_IP_HERE","app":"DeleteOrphanedItems","message":"0 orphaned user tag relations deleted","level":0,"time":"2017-02-06T12:23:00+00:00","method":"GET","url":"/nextcloud/cron.php","user":"--","version":"11.0.1.2"}
{"reqId":"lbQCtOEwZC1uF7BVw/TW","remoteAddr":"SOME_IP_HERE","app":"DeleteOrphanedItems","message":"0 orphaned comments deleted","level":0,"time":"2017-02-06T12:23:00+00:00","method":"GET","url":"/nextcloud/cron.php","user":"--","version":"11.0.1.2"}
{"reqId":"lbQCtOEwZC1uF7BVw/TW","remoteAddr":"SOME_IP_HERE","app":"DeleteOrphanedItems","message":"0 orphaned comment read marks deleted","level":0,"time":"2017-02-06T12:23:00+00:00","method":"GET","url":"/nextcloud/cron.php","user":"--","version":"11.0.1.2"}
{"reqId":"kx+dXZ9qiAMV3vYFYVRp","remoteAddr":"SOME_OTHER_IP_HERE","app":"webdav","message":"Exception: {"Message":"HTTP\/1.1 404 File not found: groups in 'addressbooks'","Exception":"Sabre\\DAV\\Exception\\NotFound","Code":0,"Trace":"#0 \/var\/www\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Tree.php(76): Sabre\\DAV\\SimpleCollection->getChild('groups')\n#1 \/var\/www\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Tree.php(71): Sabre\\DAV\\Tree->getNodeForPath('addressbooks\/gr...')\n#2 \/var\/www\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(939): Sabre\\DAV\\Tree->getNodeForPath('addressbooks\/gr...')\n#3 \/var\/www\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/CorePlugin.php(336): Sabre\\DAV\\Server->getPropertiesForPath('addressbooks\/gr...', Array, 1)\n#4 [internal function]: Sabre\\DAV\\CorePlugin->httpPropFind(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))\n#5 \/var\/www\/nextcloud\/3rdparty\/sabre\/event\/lib\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\n#6 \/var\/www\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(479): Sabre\\Event\\EventEmitter->emit('method:PROPFIND', Array)\n#7 \/var\/www\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(254): Sabre\\DAV\\Server->invokeMethod(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))\n#8 \/var\/www\/nextcloud\/apps\/dav\/lib\/Server.php(227): Sabre\\DAV\\Server->exec()\n#9 \/var\/www\/nextcloud\/apps\/dav\/appinfo\/v2\/remote.php(30): OCA\\DAV\\Server->exec()\n#10 \/var\/www\/nextcloud\/remote.php(165): require_once('\/var\/www\/nextcl...')\n#11 {main}","File":"\/var\/www\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/SimpleCollection.php","Line":91,"User":"SOMEUSER"}","level":0,"time":"2017-02-06T12:34:53+00:00","method":"PROPFIND","url":"/nextcloud/remote.php/dav/addressbooks/groups/admin/","user":"SOMEUSER","version":"11.0.1.2"}

Has anybody experienced the same issue ?

@kozarev Your issue seems to be not related to this. You have an issue with the L10N.php library. Please open a new issue for that.

@Ramalama2 The L simply means that it stops processing the rules after that. R means redirect and we use code 302 for that. It should be the bottom one, but DavClnt should be written within quotes. You should use a 302 redirect in that case, as this is not a permanent solution and I hope that Microsoft fixes the issue one day.

Thank you very much!!! :-)

@Flole998 thank you for your fixes.
I can confirm this issue and also that your fixes works fine!

@Flole998 Could also https://github.com/nextcloud/server/pull/3370 fix the issue in here?

Just to prevent confusion: This patch is compatible with the htaccess patch. They can be used at the same time.
WebDavLockFinal.patch.txt

@Flole998 Is there a less intrusive way than this commenting out of actual code? What is the user agent of the windows device?

3370 is not going to fix the lock issue. As every office version uses a different user agent and windows explorer also uses 2 different versions. For mac os it is also required so it would be possible to add more user agents to that check but it would make absolutely no sense to not enable lock feature for every client. Also it is required to add the 200 status code to the fake lock php file as seen in the patch.

Cc @lukasreschke for the fake locker

Hello,

After installing the two scripts I still can not connect to webdav via Windows

Here is a screen in French of the problems encountered.

image

Translation : The folder you entered does not appear to be valid. Choose another one

Second message when connecting via network drive

image

Translation: Mutual authentication failed. Server passwords are deprecated on the domain controller

How can i apply the .patch ?

@Domoel Typically by using the patch program, you should probably already have it on your system, but if not, it should be properly packaged like https://packages.debian.org/stretch/patch

Typical usage is:

patch <patchfile

A git apply will do, too, even if you're outside a git repository, if you're on a strange setup with git but not patch you can try it, same way: git apply < patchfile.

Im using a Synology DS for nextcloud and dont know how to do it this way. :/ Sorry ^^

I can confirm the issue is still present in NextCloud 11.0.2 (with LOCK, as mentioned in #3672):

Apache-Log:

192.168.1.1 - foo [07/Mar/2017:15:48:04 +0100] "LOCK /remote.php/webdav/foo/Test.JPG HTTP/1.1" 500 303 "-" "Microsoft-WebDAV-MiniRedir/6.1.7601" 0

NextCloud-Log:

[FATAL] LOCK /remote.php/webdav/foo/Test.JPG
[FATAL] User: 'foo'
[FATAL] Exception: "HTTP/1.1 500 No subsystem set a valid HTTP status code. Something must have interrupted the request without providing further detail."
[FATAL] Trace:
 #0 /var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php(254): Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
 #1 /var/www/html/nextcloud/apps/dav/appinfo/v1/webdav.php(60): Sabre\DAV\Server->exec()
 #2 /var/www/html/nextcloud/remote.php(165): require_once('/var/www/html/n...')

Thanks for the details, will make a patch

@nickvergessen There is already a patch which i made available above, it just needs to be converted into a PR.

Yes, patch is in #3757

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alvVDC picture alvVDC  Â·  117Comments

hartundweich picture hartundweich  Â·  71Comments

iG8R picture iG8R  Â·  85Comments

philippe-levan picture philippe-levan  Â·  78Comments

mightyBroccoli picture mightyBroccoli  Â·  92Comments