Monday, January 16, 2012

Installing Citrix XenDesktop 5.0 SP1 or 5.5 with VMware vSphere 5.0 with distributed switches throws the error “Error expanding node” while selecting a cluster and throws the error “An unhandled error was thrown by the service.” if you select the cluster with the error

Problem

Environment:

XenDesktop 5.0 SP1 or 5.5 Operating System:  Windows Server 2008 R2

Back-end SQL Server:  SQL Server 2008 R2

XenDesktop:  Version 5.0 SP1 or 5.5

Virtualization Technology: VMware vSphere 5.0 with dVS (Distributed Virtual Switches)

You’re setting up a new installation of XenDesktop to connect to your vSphere 5.0 environment with distributed virtual switches:

image

image

As you proceed through to the point where you select your cluster:

image

… you notice that expanding the nodes throws the error:

Error expanding node

image

You’re able to continue by selecting the cluster and clicking OK but receive the following error:

An unhandled error was thrown by the service.

image

image

Browsing the event logs of your XenDesktop 5.0 SP1 or 5.5 application logs show event IDs 1007 and 1006 errors logged by the CitrixHostService:

Event ID 1007

Otherwise unhandled exception in WCF call : Citrix.ManagedMachineAPI.ManagedMachineException: The given key was not present in the dictionary. ---> System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
at System.ThrowHelper.ThrowKeyNotFoundException()
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at Citrix.PoolManagement.VMManager.VmmImplementation.Vmware.InventoryTree.AddResourcePoolNetworksAndStorage(TreeInfo tree, String requiredPath, Node currentNode, List`1 items)
at Citrix.PoolManagement.VMManager.VmmImplementation.Vmware.InventoryTree.GetFolderItems(VmwareVmConnection connection, String inventoryPath, Boolean all)
at Citrix.PoolManagement.VMManager.VmmImplementation.Vmware.VmwareVmManager.GetContents(String path, Boolean all)
--- End of inner exception stack trace ---
at Citrix.PoolManagement.VMManager.VmmImplementation.Vmware.VmwareVmManager.Intercept(Exception e)
at Citrix.PoolManagement.VMManager.VmmImplementation.Vmware.VmwareVmManager.GetContents(String path, Boolean all)
at Citrix.HostingUnitService.SDK.SDKLogic.GetHypervisorItemContents(HypervisorConnection connection, SecretStringBuffer password, String path, Boolean force, HypervisorObject[]& hypervisorObjects)
at Citrix.HostingUnitService.SDK.SdkHostingUnitService.<>c__DisplayClass88.<GetHypervisorItemContents>b__87()
at Citrix.XDServiceBase.ServiceBase.CheckedCall[T](String name, Func`1 operation, Func`2 defaultValue, Enum code)

image

You notice that every time you make an attempt to add the cluster, the event IDs 1007 and 1006 get logged:

image

Event ID 1006

Inner exception : Citrix.ManagedMachineAPI.ManagedMachineException: The given key was not present in the dictionary. ---> System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
at System.ThrowHelper.ThrowKeyNotFoundException()
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at Citrix.PoolManagement.VMManager.VmmImplementation.Vmware.InventoryTree.AddResourcePoolNetworksAndStorage(TreeInfo tree, String requiredPath, Node currentNode, List`1 items)
at Citrix.PoolManagement.VMManager.VmmImplementation.Vmware.InventoryTree.GetFolderItems(VmwareVmConnection connection, String inventoryPath, Boolean all)
at Citrix.PoolManagement.VMManager.VmmImplementation.Vmware.VmwareVmManager.GetContents(String path, Boolean all)
--- End of inner exception stack trace ---
at Citrix.PoolManagement.VMManager.VmmImplementation.Vmware.VmwareVmManager.Intercept(Exception e)
at Citrix.PoolManagement.VMManager.VmmImplementation.Vmware.VmwareVmManager.GetContents(String path, Boolean all)
at Citrix.HostingUnitService.SDK.SDKLogic.GetHypervisorItemContents(HypervisorConnection connection, SecretStringBuffer password, String path, Boolean force, HypervisorObject[]& hypervisorObjects)
at Citrix.HostingUnitService.SDK.SdkHostingUnitService.<>c__DisplayClass88.<GetHypervisorItemContents>b__87()
at Citrix.XDServiceBase.ServiceBase.CheckedCall[T](String name, Func`1 operation, Func`2 defaultValue, Enum code)

image

Solution

The only solution for this fix, as of January 16, 2012, is to actually open up a technical support case with Citrix, have the first line engineer to escalate the case to an offline engineer to supply a private hotfix (about 152KB in size) where you would replace a DLL file in one of your Citrix folders and restart your XenDesktop services.  The reason I am not naming the folder path or DLL file is due to the disclaimer in the package I got from Citrix.

It’s also worth mentioning that if you intend on keeping your old someFile.dll, make sure you rename the extension of the original file.  I originally renamed the DLL file with OLD_someFile.dll and that caused the hotfix to not get applied.  After getting on the phone with a Citrix engineer, he renamed it to someFile.dll.old and the error immediately went away.

For more information, you can read this thread on the Citrix forum: http://forums.citrix.com/thread.jspa?threadID=292916&start=0&tstart=0

1 comment:

Anonymous said...

Luk thanks so much. People like you only make engineers life so much easier. You are so helpful.