Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to delete ghost user on Gitlab?

I just remove one user and it appears a ghost user, is it possible to remove ghost user?

I read that a ghost user represents all deleted users. Issues and comments created by any deleted user will be transferred to the ghost user.

But is it not possible to remove it?

like image 872
Asier Gomez Avatar asked May 29 '26 16:05

Asier Gomez


1 Answers

I've had a similar problem when playing with gitlab+ldap installation and removing test users, so here is how I removed the Ghost User eventually.

First check whether everything is ok with GitLab (optional step):

sudo gitlab-rake gitlab:check

Execute GitLab console:

sudo gitlab-rails console

Using the console find the the id of the ghost user and delete it:

user = User.find_by(username: "ghost")
User.delete(user.id)

If the user is removed then output would be 1, if 0 then user is not removed.

like image 150
Vitalii Avatar answered May 31 '26 11:05

Vitalii



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!