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

Disable ext storage provider app must keep mount point #26538

Closed
PVince81 opened this issue Nov 3, 2016 · 8 comments · Fixed by #26539
Closed

Disable ext storage provider app must keep mount point #26538

PVince81 opened this issue Nov 3, 2016 · 8 comments · Fixed by #26539
Assignees
Labels
app:files_external p2-high Escalation, on top of current planning, release blocker sev3-medium status/STALE Type:Bug

Comments

@PVince81
Copy link
Contributor

PVince81 commented Nov 3, 2016

Steps

  1. Setup WND from EE (or any other app that provides a custom external storage backend/storage)
  2. Setup a mount point "/mount" with WND (or the other storage)
  3. Access the mount point "/mount" and see that files appear
  4. Disable the WND app (or other app)
  5. Access the mount point again

Expected result

Mount point exists but returns "storage not available" when accessing or syncing.

Actual result

Mount point disappears completely. This would cause sync clients to delete the local files for every user in the event that an app got disabled by mistake. This can happen also at update time where third party apps get disabled.

To avoid this kind of needless data loss through syncing, the mount point must stay visible but any access to it must throw StorageNotAvailableException.

Versions

Tested on 9.2 prealpha / git master.

Since we want to move many storage backends from files_external to separate apps, the probability that one of the separate app is not enabled on time gets higher and people might see their mount points disappear. Fixing this issue would help ease the migration in case the admin has not enabled the separate apps yet.

medium because there is a workaround: set OC to maintenance mode after an update and make sure to enable the missing storage apps before exiting maintenance mode.

@owncloud/qa @DeepDiver1975 @butonic

@PVince81
Copy link
Contributor Author

PVince81 commented Nov 3, 2016

@owncloud/filesystem

@PVince81
Copy link
Contributor Author

PVince81 commented Nov 3, 2016

Looks like the storage config even disappears from the UI, not good.

This is tricky, because the code expects a StorageConfig to be created in StoragesService::getStorageConfigFromDBMount() but if one of Backend or AuthMechanism cannot be instantiated, it discards the config.

Some ideas:

  • return the StorageConfig but with null as backend and auth mechanism
  • return the StorageConfig with a dummy FailedBackend and FailedAuthMechanism instances
  • in any of these cases, display the config in the external storage admin page but make it read-only and deletable only.

@jvillafanez
Copy link
Member

To give a second thought, if I disable and remove the app on purpose, the files that are in the desktop client will stay even though they shouldn't be available (probably) and it's possible to keep trying to upload files there. There will be leftovers everywhere (files in the desktop client, unused data in the filecache, unused data in mobiles...)

If we're talking about upgrades, the server should return a proper error if anyone tries to access the file, something like "ownCloudUpgradingException", so clients know the server is being upgraded and can respond accordingly.

There is the additional topic of what to do if the app is incompatible with the new version...

The problem of using the "StorageNotAvailableException" is that the clients won't know what is the real reason of the error: is there a temporal network failure between ownCloud and the backend? did the connector disappear? is ownCloud being updated?

If there is a temporal network failure, clients can try another folder, but if ownCloud is being updated is pointless to keep syncing.

@butonic
Copy link
Member

butonic commented Dec 6, 2016

Maybe using the Retry-After header makes sense. Hm we could use it to tell the clients how often to do a PROPFIND. Even dynamically based on server load. And I agree that something like a 'MaintenanceException' in a 503 Service Unavailable with the Retry After header makes sense.

@PVince81
Copy link
Contributor Author

PVince81 commented Dec 6, 2016

To give a second thought, if I disable and remove the app on purpose, the files that are in the desktop client will stay even though they shouldn't be available (probably) and it's possible to keep trying to upload files there. There will be leftovers everywhere (files in the desktop client, unused data in the filecache, unused data in mobiles...)

If that's what the admin decided, then the admin can also manually delete the matching storages from the config.

If we're talking about upgrades, the server should return a proper error if anyone tries to access the file, something like "ownCloudUpgradingException", so clients know the server is being upgraded and can respond accordingly.

Not directly. This is mostly for the case where for example the FTP app was available in OC < 9.2 with respective storages but then when upgrading to 9.2 it has been moved to the market, so the admin might need to manually reinstall it. (unless we can do this automatically, somehow)

The problem of using the "StorageNotAvailableException" is that the clients won't know what is the real reason of the error: is there a temporal network failure between ownCloud and the backend? did the connector disappear? is ownCloud being updated?

Yeah, I guess in general (and separately) we could add more subclasses of StorageNotAvailableException which specify what kind of error it is with a proper exception message. And then depending on it also incorporate @butonic's Retry-After idea. But this is out of the scope of this ticket as it's not the problem I'm trying to solve.

@PVince81 PVince81 self-assigned this Dec 8, 2016
@PVince81 PVince81 modified the milestones: 10.0.1, 10.0 Apr 26, 2017
@PVince81 PVince81 removed their assignment May 2, 2017
@PVince81 PVince81 modified the milestones: 10.0.2, 10.0.1 May 2, 2017
@PVince81 PVince81 modified the milestones: 10.0.2, 10.0.3 May 26, 2017
@PVince81 PVince81 self-assigned this May 31, 2017
@PVince81 PVince81 added the p2-high Escalation, on top of current planning, release blocker label Jul 3, 2017
@PVince81
Copy link
Contributor Author

Estimate: 0.5-2 md as I need some time to dive into this again. Shortest estimate is if we keep the current approach and if it still works after rebase.

@PVince81
Copy link
Contributor Author

PVince81 commented Aug 3, 2017

moving to triage to reconsider later...

@PVince81 PVince81 modified the milestones: triage, development Aug 3, 2017
@felixboehm felixboehm removed this from the triage milestone Apr 10, 2018
@lock
Copy link

lock bot commented Jul 30, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jul 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
app:files_external p2-high Escalation, on top of current planning, release blocker sev3-medium status/STALE Type:Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants