{"action":"created","issue":{"url":"https://api.github.com/repos/owncloud/core/issues/21033","labels_url":"https://api.github.com/repos/owncloud/core/issues/21033/labels{/name}","comments_url":"https://api.github.com/repos/owncloud/core/issues/21033/comments","events_url":"https://api.github.com/repos/owncloud/core/issues/21033/events","html_url":"https://github.com/owncloud/core/issues/21033","id":120976157,"number":21033,"title":"S2S is not able to handle errors properly. Resulting in broken WebDAV + undeletable files","user":{"login":"LukasReschke","id":878997,"avatar_url":"https://avatars.githubusercontent.com/u/878997?v=3","gravatar_id":"","url":"https://api.github.com/users/LukasReschke","html_url":"https://github.com/LukasReschke","followers_url":"https://api.github.com/users/LukasReschke/followers","following_url":"https://api.github.com/users/LukasReschke/following{/other_user}","gists_url":"https://api.github.com/users/LukasReschke/gists{/gist_id}","starred_url":"https://api.github.com/users/LukasReschke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LukasReschke/subscriptions","organizations_url":"https://api.github.com/users/LukasReschke/orgs","repos_url":"https://api.github.com/users/LukasReschke/repos","events_url":"https://api.github.com/users/LukasReschke/events{/privacy}","received_events_url":"https://api.github.com/users/LukasReschke/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/owncloud/core/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/owncloud/core/labels/feature:federated-cloud-sharing","name":"feature:federated-cloud-sharing","color":"d4c5f9"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-08T10:12:54Z","updated_at":"2015-12-08T16:07:10Z","closed_at":null,"body":"Federated Cloud Sharing is not able to properly handle error cases, if the remote server does not return an expected output there is a lot of stuff that goes wrong.\r\n\r\nOne example:\r\n\r\n1. From ownCloud 8.0 server share to ownCloud 8.2 server\r\n2. From ownCloud 8.2 server accept the share\r\n3. From ownCloud 8.0 server delete the file\r\n\r\nNow when accessing the public link WebDAV URL this will throw a fatal error on the 8.0 server. In newer releases we don't throw the fatal error anymore. This bug however means that an error on a remote ownCloud S2S server can totally make your own ownCloud server go wrong:\r\n\r\n> {\"reqId\":\"LjCCj8473fantn8XAZH5\",\"remoteAddr\":\"31.10.132.38\",\"app\":\"PHP\",\"message\":\"Call to a member function getType() on a non-object at \\/var\\/www\\/html\\/owncloud\\/apps\\/files_sharing\\/publicwebdav.php#79\",\"level\":3,\"time\":\"2015-12-04T11:36:28+01:00\",\"method\":\"GET\",\"url\":\"\\/public.php\\/webdav\"}\r\n\r\nSyncing with the 8.2 server using the ownCloud client will now be not possible anymore as the XML response contains an error. Also deleting the file is not really possible. Nightmare as it requires fiddling in the database to fix it. The WebDAV response is:\r\n\r\n> ➜  ~  curl https://s3.owncloud.com/owncloud/remote.php/webdav/ -X PROPFIND -u lukas | xmllint --format -\r\n\r\n```xml\r\n  <d:response>\r\n    <d:href>/owncloud/remote.php/webdav/ownCloudUserManual.pdf</d:href>\r\n    <d:propstat>\r\n      <d:prop>\r\n        <d:getlastmodified>Wed, 15 Jul 2015 23:26:28 GMT</d:getlastmodified>\r\n        <d:getcontentlength>2215875</d:getcontentlength>\r\n        <d:resourcetype/>\r\n        <d:getetag>\"7aad56ba3eedec2c78100df1dec23066\"</d:getetag>\r\n        <d:getcontenttype>application/pdf</d:getcontenttype>\r\n      </d:prop>\r\n      <d:status>HTTP/1.1 200 OK</d:status>\r\n    </d:propstat>\r\n  </d:response>\r\n```\r\n\r\nAccessing the folder using a PROPFIND that our client issues will however explode hard:\r\n```http \r\nPROPFIND /owncloud/remote.php/webdav/ HTTP/1.1\r\nDepth: 1\r\nUser-Agent: Mozilla/5.0 (Macintosh) mirall/2.1.0\r\nContent-Type: text/xml; charset=utf-8\r\nContent-Length: 291\r\nConnection: Keep-Alive\r\nAccept-Encoding: gzip, deflate\r\nAccept-Language: en-US,*\r\nHost: s3.owncloud.com\r\n\r\n<?xml version=\"1.0\" ?>\r\n<d:propfind xmlns:d=\"DAV:\" xmlns:oc=\"http://owncloud.org/ns\">\r\n  <d:prop>\r\n    <d:resourcetype />\r\n    <d:getlastmodified />\r\n    <d:getcontentlength />\r\n    <d:getetag />\r\n    <oc:id />\r\n    <oc:downloadURL />\r\n    <oc:dDC />\r\n    <oc:permissions />\r\n  </d:prop>\r\n</d:propfind>\r\n```\r\n\r\n```http\r\nHTTP/1.1 500 Internal Server Error\r\nDate: Tue, 08 Dec 2015 10:11:30 GMT\r\nServer: Apache\r\nX-Powered-By: PHP/5.6.9\r\nExpires: Thu, 19 Nov 1981 08:52:00 GMT\r\nCache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0\r\nPragma: no-cache\r\nContent-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; frame-src *; img-src * data: blob:; font-src 'self' data:; media-src *; connect-src *\r\nX-XSS-Protection: 1; mode=block\r\nX-Content-Type-Options: nosniff\r\nX-Frame-Options: Sameorigin\r\nX-Robots-Tag: none\r\nContent-Length: 191\r\nConnection: close\r\nContent-Type: application/xml; charset=utf-8\r\n\r\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<d:error xmlns:d=\"DAV:\" xmlns:s=\"http://sabredav.org/ns\">\r\n  <s:exception>OCP\\Files\\StorageNotAvailableException</s:exception>\r\n  <s:message/>\r\n</d:error>\r\n```\r\n\r\nThe server log says:\r\n```\r\n{\"reqId\":\"CbgA5p0GRKRhwcY7PE5T\",\"remoteAddr\":\"81.62.32.191\",\"app\":\"webdav\",\"message\":\"Exception: {\\\"Message\\\":\\\"\\\",\\\"Exception\\\":\\\"OCP\\\\\\\\Files\\\\\\\\StorageNotAvailableException\\\",\\\"Code\\\":0,\\\"Trace\\\":\\\"#0 \\\\\\/srv\\\\\\/www\\\\\\/htdocs\\\\\\/owncloud-8.2.0\\\\\\/lib\\\\\\/private\\\\\\/files\\\\\\/storage\\\\\\/wrapper\\\\\\/availability.php(421): OC\\\\\\\\Files\\\\\\\\Storage\\\\\\\\Wrapper\\\\\\\\Availability->checkAvailability()\\\\n#1 \\\\\\/srv\\\\\\/www\\\\\\/htdocs\\\\\\/owncloud-8.2.0\\\\\\/lib\\\\\\/private\\\\\\/files\\\\\\/storage\\\\\\/wrapper\\\\\\/wrapper.php(498): OC\\\\\\\\Files\\\\\\\\Storage\\\\\\\\Wrapper\\\\\\\\Availability->getDirectDownload('')\\\\n#2 \\\\\\/srv\\\\\\/www\\\\\\/htdocs\\\\\\/owncloud-8.2.0\\\\\\/lib\\\\\\/private\\\\\\/connector\\\\\\/sabre\\\\\\/file.php(334): OC\\\\\\\\Files\\\\\\\\Storage\\\\\\\\Wrapper\\\\\\\\Wrapper->getDirectDownload('')\\\\n#3 \\\\\\/srv\\\\\\/www\\\\\\/htdocs\\\\\\/owncloud-8.2.0\\\\\\/lib\\\\\\/private\\\\\\/connector\\\\\\/sabre\\\\\\/filesplugin.php(187): OC\\\\\\\\Connector\\\\\\\\Sabre\\\\\\\\File->getDirectDownload()\\\\n#4 \\\\\\/srv\\\\\\/www\\\\\\/htdocs\\\\\\/owncloud-8.2.0\\\\\\/3rdparty\\\\\\/sabre\\\\\\/dav\\\\\\/lib\\\\\\/DAV\\\\\\/PropFind.php(98): OC\\\\\\\\Connector\\\\\\\\Sabre\\\\\\\\FilesPlugin->OC\\\\\\\\Connector\\\\\\\\Sabre\\\\\\\\{closure}()\\\\n#5 \\\\\\/srv\\\\\\/www\\\\\\/htdocs\\\\\\/owncloud-8.2.0\\\\\\/lib\\\\\\/private\\\\\\/connector\\\\\\/sabre\\\\\\/filesplugin.php(192): Sabre\\\\\\\\DAV\\\\\\\\PropFind->handle('{http:\\\\\\/\\\\\\/ownclou...', Object(Closure))\\\\n#6 [internal function]: OC\\\\\\\\Connector\\\\\\\\Sabre\\\\\\\\FilesPlugin->handleGetProperties(Object(Sabre\\\\\\\\DAV\\\\\\\\PropFind), Object(OC\\\\\\\\Connector\\\\\\\\Sabre\\\\\\\\File))\\\\n#7 \\\\\\/srv\\\\\\/www\\\\\\/htdocs\\\\\\/owncloud-8.2.0\\\\\\/3rdparty\\\\\\/sabre\\\\\\/event\\\\\\/lib\\\\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\\\n#8 \\\\\\/srv\\\\\\/www\\\\\\/htdocs\\\\\\/owncloud-8.2.0\\\\\\/3rdparty\\\\\\/sabre\\\\\\/dav\\\\\\/lib\\\\\\/DAV\\\\\\/Server.php(1016): Sabre\\\\\\\\Event\\\\\\\\EventEmitter->emit('propFind', Array)\\\\n#9 \\\\\\/srv\\\\\\/www\\\\\\/htdocs\\\\\\/owncloud-8.2.0\\\\\\/3rdparty\\\\\\/sabre\\\\\\/dav\\\\\\/lib\\\\\\/DAV\\\\\\/Server.php(936): Sabre\\\\\\\\DAV\\\\\\\\Server->getPropertiesByNode(Object(Sabre\\\\\\\\DAV\\\\\\\\PropFind), Object(OC\\\\\\\\Connector\\\\\\\\Sabre\\\\\\\\File))\\\\n#10 \\\\\\/srv\\\\\\/www\\\\\\/htdocs\\\\\\/owncloud-8.2.0\\\\\\/3rdparty\\\\\\/sabre\\\\\\/dav\\\\\\/lib\\\\\\/DAV\\\\\\/CorePlugin.php(327): Sabre\\\\\\\\DAV\\\\\\\\Server->getPropertiesForPath('', Array, 1)\\\\n#11 [internal function]: Sabre\\\\\\\\DAV\\\\\\\\CorePlugin->httpPropfind(Object(Sabre\\\\\\\\HTTP\\\\\\\\Request), Object(Sabre\\\\\\\\HTTP\\\\\\\\Response))\\\\n#12 \\\\\\/srv\\\\\\/www\\\\\\/htdocs\\\\\\/owncloud-8.2.0\\\\\\/3rdparty\\\\\\/sabre\\\\\\/event\\\\\\/lib\\\\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\\\n#13 \\\\\\/srv\\\\\\/www\\\\\\/htdocs\\\\\\/owncloud-8.2.0\\\\\\/3rdparty\\\\\\/sabre\\\\\\/dav\\\\\\/lib\\\\\\/DAV\\\\\\/Server.php(469): Sabre\\\\\\\\Event\\\\\\\\EventEmitter->emit('method:PROPFIND', Array)\\\\n#14 \\\\\\/srv\\\\\\/www\\\\\\/htdocs\\\\\\/owncloud-8.2.0\\\\\\/3rdparty\\\\\\/sabre\\\\\\/dav\\\\\\/lib\\\\\\/DAV\\\\\\/Server.php(254): Sabre\\\\\\\\DAV\\\\\\\\Server->invokeMethod(Object(Sabre\\\\\\\\HTTP\\\\\\\\Request), Object(Sabre\\\\\\\\HTTP\\\\\\\\Response))\\\\n#15 \\\\\\/srv\\\\\\/www\\\\\\/htdocs\\\\\\/owncloud-8.2.0\\\\\\/apps\\\\\\/files\\\\\\/appinfo\\\\\\/remote.php(55): Sabre\\\\\\\\DAV\\\\\\\\Server->exec()\\\\n#16 \\\\\\/srv\\\\\\/www\\\\\\/htdocs\\\\\\/owncloud-8.2.0\\\\\\/remote.php(137): require_once('\\\\\\/srv\\\\\\/www\\\\\\/htdocs...')\\\\n#17 {main}\\\",\\\"File\\\":\\\"\\\\\\/srv\\\\\\/www\\\\\\/htdocs\\\\\\/owncloud-8.2.0\\\\\\/lib\\\\\\/private\\\\\\/files\\\\\\/storage\\\\\\/wrapper\\\\\\/availability.php\\\",\\\"Line\\\":63}\",\"level\":4,\"time\":\"2015-12-08T10:15:27+00:00\",\"method\":\"PROPFIND\",\"url\":\"\\/owncloud\\/remote.php\\/webdav\\/\"}\r\n```\r\n<hr/>\r\n\r\nRef https://github.com/owncloud/enterprise/issues/933\r\n\r\n<hr/>\r\n\r\n@icewind1991 @schiesbn "},"comment":{"url":"https://api.github.com/repos/owncloud/core/issues/comments/162930314","html_url":"https://github.com/owncloud/core/issues/21033#issuecomment-162930314","issue_url":"https://api.github.com/repos/owncloud/core/issues/21033","id":162930314,"user":{"login":"PVince81","id":277525,"avatar_url":"https://avatars.githubusercontent.com/u/277525?v=3","gravatar_id":"","url":"https://api.github.com/users/PVince81","html_url":"https://github.com/PVince81","followers_url":"https://api.github.com/users/PVince81/followers","following_url":"https://api.github.com/users/PVince81/following{/other_user}","gists_url":"https://api.github.com/users/PVince81/gists{/gist_id}","starred_url":"https://api.github.com/users/PVince81/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PVince81/subscriptions","organizations_url":"https://api.github.com/users/PVince81/orgs","repos_url":"https://api.github.com/users/PVince81/repos","events_url":"https://api.github.com/users/PVince81/events{/privacy}","received_events_url":"https://api.github.com/users/PVince81/received_events","type":"User","site_admin":false},"created_at":"2015-12-08T16:07:10Z","updated_at":"2015-12-08T16:07:10Z","body":"Note that some better error handling has been added recently. I don't think this was backported to 8.0."}}