Netscaler – Popup: Protocol Driver Error

Symptom:
When accessing Citrix Wi through Netscaler HA pair, launcing applications Works on one of the Netscaler nodes but when you failover to the other HA node users get an ‘Unable to launch application….Protocol Driver error’ dialog box.

The cause of this can be duplicate STA IDs on STA servers in farm. Identical STA IDs can occur when you clone servers (see http://support.citrix.com/proddocs/topic/xenapp5fp-w2k8/ps-install-config-clone-task-v2.html bullet 13) from VM template and if XML service starts before the NIC (you should set XML service to delayed start on template). When users connect on the first node they get a ticket from STA – when you failover netscaler flips the order of the STA’s and users will ask the STA with duplicate ID about the ticket, but the second STA does not know about the Tiket and refuses connection.

Netscaler - protocol driver error

see http://www.michelstevelmans.com/creating-unique-sta-id-xenapp-6-provisioning/ for powershell script to change STA ID. For convenience you can copy the script from here:
—Script Start—
# Change XenApp 6 STA ID to MAC Address
# Created by Michel Stevelmans – http://www.michelstevelmans.com

# Set location of CtxSta.config file
$Location = “${env:ProgramFiles(x86)}\Citrix\system32\CtxSta.config”

# Get the MAC address of the first NIC
$Nics = Get-WmiObject -Class Win32_NetworkAdapterConfiguration -Filter “IpEnabled = TRUE”
foreach ($Nic in $Nics)
{
$Mac = $Nic.MacAddress
Break
}

# Remove colons from MAC Address
$Sta = $Mac.Replace(“:”, “”)

# Replace STA ID with MAC Address
(Get-Content $Location) | Foreach-Object {$_ -replace ‘^UID=.+$’, “UID=STA$Sta”} | Set-Content $Location

# Restart Citrix XML Service
Restart-Service CtxHTTP
—Script End—