Can't delete accounts

AI-generated summary

In a discussion titled ‘Can’t delete accounts’ under the Bug category, JanJoost reports being unable to delete user accounts despite the users having zero visible posts. The issue appears tied to private messages, which cannot be deleted by users — only archived — and aren’t reflected in the ‘Posts Created’ count, though they block account deletion. sam and tobiaseigen suggest checking admin tools for message deletion. neil clarifies that in current Discourse versions, private message posts should appear in the post count and be deletable via admin tools. JanJoost confirms the user has private topics and that the ‘Delete User’ button fails, even though the post count shows zero. He later discovers archived private messages still exist in downloaded data. neil advises testing deletion of individual private messages as admin — which JanJoost confirms works, though it’s tedious for active users. Eventually, JanJoost reports the issue resolved after upgrading to Discourse v2.2.0.beta4 and migrating to an SSD-based VM, eliminating deadlocks and lingering posts. He offers to run further tests if needed.

Hi everyone,

I can’t seem to delete accounts. Every time I try to delete an account I get a message saying that accounts can only be deleted when there are no posts linked with the account anymore:

(Message is in Dutch)

However, ther user doesn’t have any posts to their name any more:

(‘Gemaakte berichten’ is Dutch for ‘posts created’)
IMG_0217

The log doesn’t show any errors, but I still can’t delete the user. So for now we’ve anonymised all users who want their account deleted, but it would be nice if we could indeed delete the accounts completely.

Could this have to do with the fact that the users have private messages in their mailboxes? I can’t seem to delete those, just archive them.

Thanks in advance!

Maybe PMs, look in the user messages?

2 Likes

Hi @sam,

The users indeed do have private messages in their mailboxes. But I can’t seem to delete those - just archive them. Am I missing something obvious? :slight_smile:

Thanks!

Do you see an admin wrench? That is where you delete messages and posts as admin. Otherwise they cannot be deleted.

1 Like

Which version of Discourse are you on? On the current version, posts in private messages will show in the total post count in admin, and can be deleted either by using the “Delete all posts” button or the “Delete User” button.

7 Likes

I’ve got admin-view of the profile in front of me. Under activity it says there are 0 posts created but there are private topics created due to the fact that this user sent and received internal messages. Clicking on the orange ‘remove user’ button generates an error.

I’m sure this is related to the fact that the user still has a number of private messages in their sent/received mailbox.

When I ‘login as user’ I can’t delete those messages, as there is no option to do so. I can however click ‘archive’, but all that does is move the messages to the ‘archive’ mailbox.

When I login as the user and go to account, there’s a button ‘Delete my account’. When I click that, I get a pop-up after some waiting, that says ‘please contact a staff member if you wish your account to be deleted.’

I’m running version v.2.1.0.beta6 +46. The smiley says I’m up to date.

If you have any more suggestions, then please! :slight_smile:

Hmm, interesting. I’ve anonymised the user, and when I now click on ‘download all my data’, I get a CSV which indeed contains a lot of posts. But the post count on the anonymised stats page says the user has written 0 posts.

Did you try deleting a post in the private messages as your admin user? Don’t login as the user.

Is the delete option there? Does it work for these “0 posts created” users?

I can easily verify that posts in private messages are being counted in the admin UI in the “Posts Created” value.

Hi @neil, I’ve not gone in to check if I can delete one message. However, I was hoping I wouldn’t have to delete all messages individually as we have a few users who have been very active… :wink:

The ‘Posts Created’ count for the user is 0, checked in the admin UI. See also the second image in my opening post. (‘Gemaakte berichten’ is the Dutch translation of ‘Posts Created’).

Ok can you try it on only one such post? Trying to figure out what’s so special about these posts. Being in a private message isn’t special. We need more info.

1 Like

Ok, that seems to work - I can indeed delete individual messages.

That is, they’re turning red.

@neil I don’t mind running a script on the database that deletes the messages if needed - but I’m not sure how wise an idea that is.

Did you ever resolve this @JanJoost?

Ah, sorry for not updating!

Yes, but to be honest I can’t really say what it actually was that fixed it.

First of all I did upgrade the forum to the latest version at the time (2.2.0.beta4) and I built up a new VM on a machine with faster disks (SSD-based). The combination of the two has fixed it for me, no more deadlocks and no more lingering posts etc. It seems to work fine now.

If you wish I can run some tests if that’s any helpful.

3 Likes