All HowTo's PostgreSQL

Confluence – Recover from User Directory Trouble

If you’re in a situation where you can’t log into Confluence because you messed up your User Directories, try these two steps. First, attempt to log in locally. If that doesn’t work, diddle with the database and reset the state of your User Directories.

In this article, we’re assuming the following:

  1. You’re using Confluence with PostgreSQL.
  2. You’re using LDAP/AD User Directories.

 

Option 1. Try to log in locally. Browse to the following URL and see if you can use your local administrative credentials. Replace “confluence.example.com” with your FQDN.

https://confluence.example.com/login.action?nosso

Once logged in, attempt to correct the error in your User Directories.

Option 2. Try to set your User Directories to “Enabled” (they call it “true” and “false”) by making changes directly within PostgreSQL. For this one, consider making a backup of your database first. Having said that, you should have made a backup some time ago because you were planning to mess around with User Directories which can and does lock us out.

TIP: Replace “confluencedb” with your database name. If you don’t know it, use the “\l” command when you’re logged into PostgreSQL. It will list your databases. Then you connect with the “\c” command as you can see in the example below.

su - postgres
psql
\c confluencedb;
SELECT * FROM cwd_directory ;

You can see the list of User Directories from the above command. Notice the “active” column. On postgresql, the field can be either “T” for true, or “F” for false. Setting them to “T” will activate them.

UPDATE cwd_directory SET active = 'T';

Now you need to restart Confluence.

systemctl restart confluence

Wait the mandatory 5 minutes for Confluence to work its self out. You should then be able to log in.

Leave a Reply

Your email address will not be published. Required fields are marked *