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
Special characters in file name cause fatal exception in webdav #6594
changed the title [-]Special characters in file name cause fatal exception[/-][+]Special characters in file name cause fatal exception in webdav[/+]on Sep 20, 2017
We should also look into the log levels, because those are basically user errors, that should not be logged in the server (at least only in debug log).
❌ Creating a folder (log level 4):
{"reqId":"hXHDSNaLu9iWEEWHGb8L","level":4,"time":"2018-01-03T10:40:00+00:00","remoteAddr":"192.168.99.1","user":"admin","app":"webdav","method":"MKCOL","url":"\/server\/remote.php\/webdav\/dsfb\/dsaf","message":"Exception: {\"Exception\":\"Sabre\\\\DAV\\\\Exception\\\\Conflict\",\"Message\":\"Parent node does not exist\",\"Code\":0,\"Trace\":\"#0 \\\/srv\\\/projects\\\/server\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/CorePlugin.php(590): Sabre\\\\DAV\\\\Server->createCollection('dsfb\\\/dsaf', Object(Sabre\\\\DAV\\\\MkCol))\\n#1 [internal function]: Sabre\\\\DAV\\\\CorePlugin->httpMkcol(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#2 \\\/srv\\\/projects\\\/server\\\/3rdparty\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n#3 \\\/srv\\\/projects\\\/server\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(479): Sabre\\\\Event\\\\EventEmitter->emit('method:MKCOL', Array)\\n#4 \\\/srv\\\/projects\\\/server\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(254): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#5 \\\/srv\\\/projects\\\/server\\\/apps\\\/dav\\\/appinfo\\\/v1\\\/webdav.php(80): Sabre\\\\DAV\\\\Server->exec()\\n#6 \\\/srv\\\/projects\\\/server\\\/remote.php(164): require_once('\\\/srv\\\/projects\\\/s...')\\n#7 {main}\",\"File\":\"\\\/srv\\\/projects\\\/server\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php\",\"Line\":1167}","userAgent":"Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_13_2) AppleWebKit\/604.4.7 (KHTML, like Gecko) Version\/11.0.2 Safari\/604.4.7","version":"13.0.0.8"}
✅ Creating a file (log level 0):
{"reqId":"InZ000tumdfmR0fzpp29","level":0,"time":"2018-01-03T10:41:37+00:00","remoteAddr":"192.168.99.1","user":"admin","app":"webdav","method":"PUT","url":"\/server\/remote.php\/webdav\/test\/asdf.txt","message":"Exception: {\"Exception\":\"Sabre\\\\DAV\\\\Exception\\\\NotFound\",\"Message\":\"File with name test could not be located\",\"Code\":0,\"Trace\":\"#0 \\\/srv\\\/projects\\\/server\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(1083): OCA\\\\DAV\\\\Connector\\\\Sabre\\\\ObjectTree->getNodeForPath('test')\\n#1 \\\/srv\\\/projects\\\/server\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/CorePlugin.php(525): Sabre\\\\DAV\\\\Server->createFile('test\\\/asdf.txt', Resource id #23, NULL)\\n#2 [internal function]: Sabre\\\\DAV\\\\CorePlugin->httpPut(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#3 \\\/srv\\\/projects\\\/server\\\/3rdparty\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n#4 \\\/srv\\\/projects\\\/server\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(479): Sabre\\\\Event\\\\EventEmitter->emit('method:PUT', Array)\\n#5 \\\/srv\\\/projects\\\/server\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(254): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#6 \\\/srv\\\/projects\\\/server\\\/apps\\\/dav\\\/appinfo\\\/v1\\\/webdav.php(80): Sabre\\\\DAV\\\\Server->exec()\\n#7 \\\/srv\\\/projects\\\/server\\\/remote.php(164): require_once('\\\/srv\\\/projects\\\/s...')\\n#8 {main}\",\"File\":\"\\\/srv\\\/projects\\\/server\\\/apps\\\/dav\\\/lib\\\/Connector\\\/Sabre\\\/ObjectTree.php\",\"Line\":174}","userAgent":"Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_13_2) AppleWebKit\/604.4.7 (KHTML, like Gecko) Version\/11.0.2 Safari\/604.4.7","version":"13.0.0.8"}
❌ Renaming a folder (log level 4):
{"reqId":"f6rjHArrETc2Z8O2HUVF","level":4,"time":"2018-01-03T10:47:29+00:00","remoteAddr":"192.168.99.1","user":"admin","app":"webdav","method":"MOVE","url":"\/server\/remote.php\/webdav\/CFC","message":"Exception: {\"Exception\":\"Sabre\\\\DAV\\\\Exception\\\\Conflict\",\"Message\":\"The destination may not be part of the same subtree as the source path.\",\"Code\":0,\"Trace\":\"#0 \\\/srv\\\/projects\\\/server\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/CorePlugin.php(624): Sabre\\\\DAV\\\\Server->getCopyAndMoveInfo(Object(Sabre\\\\HTTP\\\\Request))\\n#1 [internal function]: Sabre\\\\DAV\\\\CorePlugin->httpMove(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#2 \\\/srv\\\/projects\\\/server\\\/3rdparty\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n#3 \\\/srv\\\/projects\\\/server\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(479): Sabre\\\\Event\\\\EventEmitter->emit('method:MOVE', Array)\\n#4 \\\/srv\\\/projects\\\/server\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(254): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#5 \\\/srv\\\/projects\\\/server\\\/apps\\\/dav\\\/appinfo\\\/v1\\\/webdav.php(80): Sabre\\\\DAV\\\\Server->exec()\\n#6 \\\/srv\\\/projects\\\/server\\\/remote.php(164): require_once('\\\/srv\\\/projects\\\/s...')\\n#7 {main}\",\"File\":\"\\\/srv\\\/projects\\\/server\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php\",\"Line\":772}","userAgent":"Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_13_2) AppleWebKit\/604.4.7 (KHTML, like Gecko) Version\/11.0.2 Safari\/604.4.7","version":"13.0.0.8"}
❌ Renaming a file (log level 4):
{"reqId":"1ZHxFTGvLuFhEM7dvvZi","level":4,"time":"2018-01-03T10:48:13+00:00","remoteAddr":"192.168.99.1","user":"admin","app":"webdav","method":"MOVE","url":"\/server\/remote.php\/webdav\/Bildschirmfoto%202017-11-30%20um%2023.09.28.png","message":"Exception: {\"Exception\":\"Sabre\\\\DAV\\\\Exception\\\\Conflict\",\"Message\":\"The destination node is not found\",\"Code\":0,\"Trace\":\"#0 \\\/srv\\\/projects\\\/server\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/CorePlugin.php(624): Sabre\\\\DAV\\\\Server->getCopyAndMoveInfo(Object(Sabre\\\\HTTP\\\\Request))\\n#1 [internal function]: Sabre\\\\DAV\\\\CorePlugin->httpMove(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#2 \\\/srv\\\/projects\\\/server\\\/3rdparty\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n#3 \\\/srv\\\/projects\\\/server\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(479): Sabre\\\\Event\\\\EventEmitter->emit('method:MOVE', Array)\\n#4 \\\/srv\\\/projects\\\/server\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(254): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#5 \\\/srv\\\/projects\\\/server\\\/apps\\\/dav\\\/appinfo\\\/v1\\\/webdav.php(80): Sabre\\\\DAV\\\\Server->exec()\\n#6 \\\/srv\\\/projects\\\/server\\\/remote.php(164): require_once('\\\/srv\\\/projects\\\/s...')\\n#7 {main}\",\"File\":\"\\\/srv\\\/projects\\\/server\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php\",\"Line\":749}","userAgent":"Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_13_2) AppleWebKit\/604.4.7 (KHTML, like Gecko) Version\/11.0.2 Safari\/604.4.7","version":"13.0.0.8"}
Activity
[-]Special characters in file name cause fatal exception[/-][+]Special characters in file name cause fatal exception in webdav[/+]blizzz commentedon Sep 25, 2017
Works for me™️ (i.e. cannot reproduce)
Please give a complete report using the template https://raw.github.com/nextcloud/core/master/issue_template.md
GiantCrocodile commentedon Sep 26, 2017
@blizzz Follow these steps:
<test>a</test>You get this exception:

It seems to be related to directories, not files. My description from first post was misleading. Sorry for this!
This happens on a Linux server with Postgresql, Nginx and PHP 7.0 in fpm mode.
MorrisJobke commentedon Jan 2, 2018
cc @icewind1991 @rullzer @danxuliu
MorrisJobke commentedon Jan 2, 2018
I could reproduce this by following the latest comment.
rullzer commentedon Jan 3, 2018
It is because of the final
/Lets take the folder
fooand you want to createbar/baz. Internally this is translated to createfoo/bar/bazSo we try to get the node
foo/barand create the folderbazin there. But of coursefoo/bardoens't exist yet.Long story short.
/should not be allowed in file/folder names as it is the default directory separator.MorrisJobke commentedon Jan 3, 2018
We should also look into the log levels, because those are basically user errors, that should not be logged in the server (at least only in debug log).
MorrisJobke commentedon Jan 3, 2018
The before mentioned logs are fixed in the second commit of #7676