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

better cleanup of user files on user deletion #26792

Merged
merged 1 commit into from
Jun 2, 2021

Conversation

icewind1991
Copy link
Member

@icewind1991 icewind1991 commented Apr 27, 2021

Fix #9690

Handle cleanup of user data in the storage, not only the local fs.

Fixes user files not being deleted when using s3 primary storage.

to test:

  • setup instance with s3
  • create userA
  • as userA upload some files
  • delete userA
  • create a new userA
  • login as userA

On current master the files previously uploaded will be shown again, surviving the user delete.

@icewind1991 icewind1991 added the 3. to review Waiting for reviews label Apr 27, 2021
@icewind1991 icewind1991 added this to the Nextcloud 22 milestone Apr 27, 2021
@icewind1991 icewind1991 force-pushed the user-delete-cleanup-files branch 2 times, most recently from 90951b5 to a0359a1 Compare April 27, 2021 14:33
Copy link
Member

@blizzz blizzz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good – much better than before. did not test.

@kesselb
Copy link
Contributor

kesselb commented Apr 27, 2021

fyi @pierreozoux @acsfer

Signed-off-by: Robin Appelman <robin@icewind.nl>
@icewind1991 icewind1991 force-pushed the user-delete-cleanup-files branch from a0359a1 to ed2d02d Compare April 27, 2021 18:30
@solracsf
Copy link
Member

solracsf commented Apr 28, 2021

The problem i was having was not on user deletion, but on files deletion.
Use case at #20333 (comment)

Similar issues #26014 #24957

Does this PR helps in these cases?

This was referenced May 20, 2021
@blizzz blizzz mentioned this pull request Jun 2, 2021
57 tasks
@skjnldsv skjnldsv added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Jun 2, 2021
@skjnldsv skjnldsv merged commit d0cf20c into master Jun 2, 2021
@skjnldsv skjnldsv deleted the user-delete-cleanup-files branch June 2, 2021 15:02
@MorrisJobke MorrisJobke mentioned this pull request Jun 10, 2021
59 tasks
@blizzz
Copy link
Member

blizzz commented Jul 13, 2021

Should not this get backported, @icewind1991?

@pierreozoux
Copy link
Member

It would be nice if it is backported :) But I also understand if it is not :)

Thanks for fixing it, it is nice for the environment and user's privacy!

@blizzz
Copy link
Member

blizzz commented Aug 12, 2021

/backport to stable21

@metheos
Copy link

metheos commented Sep 10, 2021

My local storage is no longer getting cleaned up since this was merged ☹
I manually put the removed lines from /lib/private/User/User.php back into my instance since I had a bunch of users to delete yesterday and didn't want to manually clear the storage and _storages and _filecache tables for all of them.

Nextcloud 22.1.1
Ubuntu 20.04.2
Apache 2.4.41
PHP 7.4.3

@blizzz
Copy link
Member

blizzz commented Sep 10, 2021

@metheos please open a new issue with the requested details (especially log from the delete action)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4. to release Ready to be released and/or waiting for tests to finish
Projects
None yet
Development

Successfully merging this pull request may close these issues.

occ user:delete does not remove storage and files where using Swift as primary store
7 participants