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

Maintenance tool to deal with orphaned storages #23364

Closed
blizzz opened this issue Mar 17, 2016 · 8 comments
Closed

Maintenance tool to deal with orphaned storages #23364

blizzz opened this issue Mar 17, 2016 · 8 comments

Comments

@blizzz
Copy link
Contributor

blizzz commented Mar 17, 2016

Since 9.0 shares in orphaned storages throw Exceptions (cf. #22976 (comment)). ownCloud is still operable and no data is broken or lost or anything, but these Exceptions do occur and or logged.

Two reasons are known for orphaned storages:

  • an external storage path was changed in the configuration despite being already in use
  • a user was deleted, but no cleanup was done (ownCloud behaviour a long time ago)

Two possible solutions are suggested:

  1. Go through the existing storages and figure out which ones are orphaned. home:: storages by checking whether the user exists, local::storages by checking whether the mountpoint exists. If an orphaned storaged was found, all possible remainings in the database need to be purged (e.g. filecache, shares, preferences…). Problem: not all storages can be resolved to a user or path.
  2. When the mentioned Exception occurs, flag the related storage. A background job might do some verifications (e.g. validate that no existing user or mount can be found for this storage). An occ tool that cleans up all|specified storages and all connected relations (filecache, shares, etc.)

Opinions? Other approaches? @PVince81 @DeepDiver1975 @icewind1991 @nickvergessen @MorrisJobke

@blizzz blizzz added this to the 9.1-current milestone Mar 17, 2016
@PVince81
Copy link
Contributor

As discussed before, we can't go through all "home::" storages because some are md5-ied, so we can't resolve the user id. We need to start with all user ids to be able to find matching storages.
"oc_mounts" could be used potentally, but the trouble is that it's only initialized when setupFS is called.

@danimo
Copy link
Contributor

danimo commented Mar 17, 2016

@PVince81 If they are stored as md5, how can they ever be looked up successfully again?

@PVince81
Copy link
Contributor

Originally, back in older OCs when this was introduced, it was only used when the user id was already known. If you log in as "user1" then it would concatenate with "home::user1" and do the md5 only if it's longer than 64 chars. Can happen with long user ids like LDAP ids.

Same for shares, at that time the user ids are already known. So basically you could only resolve storages in a single direction.

Yeah, I hate this too...

@blizzz
Copy link
Contributor Author

blizzz commented Mar 17, 2016

What @danimo has in mind is that you can take the known user-ids and brute-force-hash them until it matches with a storage.

@MorrisJobke
Copy link
Contributor

@PVince81 If they are stored as md5, how can they ever be looked up successfully again?

https://github.com/owncloud/core/wiki/Storage-IDs

@PVince81 PVince81 modified the milestones: 9.1.1-next-maintenance, 9.1-current Jun 30, 2016
@PVince81 PVince81 modified the milestones: backlog, 9.1.1 Sep 21, 2016
@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.)

@PVince81
Copy link
Contributor

leaving closed in favor of #18922

@lock
Copy link

lock bot commented Jul 31, 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 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants