Fail to Reconnect Server 2019 Session with Error "HashExchangeFailed"

Fail to Reconnect Server 2019 Session with Error "HashExchangeFailed"

book

Article ID: CTX558782

calendar_today

Updated On:

Description

Fail to reconnect the session with the error 1050 in VDA event log:
"Connection validation failed on domain '' for user '' for reason 'HashExchangeFailed'."

Environment

Caution! Using Registry Editor incorrectly can cause serious problems that might require you to reinstall your operating system. Citrix cannot guarantee that problems resulting from the incorrect use of Registry Editor can be solved. Use Registry Editor at your own risk. Be sure to back up the registry before you edit it.

Resolution

Add the following registry to disable the Fast Reconnect of VDA, it will take effective directly when reconnect the session.

Path:HKEY_LOCAL_MACHINE\SOFTWARE\Citrix\Reconnect
Value: FastReconnect
Type: REG_DWORD
Data: 0
 

Problem Cause

The HashExchange is successful at the first time, however VDA received the fast reconnect command from Windows after that.
By default, VDA enables fast reconnect.
However when the CWA reconnects it, the ExchangeHash failed due to it has been exchanged previously.

Here are some VDA CDF trace log analysis for reference:
1. The HashExchange is successful for the first time
2023/05/18 15:10:52:85451,14912,6864,1,BrokerAgentLaunchStore,,0,,1,Information,"LaunchStore:ExchangeHash CBPv1.5 sessionKey d990c4a9-a85a-4e07-8bd0-70bdae15918e, sessionKeyEntryToExchange.State NotExchanged",""
2023/05/18 15:10:52:85452,14912,6864,1,BrokerAgentLaunchStore,,0,,1,Information,"=========>>>>> ExchangeHash SUCCESS exchangeResult SessionKey d990c4a9-a85a-4e07-8bd0-70bdae15918e, domain xxxx, UserName xxxx",""
2. The Fast Reconnect is supported by default.
2023/05/18 15:10:52:96080,12120,3612,-1,Rpm,Connection.cpp,1008,ctx::Connection::IsFastReconnectSupported,9,Information,"IsFastReconnectSupported returning = 1",""
3. Received the Fast Reconnect Request from VDA Windows OS:
2023/05/18 15:10:52:99712,31212,3612,-1,Rpm,Connection.cpp,1372,ctx::Connection::GetSessionFastReconnect,9,Information,"Fast Reconnect SessionId=132, SessionGuid={E99B9A18-A03A-42DC-A38D-E521FDABC8CB}",""
2023/05/18 15:10:52:99712,31212,3612,-1,Rpm,CtxLog.cpp,71,ctx::BaseSession::~BaseSession,13,EntryExit,"EXIT ---- ctx::Connection::GetSessionFastReconnect",""
2023/05/18 15:10:52:99712,31212,3612,-1,Rpm,Connection.cpp,1324,ctx::Connection::AuthenticateClientToSession,9,Information,"Performing FSR to session 132",""
4. Trigger the HashExchange again, and return "Failed" 
2023/05/18 15:10:55:67837,14912,6864,1,BrokerAgentLaunchStore,,0,,1,Error,"LaunchStore:ExchangeHash - Session key entry in a state other than NotExchanged(Exchanged)",""
2023/05/18 15:10:55:67837,14912,6864,1,BrokerAgentEvents,,0,,9,Information,"###,BrokerAgent.LaunchStore.ReUseAttempt#d990c4a9-a85a-4e07-8bd0-70bdae15918e",""
2023/05/18 15:10:55:67838,14912,6864,1,BrokerAgentLaunchStore,,0,,1,Information,"=========>>>>> ExchangeHash FAILED exchangeResult SessionKey d990c4a9-a85a-4e07-8bd0-70bdae15918e",""

Additional Information

Fast Reconnect, introduced with Windows Server 2019, is a performance optimization to speed up reconnecting to a disconnected remote session:
https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-peap/3b331dc6-8b68-4c2d-8b84-62d4fa593eda