XenApp/XenDesktop 7.15.2000 : Citrix Studio Times Out While Enumerating Application Groups In Large Environments With Lot Of Application Groups for Tag Restrictions

XenApp/XenDesktop 7.15.2000 : Citrix Studio Times Out While Enumerating Application Groups In Large Environments With Lot Of Application Groups for Tag Restrictions

book

Article ID: CTX238352

calendar_today

Updated On:

Description

  • XenApp/XenDesktop 7.15.2000: Citrix Studio Times Out While Enumerating Application Groups in Large Environments where lot of Application Groups are Published and Tagging is also enabled.

 

  • When you click on "Applications" tab in Citrix Studio it gets hung with a spinning circle for a few minutes and then throws the error "Database Could Not be Contacted". When you click on Error details you see "Get-BrokerApplicationGroup" gives the error "Problem Occurred contacting the database"

 

  • The issue does not occur with any other tab in Citrix Studio except while clicking on "Applications Tab".





Appgroup4
CDF TRACE

In CDF Traces collected from Delivery Controllers we see 'Execution Timeout Expired. 

368781,1,2018/07/02 13:10:07:11527,2436,1624,3,Xendesktop Management Console,_#dotNet#_,0,,1,CDF_NET_INFO,"Xendesktop Management Console:2:1:CmdletExecutionLog(1114): Script GetApplicationGroupsScript(1111): Failed to execute command: Get-BrokerApplicationGroup  -AdminAddress "DDCNAME:80" -MaxRecordCount 2147483647",""
 
368782,1,2018/07/02 13:10:07:11545,2436,1624,3,Xendesktop Management Console,_#dotNet#_,0,,1,CDF_NET_ERROR,"Xendesktop Management Console:1:1:CmdletExecutionLog(1114): Script GetApplicationGroupsScript(1111): Error received from command: Get-BrokerApplicationGroup  -AdminAddress "DDCNAME:80" -MaxRecordCount 2147483647, Error:
Name : Get-BrokerApplicationGroup
                + CategoryInfo : InvalidOperation: (:) [Get-BrokerApplicationGroup], SdkOperationException
                + FullyQualifiedErrorId : Citrix.XDPowerShell.Broker.DataStoreException,Citrix.Broker.Admin.SDK.GetBrokerApplicationGroupCommand
 
368783,1,2018/07/02 13:10:07:11553,2436,1624,3,Xendesktop Management Console,_#dotNet#_,0,,1,CDF_NET_INFO,"Xendesktop Management Console:2:1:CmdletExecutionLog(1114): Script GetApplicationGroupsScript(1111): The command; Get-BrokerApplicationGroup  -AdminAddress "DDCNAME:80" -MaxRecordCount 2147483647, Took 380.21 seconds to execute",""
 
368784,1,2018/07/02 13:10:07:11561,2436,1624,3,Xendesktop Management Console,_#dotNet#_,0,,1,CDF_NET_INFO,"Xendesktop Management Console:2:1:::-fd2ef0c2-3c79-45ce-8275-cef217891283:Executing Cmdlet: Get-BrokerApplicationGroup","
 
368785,1,2018/07/02 13:10:07:11574,2436,1624,3,Xendesktop Management Console,_#dotNet#_,0,,1,CDF_NET_INFO,"Xendesktop Management Console:2:1:Attempting to resolve the error DataStoreException to a resource string.",""
 
368786,1,2018/07/02 13:10:07:11579,2436,1624,3,Xendesktop Management Console,_#dotNet#_,0,,1,CDF_NET_INFO,"Xendesktop Management Console:2:1:Looking for String[Citrix_XDPowerShell_SdkSdkErrorId_DataStoreException]",""
 
 
368787,1,2018/07/02 13:10:07:11758,2436,1624,3,Xendesktop Management Console,_#dotNet#_,0,,1,CDF_NET_INFO,"Xendesktop Management Console:2:1:OperationTimer(GetApplicationGroupsScript: GetBrokerApplicationGroupCmd) : 380212.0ms",""
Get-BrokerApplicationGroup  -AdminAddress "DDCNAME:80" -MaxRecordCount 2147483647
Get-BrokerApplicationGroup : Problem occurred contacting the database
                + CategoryInfo : InvalidOperation: (:) [Get-BrokerApplicationGroup], SdkOperationException
                + FullyQualifiedErrorId : Citrix.XDPowerShell.Broker.DataStoreException,Citrix.Broker.Admin.SDK.GetBrokerApplicationGroupCommand
 
44614,1,2018/07/02 13:10:07:60659,3124,5752,0,BrokerController,_#dotNet#_,0,,1,CDF_NET_INFO,"BrokerController:2:1:EventLogManager decided to log event CdsEventDatabaseConnectivityLost of type Warning with arguments: 'Execution Timeout Expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.' 'System.Data.SqlClient.SqlException'.This is based on event log groups BrokerStartup.DatabaseConnectivity",""
44627,1,2018/07/02 13:10:07:64208,3124,5752,0,BrokerFiltering,_#dotNet#_,0,,1,CDF_NET_ERROR,"BrokerFiltering:1:1:BrokerSDKLogic.GetChbCommon: Unexpected exception Citrix.Fma.Sdk.Dal.DALConnectionFailedException: Cannot connect to database server ---> System.Data.SqlClient.SqlException: Execution Timeout Expired.  The timeout period elapsed prior to completion of the operation or the server is not responding. ---> System.ComponentModel.Win32Exception: The wait operation timed out
 
 
 
                Line 2191: 2099,1,2018/07/02 13:02:35:04848,2536,5752,0,BrokerFiltering,_#dotNet#_,0,,8,CDF_NET_INFO,"BrokerFiltering:2:8:Adding operation name GetApplicationGroup",""
                Line 19302: 17372,1,2018/07/02 13:03:47:46942,3124,5752,0,BrokerController,_#dotNet#_,0,,5,CDF_NET_ENTRY,"BrokerController:8:5:SDK >>> GetApplicationGroup",""
                Line 19316: 17386,0,2018/07/02 13:03:47:47221,4444,3576,0,DelegatedAdminLog,_#dotNet#_,0,,1,CDF_NET_INFO,"DelegatedAdminLog:2:1:CheckScopeAccessMultiple serviceType=Broker operations=GetApplicationGroup",""
                Line 19319: 17389,0,2018/07/02 13:03:47:48516,4444,3576,0,DelegatedAdminLog,_#dotNet#_,0,,1,CDF_NET_INFO,"DelegatedAdminLog:2:1:Unrestricted access granted for Broker:GetApplicationGroup",""
                Line 19324: 17394,1,2018/07/02 13:03:47:48692,3124,5752,0,BrokerController,_#dotNet#_,0,,1,CDF_NET_INFO,"BrokerController:2:1:CheckScopePermissions('GetApplicationGroup') returning null (unrestricted)",""
                Line 19325: 17395,1,2018/07/02 13:03:47:48692,3124,5752,0,BrokerController,_#dotNet#_,0,,5,CDF_NET_ENTRY,"BrokerController:8:5:CheckPermission(GetApplicationGroup) returns null",""
                Line 19328: 17398,1,2018/07/02 13:03:47:48753,3124,5752,0,BrokerFiltering,_#dotNet#_,0,,5,CDF_NET_ENTRY,"BrokerFiltering:8:5:FilteringLogic.GetCommon op=GetApplicationGroup",""
               Line 19329: 17399,1,2018/07/02 13:03:47:48764,3124,5752,0,BrokerFiltering,_#dotNet#_,0,,1,CDF_NET_INFO,"BrokerFiltering:2:1:GetSqlStatement: select AG.Uid, AG.Name, (select AGDGA.Priority as I from chb_Config.DesktopGroups DG  inner join chb_Config.ApplicationGroupDesktopGroupAssignments AGDGA on AGDGA.DesktopGroupUid = DG.Uid  where AGDGA.ApplicationGroupUid = AG.Uid order by AGDGA.Priority, AGDGA.LastModifiedTime desc for xml path(''),root('Root'),elements xsinil) as _AssociatedDesktopGroupPriorities, (select DG.Uid as I from chb_Config.DesktopGroups DG  inner join chb_Config.ApplicationGroupDesktopGroupAssignments AGDGA on AGDGA.DesktopGroupUid = DG.Uid  where AGDGA.ApplicationGroupUid = AG.Uid order by AGDGA.Priority, AGDGA.LastModifiedTime desc for xml path(''),root('Root'),elements xsinil) as _AssociatedDesktopGroupUids, (select DG.UUID as I from chb_Config.DesktopGroups DG  inner join chb_Config.ApplicationGroupDesktopGroupAssignments AGDGA on AGDGA.DesktopGroupUid = DG.Uid  where AGDGA.ApplicationGroupUid = AG.Uid order by AGDGA.Priority, AGDGA.LastModifiedTime desc for xml path(''),root('Root'),elements xsinil) as _AssociatedDesktopGroupUUIDs, (select AN.CN as I from chb_Config.ApplicationGroupAccountFilter AGAF inner join chb_State.AccountNames AN   on AGAF.AccountUid = AN.Uid where AGAF.ApplicationGroupUid = AG.Uid order by AN.Uid for xml path(''),root('Root'),elements xsinil) as _AssociatedUserFullNames, (select AN.SAMName as I from chb_Config.ApplicationGroupAccountFilter AGAF inner join chb_State.AccountNames AN   on AGAF.AccountUid = AN.Uid where AGAF.ApplicationGroupUid = AG.Uid order by AN.Uid for xml path(''),root('Root'),elements xsinil) as _AssociatedUserNames, (select AN.UPN as I from chb_Config.ApplicationGroupAccountFilter AGAF inner join chb_State.AccountNames AN   on AGAF.AccountUid = AN.Uid where AGAF.ApplicationGroupUid = AG.Uid order by AN.Uid for xml path(''),root('Root'),elements xsinil) as _AssociatedUserUPNs, AG.Description, AG.Enabled, (select AGMD.Name as [I/@Key], AGMD.Value as [I/text()] from chb_Config.ApplicationGroupsMetadata AGMD where AGMD.ApplicationGroupUid = AG.Uid for xml path(''),root('Root'),elements xsinil) as _MetadataMap, TR.Tag, AG.ScopeList, AG.SessionSharingEnabled, AG.SingleAppPerSession, (select T.Tag as I from chb_Config.ApplicationGroupTags AGT inner join chb_Config.Tags T on AGT.TagUid = T.Uid where AGT.ApplicationGroupUid = AG.Uid order by I for xml path(''),root('Root'),elements xsinil) as _Tags, AG.TenantId, (select count(*)   from chb_Config.ApplicationApplicationGroupAssignments AAGA  inner join chb_Config.Applications A on A.Uid = AAGA.ApplicationUid  where AAGA.ApplicationGroupUid = AG.Uid    and A.ApplicationType <> 2) as _TotalApplications, (select count(*)   from chb_Config.Desktops D  inner join chb_Config.DesktopGroups DG on DG.Uid = D.DesktopGroupUid  inner join chb_Config.ApplicationGroupDesktopGroupAssignments AGDGA on AGDGA.DesktopGroupUid = DG.Uid  where AGDGA.ApplicationGroupUid = AG.Uid) as _TotalMachines, (select count(*)   from chb_Config.Desktops D  inner join chb_Config.DesktopGroups DG on DG.Uid = D.DesktopGroupUid  inner join chb_Config.ApplicationGroupDesktopGroupAssignments AGDGA on AGDGA.DesktopGroupUid = DG.Uid  where AGDGA.ApplicationGroupUid = AG.Uid    and (chb_State.WorkerSatisfiesTagRestriction(D.WorkerUid, AG.RestrictToTagUid) = 1)) as _TotalMachinesWithTagRestriction, AG.UserFilterEnabled, AG.UUID
from chb_Config.ApplicationGroups AG left outer join chb_Config.Tags TR on TR.Uid = AG.RestrictToTagUid
where (AG.IsDesktopGroup = 0)
order by AG.Name asc",""           Line 47769: 44629,1,2018/07/02 13:10:07:65135,3124,5752,0,BrokerController,_#dotNet#_,0,,5,CDF_NET_ENTRY,"BrokerController:8:5:SDK <<< GetApplicationGroup (DataStoreException)",""
 
After Creating the below Registry key Citrix Studio does give results after 6-7 minutes but for those 6-7 minutes it becomes unusable. It means waiting over 6 minutes for the Citrix Studio GUI to display information of each page like just moving between different Application Group folders.

HKEY_LOCAL_MACHINE\Software\Citrix\DesktopServer\DataStore\Connections\Controller
Name:SdkSqlQueryTimeoutSecs
Type:REG_DWORD
Data: 600 (Decimal)
 

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

Contact Citrix Support to get the private referencing LD0012. With the private binaries in place, SDK call now makes use of a more efficient SQL table function. The fix will be included in future public cumulative updates.
 

Problem Cause

SQL queries used to check the numbers of machines across all Desktop Groups on which AppGroups are published and satisfying the given tag restriction are not optimized.

Issue/Introduction

XenApp/XenDesktop 7.15.2000 : Citrix Studio Times Out While Enumerating Application Groups In Large Environments With Lot Of Application Groups for Tag Restrictions