Fix cannot unblock LDAP blocked users

by Daniel Pham
Published: Updated:
This entry is part 9 of 9 in the series Install Gitlab CE on Ubuntu 18

Fix cannot unblock LDAP blocked users. This is an error that you may encounter while operating the Gitlab system.

In the series, I have instructions for you to authenticate gitlab users via LDAP. It is entirely possible that users can be blocked. The reason is because the user enters the wrong password too many times or has some authentication problem causing continuous login failure.

Error cannot unblock LDAP blocked users

Maybe at some point, users will tell you that they cannot log in to the gitlab system.

When you go to the admin window to check, these users’ accounts have been blocked. But you cannot unlock it on the website.

Fix cannot unblock LDAP blocked users
Error cannot unblock ldap blocked users.

So now how to unblock these users?

Fix cannot unblock LDAP blocked users

To fix this error, you must do it from the console interface of the Gitlab system.

First, you log in to the console window.

gitlab-rails console

Next, you use the command structure below to unblock locked user accounts. For each account that needs to be unlocked, you will run these 3 commands. You repeat this set of 3 commands for all blocked users on the system.

user = User.find_by_email("[email protected]")
user.state = "active"
user.save

In there:

When done it will look like this.

root@gitlab:~# gitlab-rails console
--------------------------------------------------------------------------------
 GitLab:       13.2.2 (64fc0138d55) FOSS
 GitLab Shell: 13.3.0
 PostgreSQL:   11.7
--------------------------------------------------------------------------------
Loading production environment (Rails 6.0.3.1)
irb(main):001:0> user = User.find_by_email("[email protected]")
=> #<User id:35 @user01>
irb(main):002:0> user.state = "active"
=> "active"
irb(main):003:0> user.save
=> true
irb(main):004:0> user = User.find_by_email("[email protected]")
=> #<User id:33 @user02>
irb(main):005:0> user.state = "active"
=> "active"
irb(main):006:0> user.save
=> true
irb(main):007:0> exit

Conclusion

Above is the content that I have shown you how to unblock a user account when encountering an LDAP blocked error. Hope this article helps you in necessary situations.

0 0 votes
Article Rating
Series Navigation«« Previous part: Common errors when using SSH keys on Gitlab

You may also like

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments

DevOps Lite is a personal blog specializing in technology with main topics about DevOps, DevSecOps, SRE and System Administrator. Articles are shared for free and contributed to the community.

SUPPORT US

FOLLOW US

Subscribe my Newsletter for new blog posts. Stay updated from your inbox!

© 2021-2024 DevOpsLite.com – All rights reserved.

Please write sources “DevOpsLite.com” when using articles from this website.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More

2
0
Would love your thoughts, please comment.x
()
x

Adblock Detected

Please support us by disabling your AdBlocker extension from your browsers for our website.