Repository navigation
Closed
Description
Due to the move to exceptions instead of true/false as return value:
1) Test\Files\Storage\DAV::testDirectories with data set #0 ('folder')
OCP\Files\StorageNotAvailableException: Sabre\DAV\Exception\MethodNotAllowed: Method not allowed
/var/jenkins/workspace/server-master-linux-externals/database/sqlite/external/webdav-ownCloud/label/vm-slave-02/lib/private/files/storage/dav.php:572
/var/jenkins/workspace/server-master-linux-externals/database/sqlite/external/webdav-ownCloud/label/vm-slave-02/lib/private/files/storage/dav.php:444
/var/jenkins/workspace/server-master-linux-externals/database/sqlite/external/webdav-ownCloud/label/vm-slave-02/lib/private/files/storage/dav.php:101
/var/jenkins/workspace/server-master-linux-externals/database/sqlite/external/webdav-ownCloud/label/vm-slave-02/tests/lib/files/storage/storage.php:88
2) Test\Files\Storage\DAV::testDirectories with data set #1 (' folder')
OCP\Files\StorageNotAvailableException: Sabre\DAV\Exception\MethodNotAllowed: Method not allowed
/var/jenkins/workspace/server-master-linux-externals/database/sqlite/external/webdav-ownCloud/label/vm-slave-02/lib/private/files/storage/dav.php:572
/var/jenkins/workspace/server-master-linux-externals/database/sqlite/external/webdav-ownCloud/label/vm-slave-02/lib/private/files/storage/dav.php:444
/var/jenkins/workspace/server-master-linux-externals/database/sqlite/external/webdav-ownCloud/label/vm-slave-02/lib/private/files/storage/dav.php:101
/var/jenkins/workspace/server-master-linux-externals/database/sqlite/external/webdav-ownCloud/label/vm-slave-02/tests/lib/files/storage/storage.php:88
3) Test\Files\Storage\DAV::testDirectories with data set #2 ('folder ')
OCP\Files\StorageNotAvailableException: Sabre\DAV\Exception\MethodNotAllowed: Method not allowed
/var/jenkins/workspace/server-master-linux-externals/database/sqlite/external/webdav-ownCloud/label/vm-slave-02/lib/private/files/storage/dav.php:572
/var/jenkins/workspace/server-master-linux-externals/database/sqlite/external/webdav-ownCloud/label/vm-slave-02/lib/private/files/storage/dav.php:444
/var/jenkins/workspace/server-master-linux-externals/database/sqlite/external/webdav-ownCloud/label/vm-slave-02/lib/private/files/storage/dav.php:101
/var/jenkins/workspace/server-master-linux-externals/database/sqlite/external/webdav-ownCloud/label/vm-slave-02/tests/lib/files/storage/storage.php:88
4) Test\Files\Storage\DAV::testDirectories with data set #3 ('folder with space')
OCP\Files\StorageNotAvailableException: Sabre\DAV\Exception\MethodNotAllowed: Method not allowed
/var/jenkins/workspace/server-master-linux-externals/database/sqlite/external/webdav-ownCloud/label/vm-slave-02/lib/private/files/storage/dav.php:572
/var/jenkins/workspace/server-master-linux-externals/database/sqlite/external/webdav-ownCloud/label/vm-slave-02/lib/private/files/storage/dav.php:444
/var/jenkins/workspace/server-master-linux-externals/database/sqlite/external/webdav-ownCloud/label/vm-slave-02/lib/private/files/storage/dav.php:101
/var/jenkins/workspace/server-master-linux-externals/database/sqlite/external/webdav-ownCloud/label/vm-slave-02/tests/lib/files/storage/storage.php:88
5) Test\Files\Storage\DAV::testDirectories with data set #4 ('spéciäl földer')
OCP\Files\StorageNotAvailableException: Sabre\DAV\Exception\MethodNotAllowed: Method not allowed
/var/jenkins/workspace/server-master-linux-externals/database/sqlite/external/webdav-ownCloud/label/vm-slave-02/lib/private/files/storage/dav.php:572
/var/jenkins/workspace/server-master-linux-externals/database/sqlite/external/webdav-ownCloud/label/vm-slave-02/lib/private/files/storage/dav.php:444
/var/jenkins/workspace/server-master-linux-externals/database/sqlite/external/webdav-ownCloud/label/vm-slave-02/lib/private/files/storage/dav.php:101
/var/jenkins/workspace/server-master-linux-externals/database/sqlite/external/webdav-ownCloud/label/vm-slave-02/tests/lib/files/storage/storage.php:88
6) Test\Files\Storage\DAV::testMimeType
OCP\Files\StorageNotAvailableException: Sabre\DAV\Exception\NotFound: Resource not found.
/var/jenkins/workspace/server-master-linux-externals/database/sqlite/external/webdav-ownCloud/label/vm-slave-02/lib/private/files/storage/dav.php:572
/var/jenkins/workspace/server-master-linux-externals/database/sqlite/external/webdav-ownCloud/label/vm-slave-02/lib/private/files/storage/dav.php:402
/var/jenkins/workspace/server-master-linux-externals/database/sqlite/external/webdav-ownCloud/label/vm-slave-02/tests/lib/files/storage/storage.php:149
cc @icewind1991 @PVince81 Can you fix that? I simply just can fix the tests regarding what is currently implemented and not what is actually wanted. So it's maybe better if you fix the unit tests ;) Thanks
If you have docker installed you can simply run ./autotest-external.sh sqlite otherwise add the files_external app to the enable_apps-php and run the ./autotest.sh sqlite PATHTOFILE ;)
Activity
DeepDiver1975 commentedon Jan 29, 2015
started to break in https://ci.owncloud.org/job/server-master-linux-externals/498/
MorrisJobke commentedon Jan 29, 2015
@DeepDiver1975 404 :(
PVince81 commentedon Jan 30, 2015
@MorrisJobke
./../apps/files_external/tests/env/start-webdav-ownCloud.sh: line 29: replace: command not foundPVince81 commentedon Jan 30, 2015
@MorrisJobke
Isn't the setup fully automatic or I need to manually edit some configs ?
PVince81 commentedon Jan 30, 2015
Looking at the error message: we should probably rethrow "MethodNotAllowed" or return false... because "MethodNotAllowed" does not mean that the storage is not available.
PVince81 commentedon Jan 30, 2015
and it seems in some cases the exception is "NotFound" which might be expected. Need to catch that too.
PVince81 commentedon Jan 30, 2015
What a mess... we shouldn't have introduced exceptions that early, or not catch it this way.
The problem is that other storages will not throw exceptions, but that "storage.php" unit test applies for all. We probably don't want to set different expectations for different storages right now, until we move everything to using exceptions.
Still trying to continue patching...
PVince81 commentedon Jan 30, 2015
Fix is here: #13791
RobinMcCorkell commentedon Jan 30, 2015
(not specific to this issue in particular, just writing down my thoughts)
The thing I don't like about exception handling in storages is that code needs to be massively duplicated - every storage method needs to handle exceptions that may be thrown by 3rd party code, then either rethrow a useful exception or return false. I wish there was some way we could avoid having hundreds of
try{} catch{}blocks...PVince81 commentedon Jan 30, 2015
I think in other software usually they would have their own exceptions:
Storage\NotFound,Storage\Forbidden,Storage\MethodNotAllowedand they would wrap the 3rd party code's exception into their own and rethrow. That would still require catching the exceptions everywhere or using something like thatconvertSabreException.But like you I'm also wondering how to avoid having so many try/catch blocks.
Let's continue the discussion in this ticket: #13792
MorrisJobke commentedon Jan 30, 2015
Fix is in #13791
DeepDiver1975 commentedon Feb 3, 2015
merged -> close