PVWA: How to troubleshoot LDAP directory connection

PVWA: How to troubleshoot LDAP directory connection

73
Created On 11/10/26 10:58 AM - Last Modified 11/10/26 15:57 PM


Symptom


When attempting to create a new LDAP connection there is an error:
Failed to connect to the domain
Could not establish a connection to the selected domain controllers.



Environment


12.0;12.1;12.2;12.6;13.0;14.0;14.6 Privileged Access Manager (PAM, self-hosted) Password Vault Web Access
  • Password Vault Web Access
  • Ldap integration


Cause


There could be multiple possible factors, such as the following:

  • Invalid certificates
  • Error in bind username or password
  • DC hosts are down or not open to incoming connections
  • Network connectivity

Note that both the Vault server and PVWA server require LDAP connectivity.

  • The vault server will need the LDAP connection for the scheduled LDAP synchronizations, LDAP transparent user logons, and directory mapping.
  • PVWA server requires the LDAP connection during configuration processes, such as in LDAP mapping.


Resolution


First, ensure that the domain controllers are added to the hosts file in Vault and PVWA servers. The hosts file is typically located at 'C:\WINDOWS\System32\drivers\etc\hosts'

Afterward, in PVWA > Administrative Options > LDAP Integration > Directories > Hosts, when a new host is entered, the system will validate all hosts entries to ensure that every single one is valid, before saving all the hosts' connection information.  This behavior can be used to test the LDAP connection between the Vault server and the DC hosts from the PVWA interface. 
 

To test the LDAP connectivity in PVWA:
1. Go to PVWA > Administrative Options > LDAP Integration > Directories > Hosts.
2. Review all hosts information to confirm the validity of the data from your perspective.
3. Click Apply.  
4. The system will test each LDAP host connection.
If all LDAP host connections are successful, then the settings will save successfully with a message indicating this. Otherwise, there will be an error log in the lower pane to show which connection failed and the associated error message. 
The error codes will indicate the cause of the failed connection. Examples include the following:
Failed to connect to host, Reason: Failed to connect to LDAP host ... Code(21, 81) (21)  --> This indicates an error with the SSL certificate.  Please check the certificate in the Vault server for the LDAP connection.  You may need to use the LDAPSCertificateTool to export the AD DC certificate and import it into Vault.
Failed to connect to LDAP host.....with user .... Code(21, 49) (21) --> This indicates an error with the bind user name and password.  Either the password is wrong or the username is wrong.  Please check the user name and password.  You may need to reset the bind username or password.  


Note:

  • There must be at least one successful LDAP connection for the LDAP integration to work.
  • If you have multiple hosts, where some connections work and some do not- in order to save the LDAP connection information, you must delete the non-working hosts. If one of the previously submitted LDAP connections fails, then the system will not save the new LDAP connection information. You must delete the failing LDAP connection first, before entering a new LDAP connection and saving.


To troubleshoot the LDAP connection in the Vault server, temporarily create a firewall rule to open the outgoing ports 389 and 636 in the Windows firewall.  In the Vault Server, open a PowerShell prompt and enter:

tnc <DC-hostname> -port 389

*This assumes that port 389 is used for non-SSL LDAP. This will test the connection from Vault to the DC host over port 389.  What is the output?  If it is successful, then TCP connection test will be Yes.

tnc <DC-hostname> -port 636

*This assumes that port 636 is used for secure LDAPS. This will test the connection from Vault to the DC host over port 389.  What is the output?  If it is successful, then TCP connection test will be Yes.

Assuming that the network connection over ports 389 and/or 636 is successful, then the next step is to troubleshoot the Vault LDAP connection. 

In the Vault Server, go to Administration > Debug Level > Set Dynamically. At the end of the line, enter LDAP(14,15).  This increases the debug level so that more information is provided for the LDAP connection in the trace file.  

Reproduce the issue with the new LDAP connection failing.  The trace.d* log will now contain detailed information related to the LDAP connection attempt.

Find the most recent trace.d* log file.  In the file, search for the LDAP connection attempt - There should be an associated error message with error codes that detail what caused the failed connection. These LDAP error codes are standard and documented online in many places such as:
https://ldapwiki.com/wiki/LDAP%20Result%20Codes

Note:
If you would like Idira Support to review the logs - To collect the vault logs, in an administrative command prompt, enter the following command:
CAVaultManager CollectLogs

Then, attach the output archive file to the case along with LDAPConf.XML file(located in VaultInternal Safe).

In case further details are needed on logs collection from the vault, please review the below article:
https://community.cyberark.com/s/article/How-to-easily-collect-logs-configuration-files-from-the-Vault



Actions
  • Print
  • Copy Link

    https://knowledgebase.paloaltonetworks.com/KCSArticleDetail?id=kA1hj000000149jCAA&lang=en_US&refURL=http%3A%2F%2Fknowledgebase.paloaltonetworks.com%2FKCSArticleDetail