PVWA - When EnableDistributedConnect is set to YES, select an account, click connect, the error "Failed to connect" appears

PVWA - When EnableDistributedConnect is set to YES, select an account, click connect, the error "Failed to connect" appears

103
Created On 11/10/26 10:54 AM - Last Modified 11/10/26 15:51 PM


Symptom


When users log in via PVWA, select an account, and click connect, the error "Failed to connect" appears. Connection via PSM directly works. When setting EnableDistributedConnect setting via PVWA to No, connection via PVWA works.

---------------------------------------------------------------------------------------------------------------------------------------------------
Error Logs:
In PVWA, the CyberArk.WebApplication.log shows something similar to this:
[21/02/2022 | 11:19:21.750955] | {pid= 4580} | {tid= 2160} | :: | Failed publishing to queue. key:b17b3751-982c-4d15-a0c8-************. routingKey:site:all.sub:pvwa.instance:all.context:stm [21/02/2022 | 11:19:21.754147] | {pid= 4580} | {tid= 2160} | :: | Failed publishing value for key:b17b3751-982c-4d15-a0c8-************ in cache:PSMConnectionTokenCache. Reason:"Failed to publish to queue for key:b17b3751-982c-4d15-a0c8-626c966796f6. routingKey:site:all.sub:pvwa.instance:all.context:stm" [21/02/2022 | 11:19:21.754649] | {pid= 4580} | {tid= 2160} | :: | EPVWA096E Failed to store the session data for the PSM connection in the Vault. Reason: "Failed to set value in the cache for key:b17b3751-982c-4d15-a0c8-626c966796f6" [21/02/2022 | 11:19:21.756044] | {pid= 4580} | {tid= 2160} | :: | PASWS001I Starting method GeneralExceptionAttribute::OnException [21/02/2022 | 11:19:21.756892] | {pid= 4580} | {tid= 2160} | :: | PASWS001E Error occurred: The session could not be established. For further assistance, contact your system administrator. [21/02/2022 | 11:19:21.760534] | {pid= 4580} | {tid= 2160} | :: | PASWS002I Ending method GeneralExceptionAttribute::OnException [21/02/2022 | 11:19:31.762358] | {pid= 4580} | {tid= 2916} | :: | EasyNetQ: Failed to connect to broker 10.2.224.120, port 5671, vhost / Additional information: None of the specified endpoints were reachable [21/02/2022 | 11:19:31.818349] | {pid= 4580} | {tid= 2916} | :: | EasyNetQ: Failed to connect to broker 10.2.224.120, port 5671, vhost / Additional information: None of the specified endpoints were reachable [21/02/2022 | 11:19:31.818529] | {pid= 4580} | {tid= 2916} | :: | EasyNetQ: Failed to connect to any Broker. Retrying in 00:00:30
-----------------------------------------------------------------------------------------------------------------------------------------------------

In the Vault, the C:\ProgramData\RabbitMQ\log\rabbitmq.log shows something like:
2022-02-21 11:20:31.792 [info] <0.2387.0> accepting AMQP connection <0.2387.0> (10.2.224.134:50027 -> 10.2.224.120:5671) 2022-02-21 11:20:31.808 [info] <0.2387.0> Connection <0.2387.0> (10.2.224.134:50027 -> 10.2.224.120:5671) has a client-provided name: PVWA 2022-02-21 11:20:31.808 [error] <0.2387.0> Error on AMQP connection <0.2387.0> (10.2.224.134:50027 -> 10.2.224.120:5671, state: starting): PLAIN login refused: rabbit_auth_backend_http failed authenticating PVWAApp_PVWA1: {bad_response, "deny"} 2022-02-21 11:20:31.808 [info] <0.2387.0> closing AMQP connection <0.2387.0> (10.2.224.134:50027 -> 10.2.224.120:5671 - PVWA) 2022-02-21 11:20:31.854 [info] <0.2396.0> accepting AMQP connection <0.2396.0> (10.2.224.134:50028 -> 10.2.224.120:5671) 2022-02-21 11:20:31.886 [info] <0.2396.0> Connection <0.2396.0> (10.2.224.134:50028 -> 10.2.224.120:5671) has a client-provided name: PVWA 2022-02-21 11:20:31.886 [error] <0.2396.0> Error on AMQP connection <0.2396.0> (10.2.224.134:50028 -> 10.2.224.120:5671, state: starting): PLAIN login refused: rabbit_auth_backend_http failed authenticating PVWAApp_PVWA1: {bad_response, "deny"} 2022-02-21 11:20:31.886 [info] <0.2396.0> closing AMQP connection <0.2396.0> (10.2.224.134:50028 -> 10.2.224.120:5671 - PVWA)
-----------------------------------------------------------------------------------------------------------------------------------------------------


Environment


10.10;11.1;11;11.2;11.3;11.4;11.5;11.6;11.7;12.0;12.1;12.2;11.9;11.8 Vault server 12.2.1 with Distributed Vault enabled
PVWA 12.2.2
PSM 12.2.2
EnableDistributedConnect setting enabled through PVWA. Both in PVWA and PSM, Vault.ini specifies "DISTRIBUTEDVAULTS=Yes" and points to a DNS SRV record of the primary Vault.


Cause


Since the error message on the Vault's rabbitmq.log file mentions the PVWA app user, but the PVWA itself starts fine, so the *cred file* for the PVWA app user is okay, but the apikey.ini file may be corrupted.

Resolution


The following steps should allow recreation of the API key in a way that "syncs" it back up with RabbitMQ:

1. On the PVWA server, open an admin CMD prompt and go to "\CyberArk\Password Vault Web Access\Env".
2. Revoke the user's key first using the following command:
- ApiKeyManager.exe revoke -t {PVWA-Username} -u {Vault-administrator} -a {PVWA-API-URL}
- Example: ApiKeyManager.exe revoke -t pvwaappuser -u administrator -a https://pvwa.lab.local/passwordvault/api
3. Recreate the user's key file using the following command (the "-l" option is what was most likely missing from the originally run command):
- ApiKeyManager.exe add -f {path-to-api-file} -l "RabbitMQ,Vault" -t {PVWA-username} -u {Vault-administrator} -a {PVWA-API-URL}
- Example: ApiKeyManager.exe add -f "C:\CyberArk\Password Vault Web Access\credfiles\apigw.ini" -l "RabbitMQ,Vault" -t pvwaappuser -u administrator -a https://cpm-dv.lab.local/passwordvault/api
4. Perform "iisreset" on PVWA.


Actions
  • Print
  • Copy Link

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