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

Detect external storage of type Local as unavailable when path is unmounted on system #39706

Closed
PVince81 opened this issue Aug 3, 2023 · 4 comments · Fixed by #39707
Closed
Assignees
Labels
1. to develop Accepted and waiting to be taken care of feature: external storage technical debt
Milestone

Comments

@PVince81
Copy link
Member

PVince81 commented Aug 3, 2023

Steps

  1. Create a local folder "/mnt/mountedstorage/nextcloud_external"
  2. Give the web server permissions for that folder
  3. Mount it as Local external storage under the local path "/nextcloud_external"
  4. In the web UI, create a folder "/nextcloud_external/sub"
  5. On the CLI, rename "nextcloud_external" to something else to simulate as if "/mnt/mountedstorage" was not mounted
  6. PROPFIND "/nextcloud_external"

Expected result

PROPFIND returns a 503 with StorageNotAvailable since the storage/path is temporarily not there.
A configured desktop client would not touch that folder locally, no deletion.

Actual result

PROPFIND returns a 404 on the path.
A configured desktop client would proceed to delete the local "/nextcloud_external" folder until mounted again. (assuming this, I haven't tested)
The next time the mount point is back, the desktop client would redownload everything.

Versions

Observed on master 9a7e2b1 and it was like that since forever 😅

Notes

My actual use case is that I have an "archive" hard disk connected to my Rpi4 but I don't want to have it powered up every time.
My expectation is that whenever I power it up the mount point becomes available again to access the archive, but I don't want desktop clients to delete and redownload files again from that place.

From what I remember desktop clients are already able to deal with unavailable storages and will skip these seamlessly (503 StorageNotAvailable). @tobiasKaminsky

Thoughts @icewind1991 @artonge @come-nc ?

I have a PR incoming...

@PVince81 PVince81 added bug 1. to develop Accepted and waiting to be taken care of labels Aug 3, 2023
@PVince81 PVince81 added this to the Nextcloud 28 milestone Aug 3, 2023
@PVince81 PVince81 self-assigned this Aug 3, 2023
@PVince81
Copy link
Member Author

PVince81 commented Aug 3, 2023

PR here: #39707

@PVince81
Copy link
Member Author

PVince81 commented Aug 3, 2023

Follow up in the PR as I discovered more things related to desktop client and the sabre exception ^

@kesselb
Copy link
Contributor

kesselb commented Aug 3, 2023

Thank you, good finding 👍

The comment nextcloud/desktop#260 (comment) sounds exactly like your case (disk gone, desktop deleted the files).

@szaimen szaimen added technical debt and removed bug labels Aug 9, 2023
@joshtrichards
Copy link
Member

This sounds similar to #37934. We return the 404 but then also sometimes change our mind and start doing the 503. I figured out at least one way to trigger the switch. My notes in case they prove helpful:

#37934 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. to develop Accepted and waiting to be taken care of feature: external storage technical debt
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants