Skip to content
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

Properly handle unavailable external storages #11792

Closed
1 of 9 tasks
PVince81 opened this issue Oct 27, 2014 · 17 comments
Closed
1 of 9 tasks

Properly handle unavailable external storages #11792

PVince81 opened this issue Oct 27, 2014 · 17 comments

Comments

@PVince81
Copy link
Contributor

PVince81 commented Oct 27, 2014

An unavailable external storage is whenever a storage has already been mounted once, the mount point exists, but one of the following occurred:

  1. Remote credentials/password changed
  2. Temporary network failure, remote not reachable

So far, not all the backends properly support this and some can have weird behaviors.
The only one that seems to work correctly is the "ownCloud" backend (and server to server sharing).

Here are the backends to verify and/or raise tickets for:

We need to make sure that every backend will throw a \OCP\Files\StorageNotAvailableException whenever one of the causes mentioned above appear.

@MTRichards @craigpg @karlitschek @icewind1991 @jvillafanez @jmaciasportela

@PVince81
Copy link
Contributor Author

The sync client also needs to be able to react to 503, this was raised here: owncloud/client#1923

@PVince81
Copy link
Contributor Author

PVince81 commented Nov 6, 2014

Note: it is the responsibility of the Storage class to decide whenever the remote error needs to lead to StorageNotAvailableException or another exception.

@PVince81 PVince81 added this to the 2014-sprint-08-next milestone Nov 6, 2014
@PVince81
Copy link
Contributor Author

PVince81 commented Nov 7, 2014

@icewind1991 can you help with this ?

@PVince81
Copy link
Contributor Author

PVince81 commented Nov 7, 2014

Goal is that when an ext storage isn't available WebDAV and Web UI still work instead of throwing 500.
Making the ext storages all raise \OCP\Files\StorageNotAvailableException when appropriate should make it work.
Note that #11992 #11992 needs to be merged first for it to work with WebDAV.

@PVince81 PVince81 modified the milestones: 2014-sprint-07-current, 2014-sprint-08-next Nov 7, 2014
@icewind1991
Copy link
Contributor

WebDAV should throw the correct exceptions already
FTP I dont think is doable with the current backend (based on the builtin stream wrapper)
SMB might be doable with the currently backend but probably a lot of work, the new SMB backend will make it easy.
SFT, Amazon, Swift, Google Drive and Dropbox should be doable as long as their libraries expose the correct exceptions

@PVince81
Copy link
Contributor Author

PVince81 commented Nov 7, 2014

Thanks for the info.
If needed we can split the task in separate tickets and do this progressively.

From what I saw with Dropbox, if I simulate a missing "api.dropbox.com" it will throw a "NotFound" exception which might or might not be the same as a file not found exception. This means potentially extra logic to properly detect such cases.

@PVince81
Copy link
Contributor Author

Ideally we should always show the mount points in the file tree, even if the config is invalid/temporarily available. This will make it possible to display a warning in the UI: #20427

@icewind1991 @Xenopathic I believe we might need to change the code that mounts the storages and make it still create the mount point even if the storage threw an exception ?

CC @jmaciasportela

@PVince81
Copy link
Contributor Author

@icewind1991 can you help with this ?
For now assume that the storages will throw StorageNotAvailable (ex: Webdav) and make it work for those.

@RobinMcCorkell
Copy link
Member

@PVince81 The mount point is always created, even when failed, so we just need a way to catch the exceptions coming back and create an appropriate file entry.

@PVince81
Copy link
Contributor Author

I added the "Local". Someone reported on IRC that they had a NFS or something mounted to a data folder, then mounted inside OC as a "Local" external storage.

Maybe to detect such unavailable cases, OC could write a file ".ocdata" there at init time. Then later if all files disappeared, check if ".ocdata" is still there. If yes: files were really deleted. If not: mount point is missing. This assumed that the NFS is mounted already when configuring it in OC. Tricky...

@RobinMcCorkell
Copy link
Member

@PVince81 That will only work for the situation where the mount gets unmounted for whatever reason, which is clearly a serious system issue (and so should be handled at the system level). Usually though, NFS will block read/writes if the server goes down, so ownCloud will just hang instead of continuing. Eventually an error will be reported back to ownCloud, which should trigger the unavailability logic.

@ghost ghost modified the milestones: 9.1-next, 9.0-current Feb 17, 2016
@PVince81
Copy link
Contributor Author

Ongoing => 9.2

@PVince81 PVince81 modified the milestones: 9.2-next, 9.1-current Jun 17, 2016
@PVince81 PVince81 removed the triage label Nov 16, 2016
@PVince81 PVince81 modified the milestones: backlog, 10.0 May 17, 2017
@ownclouders
Copy link
Contributor

Hey, this issue has been closed because the label status/STALE is set and there were no updates for 7 days. Feel free to reopen this issue if you deem it appropriate.

(This is an automated comment from GitMate.io.)

@ownclouders
Copy link
Contributor

Hey, this issue has been closed because the label status/STALE is set and there were no updates for 7 days. Feel free to reopen this issue if you deem it appropriate.

(This is an automated comment from GitMate.io.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants