Intermittent Session Launch Failure with Active/Active StoreFront Server Groups
book
Article ID: CTX460312
calendar_today
Updated On:
Description
Users intermittently fail to receive ICA files from StoreFront when trying to launch a new session in the following circumstances (all of the below conditions must apply):
Multiple active StoreFront server groups are in use, connected by GSLB, configured either for direct access or authentication though Citrix Gateway
Users are logging in with “modern” web browsers such as Chrome and Edge, which invoke the protocol handler or web helper code client-side as opposed to browser plugins to detect whether a Workspace app client is installed on the user endpoint
No error message is displayed to the user. The issue is more often seen with external users connecting through Citrix Gateway, but may also be experienced by internal users connecting to StoreFront.
Environment
The above mentioned sample code is provided to you as is with no representations, warranties or conditions of any kind. You may use, modify and distribute it at your own risk. CITRIX DISCLAIMS ALL WARRANTIES WHATSOEVER, EXPRESS, IMPLIED, WRITTEN, ORAL OR STATUTORY, INCLUDING WITHOUT LIMITATION WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NONINFRINGEMENT. Without limiting the generality of the foregoing, you acknowledge and agree that (a) the sample code may exhibit errors, design flaws or other problems, possibly resulting in loss of data or damage to property; (b) it may not be possible to make the sample code fully functional; and (c) Citrix may, without notice or liability to you, cease to make available the current version and/or any future versions of the sample code. In no event should the code be used to support ultra-hazardous activities, including but not limited to life support or blasting activities. NEITHER CITRIX NOR ITS AFFILIATES OR AGENTS WILL BE LIABLE, UNDER BREACH OF CONTRACT OR ANY OTHER THEORY OF LIABILITY, FOR ANY DAMAGES WHATSOEVER ARISING FROM USE OF THE SAMPLE CODE, INCLUDING WITHOUT LIMITATION DIRECT, SPECIAL, INCIDENTAL, PUNITIVE, CONSEQUENTIAL OR OTHER DAMAGES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Although the copyright in the code belongs to Citrix, any distribution of the sample code should include only your own standard copyright attribution, and not that of Citrix. You agree to indemnify and defend Citrix against any and all claims arising from your use, modification or distribution of the sample code.
Resolution
To force the user web session to be persistent to one StoreFront server group for the lifetime of the client detection process, from login through to ICA file delivery, rewrites can be configured on Citrix ADC to insert location-specific addresses. These rewrite policies are bound to either the Gateway vServers, the StoreFront load balancing vServers, or both, depending on whether the issue is experienced externally, internally, or both, respectively. The location-specific addresses used are not visible to the end user and do not impact the contents of the ICA file; therefore this code does not impact user session routing and can be used alongside features such as Optimal HDX Routing. Note that the solution relies on placeholder names as documented below under "Naming Conventions" and the sample is based on an environment with two GSLB sites, but could be expanded to additional locations. The placeholder names must be updated to reflect a customer’s as-built environment. If the code sample is used exactly as written, it is unlikely to function as designed. It is strongly recommended to test any changes in a pre-production environment before deploying to production. Naming Conventions
Gateway.acme.com – GSLB Citrix Gateway address
SiteA.gateway.acme.com – Specific URL for Site A Citrix Gateway
SiteB.gateway.acme.com - Specific URL for Site B Citrix Gateway
Storefront.acme.net – GSLB StoreFront address, also base URL shared by server groups
SiteA.storefront.acme.net – Specific URL for Site A StoreFront server group
SiteB.storefront.acme.net - Specific URL for Site B StoreFront server group
Store – Store name defined in StoreFront with “StoreWeb” as the corresponding website
gw_vserver – name of Gateway vServer object on both SiteA and SiteB ADCs
sf_vserver – name of StoreFront load balancing vServer object on both SiteA and SiteB ADCs
GSLB Citrix Gateway-based Access Required DNS Records
All required DNS records to support GSLB for gateway.acme.com
A record for SiteA.gateway.acme.com resolving to SiteA Gateway VIP in external DNS
A record for SIteB.gateway.acme.com resolving to SiteB Gateway VIP in external DNS
Local A record on SiteA Gateway resolving storefront.acme.net to local load balancing vServer for SiteA StoreFront server group (this URL will not be rewritten)
Local A record on SiteB Gateway resolving storefront.acme.net to local load balancing vServer for SiteB StoreFront server group (this URL will not be rewritten)
New rewrite action SiteA ADC only >>add policy expression rw_act_replace "\"sitea.storefront.acme.net\""
New rewrite action SiteB ADC only >>add policy expression rw_act_replace "\"siteb.storefront.acme.net\""
Problem Cause
User web sessions must remain sticky to the same StoreFront server group up to ICA session launch. Site persistence in GSLB architectures is typically achieved via HTTP cookies. Communication from the user browser to the Citrix Web Helper is achieved via Javascript which cannot read HTTP cookies. Therefore, the browser-based way to achieve persistence cannot be used. The result is that information communicated between the Web Helper and StoreFront, such as presence of Workspace app on the endpoint and retrieval of ICA file for launch, can be misrouted between StoreFront server groups resulting in failed session launch as the request to retrieve the ICA file may be sent to a StoreFront server that has no knowledge of the original launch request, and therefore no file prepared to retrieve.
Additional Information
The Web Helper is a small program installed on the client device as part of Receiver/Workspace app. Its purpose is to indicate to the web site that Receiver/Workspace app is installed and to communicate properties that control certain website functionality. There are two main phases of the user web session during which it is invoked:
When the user is prompted to detect (and optionally install) Receiver / Workspace app
The browser requests a Client Detection Ticket (CDT) from StoreFront
This is passed through the browser to the Web Helper along with a postbackURL where the information should be sent. The postback URL is either the Gateway GSLB address (external) or StoreFront base URL (internal). The postbackURL is what is being rewritten in the above solution.
Web Helper collects information about Receiver/Workspace app (if installed) on the endpoint and submits it along with the CDT to the postbackURL
Once received, StoreFront stores the CDT
The browser retrieves the client information from StoreFront
When the user selects an app or desktop to launch
The browser sends the launch request to StoreFront and requests a FileFetchTicket (FFT), which is later exchanged for the ICA file
StoreFront creates the FFT and ICA file, which is stored on the server and keyed by the FFT and supplies the FFT back to the browser
The browser supplies the FFT to Web Helper along with a postbackURL where the request for the ICA file should be sent. The postback URL is either the Gateway GSLB address (external) or StoreFront base URL (internal). The postbackURL is what is being rewritten in the above solution.
The Web Helper sends a request to the postbackURL to request the ICA file, supplying the FFT.
StoreFront uses the FFT to retrieve the ICA file and supply it back to the Web Helper, which invokes the HDX engine on the endpoint to launch the session