From c8a29ec94287855bcd02aad6e315a9656ba0183d Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Thu, 30 Nov 2017 21:29:06 +0100 Subject: [PATCH] A failed storage is a not available storage We have to double check. Since getting the info of the root returns a generic entry. But actually the stroage is not available. Else we get very weird sync and web behavior. Signed-off-by: Roeland Jago Douma --- apps/dav/lib/Connector/Sabre/ObjectTree.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/dav/lib/Connector/Sabre/ObjectTree.php b/apps/dav/lib/Connector/Sabre/ObjectTree.php index 41bfceeab9..d05f0857ec 100644 --- a/apps/dav/lib/Connector/Sabre/ObjectTree.php +++ b/apps/dav/lib/Connector/Sabre/ObjectTree.php @@ -29,6 +29,7 @@ namespace OCA\DAV\Connector\Sabre; +use OC\Files\Storage\FailedStorage; use OCA\DAV\Connector\Sabre\Exception\Forbidden; use OCA\DAV\Connector\Sabre\Exception\InvalidPath; use OCA\DAV\Connector\Sabre\Exception\FileLocked; @@ -154,6 +155,10 @@ class ObjectTree extends CachingTree { // read from cache try { $info = $this->fileView->getFileInfo($path); + + if ($info->getStorage()->instanceOfStorage(FailedStorage::class)) { + throw new StorageNotAvailableException(); + } } catch (StorageNotAvailableException $e) { throw new \Sabre\DAV\Exception\ServiceUnavailable('Storage is temporarily not available'); } catch (StorageInvalidException $e) {