LDAP Login fails after cloning Confluence
Asked by COK-Orlund:

We have a production environment with Jira and Confluence where both applications allow users to login using our LDAP.

We created another environment (Dev) and followed Atlassian's instructions on refreshing (cloning) the environments. Basically copying the home and install directories, data refresh and a few config changes to connect to the right database.

Jira allows logins with the LDAP however Confluence only lets me login with the local admin account. The LDAP logins give an error message "Sorry, an error occurred trying to log you in. Please try again."

Does anyone have any suggestions?


Answers:
author: COK-Orlund
body: there was multiple rows but support had us delete them. Right now there is only one entry

Looking at more at the logs this seems to be the error that we are resiving

<br />

2019-04-24 10:23:11,553 WARN \[https-jsse-nio-8443-exec-20\] \[confluence.impl.hibernate.ConfluenceHibernateTransactionManager\] doRollback Performing rollback. Transactions:  
-\>\[com.atlassian.confluence.user.crowd.ConfluenceCrowdDirectoryService.testConnection\]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT,readOnly (Session #2094568206)  
-- referer: [https://confdev.ourdomain.com:8443/plugins/servlet/embedded-crowd/configure/jira/?xsrfTokenName=atl_token\&xsrfTokenValue=70f111193adc32aaa50808d36ae6d323b1114a4a](https://confdev.ourdomain.com:8443/plugins/servlet/embedded-crowd/configure/jira/?xsrfTokenName=atl_token&xsrfTokenValue=70fc3fd93adc32aaa50808d36ae6d323bd774a4a) \| url: /plugins/servlet/embedded-crowd/configure/jira/ \| traceId: 8a7be0cfd384e5c4 \| userName: adminjirauser  
2019-04-24 10:23:11,555 ERROR \[https-jsse-nio-8443-exec-20\] \[crowd.embedded.admin.ConfigurationController\] handleSubmit Configuration test failed for user directory: \[ jiradev.ourdomain.com JIRA\], type: \[ CROWD \]  
-- referer: [https://confdev.ourdomain.com:8443/plugins/servlet/embedded-crowd/configure/jira/?xsrfTokenName=atl_token\&xsrfTokenValue=70f111193adc32aaa50808d36ae6d323b1114a4a](https://confdev.ourdomain.com:8443/plugins/servlet/embedded-crowd/configure/jira/?xsrfTokenName=atl_token&xsrfTokenValue=70fc3fd93adc32aaa50808d36ae6d323bd774a4a) \| url: /plugins/servlet/embedded-crowd/configure/jira/ \| traceId: 8a7be0cfd384e5c4 \| userName: adminjirauser  
com.atlassian.crowd.exception.runtime.OperationFailedException: com.atlassian.crowd.exception.ApplicationPermissionException: Forbidden (403) Encountered a "403 - Forbidden" error while loading this page. client.forbidden.exception Go to Jira home

comments: author: Monique Khairuliana[ServiceRocket]
body: [@COK-Orlund](/t5/user/viewprofilepage/user-id/3048803)

From the error message it looks like Confluence just cant access jira. Check out this KB:

* [Unable to create JIRA User Directory in Confluence due to ApplicationPermissionException - Forbidden (403)](https://confluence.atlassian.com/confkb/unable-to-create-jira-user-directory-in-confluence-due-to-applicationpermissionexception-forbidden-403-320602732.html)

All the best,

Monique


author: COK-Orlund
body: Looking at the logs we see lots of this error:

2019-04-18 13:13:27,648 WARN \[Caesium-1-1\] \[impl.schedule.caesium.JobRunnerWrapper\] runJob Scheduled job ClusterSafetyJob#ClusterSafetyJob completed unsuccessfully with response JobRunnerResponse\[runOutcome=FAILED,message='RuntimeException: More than one cluster safety number in database.'\]

From what I see on that error it is related to confluence preventing more than one instance pointing to the same database. However, we changed the database connection in the confluence.cfg.xml  

Also, under user directories we setup the directory called "Remote Jira Directory" of type "Atlassian Crowd", which works before the refresh but not after. After the refresh we get the following error:

Connection test failed. Response from the server:  
com.atlassian.crowd.exception.ApplicationPermissionException: Forbidden (403) Encountered a "403 - Forbidden" error while loading this page. client.forbidden.exception Go to Jira home

comments: author: Kurt Klinner
body: [@COK-Orlund](/t5/user/viewprofilepage/user-id/3048803)

<https://jira.atlassian.com/browse/CONFSERVER-17434>

can you check if you have multiple rows in the CLUSTERSAFETY table

Cheers

Kurt


author: Kurt Klinner
body: [@COK-Orlund](/t5/user/viewprofilepage/user-id/3048803)

Hi Orlund

do you have access to the confluence log files to check for a more detailed message

while you are trying to log in?

Cheers

Kurt

comments: author: COK-Orlund
body: Where do I find the logs (sorry new to this)?

with a bit more testing we found that we are getting an error when creating a user directory "Atlassian JIRA", we created the application line on the jira side, made sure it was white listed (and even turned off white listing), made sure user names and passwords are correct, there is no firewall or proxy between the servers but we get the message below. We are also running SSL.

![issue.JPG](https://community.atlassian.com/t5/image/serverpage/image-id/51891iC1D0AF1D7E031673/image-size/large?v=v2&px=999 "issue.JPG")


author: Kurt Klinner
body: [@COK-Orlund](/t5/user/viewprofilepage/user-id/3048803)

Look for the atlassian-confluence.log file below \<confluence_home_directory\>/logs.

<https://confluence.atlassian.com/doc/working-with-confluence-logs-108364721.html>

might also be worth having a look to

Cheers

Kurt


Tags: clone

ldap

login