misskey icon indicating copy to clipboard operation
misskey copied to clipboard

As administrator I can't delete a local profile

Open tassoman opened this issue 1 year ago โ€ข 10 comments

๐Ÿ’ก Summary

By using the user's moderation panel, doing profile deletion, does nothing.

๐Ÿฅฐ Expected Behavior

I expected to delete everything from the local user

๐Ÿคฌ Actual Behavior

I can see visual โœ… but the deleted profile stills there.

๐Ÿ“ Steps to Reproduce

  1. open profile
  2. open moderation panel
  3. click: delete button
  4. confirm deletion
  5. see: OK check
  6. see: profile stills there
  7. open anonymous window, see profile is still there

๐Ÿ’ป Frontend Environment

* Model and OS of the device(s): android and windows
* Browser: firefox 124
* Server URL: https://misskey.social/@mcw77shop 
* Misskey: 2024.3.1

๐Ÿ›ฐ Backend Environment (for server admin)

* Installation Method or Hosting Service: docker 
* Misskey: 2024.3.1

Do you want to address this bug yourself?

  • [ ] Yes, I will patch the bug myself and send a pull request

tassoman avatar Apr 11 '24 21:04 tassoman

Any hint on how provide more logs of this? ๐Ÿค”

tassoman avatar Apr 12 '24 17:04 tassoman

I tried creating a local account, confirming the email address. Then as administrator, I pushed delete button, then refreshed the moderation panel, it disappeared. The profile's email address got deletion email. But some accounts are likely "bugged" can't be removed. I also tried with a very old profile, also deleted as expected.

How do I can debug messy profiles? I can still read RAW data.

tassoman avatar Apr 14 '24 09:04 tassoman

ใ“ใฎไปถใจๅŒใ˜ๅŽŸๅ› ใซใ‚ˆใ‚‹ใ‚‚ใฎใ‹ใฏใ‚ใ‹ใ‚Šใพใ›ใ‚“ใŒใ€ใฎใˆใ™ใใƒผ https://misskey.noellabo.jp ใงใ‚‚ใƒฆใƒผใ‚ถใƒผๆœฌไบบใŠใ‚ˆใณ็ฎก็†่€…ใซใ‚ˆใ‚‹ๅ‰Š้™คใŒใงใใชใ„ใ‚ขใ‚ซใ‚ฆใƒณใƒˆใŒ็™บ็”Ÿใ—ใฆใ„ใพใ™ใ€‚

noellabo avatar Apr 22 '24 00:04 noellabo

also in 2024.5.0

tassoman avatar Jul 20 '24 05:07 tassoman

Still active in 2024.10.0. (not) Deleted profile's drive files are still there. Can be seen in control-panel drive admin.

How do I can send more debug info?

tassoman avatar Oct 10 '24 05:10 tassoman

I suspect that the account could be not deleted due to the file deletion query timed out, as reported in #9975.

Once you perform account deletion, the target user's isDeleted is set to true, so simply retrying deletion doesn't make sense. Would you mind setting isDeleted to false for the target user directly from the database, and try again?

zyoshoka avatar Oct 10 '24 07:10 zyoshoka

Hello @zyoshoka and thanks for your reply. I'm running dockerized environment and running sql queries is pretty difficult. Maybe can be done by APIs call?

tassoman avatar Oct 12 '24 17:10 tassoman

Unfortunately, this is impossible with API calls for now. If you followed the installation guide when setup, I think it is possible for you to issue the SQL query directly according to the following steps instead:

  1. Set the working directory to the misskey repository root.
  2. Attach to the db container by running a following command. You need to pass POSTGRES_USER written in your .config/docker.env to -u option.
docker compose -u postgres exec db bash
  1. Then you can perform the query. Replace misskey with the database name described in your .config/default.yml, and 9000000000000000 with the target user's id.
psql misskey -c 'UPDATE "user" SET "isDeleted" = FALSE WHERE "id" = '"'9000000000000000'"';'

zyoshoka avatar Oct 13 '24 09:10 zyoshoka

Thanks for hinting. I made it like this:

# docker compose exec -u postgres db bash this executed the db container. 4b7f5b:/$ psql misskey -U <DBUSER> -c 'UPDATE "user" SET "isDeleted" = FALSE WHERE "id" = '"'<userId>'"';'

Deletion went ok (again) and now I can't see related attachments inside Drive control panel. I gave a translated read at #9975 so I guess the meaning was the same bug.

In my opinion, when User deletion is asked by administrator, or user himself, should start a job. First of all, in user moderation panel, put a warning "asked for deletion", with a percentage bar of remaining jobs to do. Then:

  1. collect all the notes
  2. collect related items
  3. batch delete everything collected
  4. in the end, set the profile as deleted.

Every step should be a small batch to avoid server collapse.

tassoman avatar Oct 13 '24 16:10 tassoman