Can not login with admin or normal users
Asked by Jonny Lund:

Running Confluence 6.14.0, in a virtuel ubuntu server on QNAP NAS.  
Database is postsgresql. Running locally in the same the virtuel ubuntu server  
This has worked flawless for years.

I bought a new NAS.  
I restored the virtuel server on the new NAS.  
Postgresql and confluence starts fine, and I get presented with the login page.  

When trying to login, I just get redirected to the login page again, no error presented.  
This only happens when I enter valid user/password.  

If I try to login using valid user and wrong password, I get the error message "Sorry, your username and/or password are incorrect. Please try again."  

This is true for admin and nomal users.  
Also tried the setting up the recovery_admin user with no success.  
<https://confluence.atlassian.com/doc/restore-passwords-to-recover-admin-user-rights-158390.html>

```


/var/atlassian/application-data/confluence/logs/atlassian-confluence.log
2019-10-27 12:43:32,694 WARN [http-nio-8090-exec-1] [atlassian.seraph.auth.DefaultAuthenticator] login login : 'jonny' tried to login but they do not have USE permission or weren't found. Deleting remember me cookie.
-- referer: http://172.16.16.215:8090/confluence/login.action?os_destination=%2Findex.action&permissionViolation=true | url: /confluence/dologin.action | traceId: b456af04e41eb56e
2019-10-27 12:43:33,825 WARN [http-nio-8090-exec-4] [common.security.jersey.XsrfResourceFilter] passesAdditionalBrowserChecks Additional XSRF checks failed for request: https://valhal.io/confluence/rest/analytics/1.0/publish/bulk , origin: http://172.16.16.215:8090 , referrer: http://172.16.16.215:8090/confluence/dologin.action , credentials in request: true , allowed via CORS: false
-- referer: http://172.16.16.215:8090/confluence/dologin.action | url: /confluence/rest/analytics/1.0/publish/bulk | traceId: 8f5d128f000bc644 | userName: anonymous
(END)
```

<br />

Sound like something like this, but as I am not able to login to web console.  
I only have the shell and postgresql as tools.  

<https://confluence.atlassian.com/jirakb/user-unable-to-login-with-you-do-not-have-permission-error-596770904.html>  

<br />

<br />


Answers:
author: Pavel Junek
body: Hi [@Jonny Lund](/t5/user/viewprofilepage/user-id/1675519),

What User Directories do you have, and in what order (Confluence Internal Directory, LDAP, Crowd...)?

Looks like the user 'jonny' does not exist in the first User Directory or has no *confluence-users* permission.

What problem you have when trying setting up Confluence the recovery_admin user? You haven't run Confluence as a service, but you must run the application using /bin/start-confluence.sh script in Confluence Install folder.

Pavel

comments: author: Jonny Lund
body: Hi [@Pavel Junek](/t5/user/viewprofilepage/user-id/1157350)   
Thanks for helping out :)  

I'm using the internal Directory.  
Is there a way to reset, or to check the user using postgresql or the shell?  

Regarding recovery admin, I stopped the confluence service.  
Edited /opt/atlassian/confluence/bin/setenv.sh  
Added the line last in the script, before the export.  

CATALINA_OPTS="-Datlassian.recovery.password=secretpass ${CATALINA_OPTS}"  
export CATALINA_OPTS  

Started confluence using /opt/atlassian/confluence/bin/start-confluence.sh  

The result is the same, as the other users I tried; when I try to login as recovery_admin and secretpass, I get redirected to the frontpage again, no errors or notifications.  
When I try with any other password that secretpass for recovery_admin I getthe error  
"The following error(s) occurred:

* Sorry, your username and/or password are incorrect. Please try again."

<br />

<br />

/var/atlassian/application-data/confluence/logs/atlassian-confluence.log shows

```


2019-10-27 22:44:32,202 WARN [http-nio-8090-exec-9] [atlassian.seraph.auth.DefaultAuthenticator] login login : 'recovery_admin' tried to login but they do not have USE permission or weren't found. Deleting remember me cookie.
-- referer: http://172.16.16.215:8090/confluence/login.action?os_destination=%2Findex.action&permissionViolation=true | url: /confluence/dologin.action | traceId: ce321bc26f257981
```

Cheers  
Jonny


author: Pavel Junek
body: Hi Jonny,

thank you for your informations.

It is strange that the *recovery_admin* approaches don't work - according to your description, that's right. I tried it on my instance and it worked. Do you have a web server before Confluence that could cause redirects? Or do you use Crowd?

<br />

Internal directory should be fine. Please check if Confluence is connected to the correct DB (*connection.url* in confluence-home/confluence.cfg.xml).

You can use this older [Confluence tutorial](https://confluence.atlassian.com/conf64/restore-passwords-to-recover-admin-user-rights-936511358.html) to check your DB administrator account.

Best Regards

Pavel


author: Jonny Lund
body: Thanks mate!  

I used to have an nginx reverse proxy running in front of the confluence server.  
That server has crashed, so I'm accessing confluence directly on the confluence server.  

I just doubled checked, that I had remarked the "SSL over nginx" connector and enabled the "Direct" connector.  
They were not!  

I could have sworn, that I did that.  
Fixed in /opt/atlassian/confluence/conf/server.xml, plus restart of Confluence.  
I can now login :)  

Thanks a bunch for your input and questions!  

Cheers  
Jonny


author: Pavel Junek
body: Hi Jonny!

I'm glad I could help you!

<br />

All the best!  
Pavel