-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow ext storage Local to go unavailable #39707
Allow ext storage Local to go unavailable #39707
Conversation
I've tested with desktop client 3.9.0 and it did not delete the unavailable folder. However the desktop client complained repeatedly about the folder causing an error. <?xml version="1.0" encoding="utf-8"?>
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
<s:exception>Sabre\DAV\Exception\ServiceUnavailable</s:exception>
<s:message>Storage is temporarily not available</s:message>
</d:error> I'm guessing something is missing to have the exception name be properly propagated into the XML as StorageNotAvailableException.
|
from what I see, other storages tend to throw that exception in regular methods, not in the constructor. Currently throwing the exception will trigger a |
Found it, it seems that StorageNotAvailableException is converted to ServiceNotAvailableException... why not preserve it or convert to Webdav ? https://github.com/nextcloud/server/blob/bugfix/39706/local-ext-storage-unavailable-mode/apps/dav/lib/Connector/Sabre/ObjectTree.php#L161 I think I remembered it wrong and this distinction was never implemented on the client side, or a different approach was used ? Searching for StorageNotAvailableException in the desktop client code did not show results. @tobiasKaminsky Or is the distinction done whether the 503 is returned on the root or on a subdir ? In any case it would be good to have errors be less flashy when a storage is not mounted, but still let the user know somehow, maybe only once the first time ? |
521aeb4
to
92c44c6
Compare
I'm currently investigating a scenario where metadata (tags, shares, etc) were lost after the main data directory which was on an NFS went offline. Would such a check also make sense for the data directory itself? |
It should already do this by checking for the existing of the |
Whenever an external storage of type Local points at a non-existing directory, process this as a StorageNotAvailable instead of returning 404. This makes desktop clients ignore the folder instead of deleting it when it becomes unavailable. The code change was limited to external storages to avoid issues during setup and with the default home storage. Signed-off-by: Vincent Petry <pvince81@yahoo.fr>
92c44c6
to
8d1a3da
Compare
@PVince81 is it fine when I merge this or do you want to address the missing point first? Would also be okay to do this in follow-up imho :) |
Summary
Whenever an external storage of type Local points at a non-existing directory, process this as a StorageNotAvailable instead of returning 404.
This makes desktop clients ignore the folder instead of deleting it when it becomes unavailable.
The code change was limited to external storages to avoid issues during setup and with the default home storage.
TODO
Checklist