[yasr_overall_rating size=”medium”]

In this post I would like to cover some troubleshooting tips for Local Host Cache import errors. In all cases issue is reported in Application event log as error with ID 505 with standard description: The Citrix Config Sync Service failed an import. Error details is displayed in EventData section and is quite good explained. At the time of writing I was able to reproduce 3 errors with different description which are related to 2 issuses with local host cache database import.

Issue nr 1

Issue summary:

Event log: Application

Severity: Error

Source: Citrix ConfigSync Service

Event ID: 505

Event description: The Citrix Config Sync Service failed an import.

Error details: Security identifier does not represent a Windows account

Related issue: N/A

Figure 1

Root cause:

The most common issuse related to LHC database import. Error is reported because an orphaned SIDs can’t be verified during the import. Orphaned SID means that user account configured in application or application group has been deleted in Active Directory but is still assigned in XenDesktop database. When you remove an orphaned SIDs LHC import is completed successfully and error in the event log is no longer displayed.

Troubleshooting:

Corrective actions – short track

If you are interested to see the application with an orphaned SIDs use Get-BrokerApplication or Get-BrokerApplicationGroup. The code example is listed below.

#
Get-BrokerApplication |foreach {if ($_.AssociatedUserNames -match "S-1-5-21") {$_.Name; $_.AssociatedUserNames -match "S-1-5-21"; ""}}
#

Output is presented in the Figure 2 below.

Figure 2

Output from Citrix Studio is presented in Figure 3 below.

Figure 3

Important note:

  • Prior to version 7.14 import file was not created at all. If you are using XenDesktop CU version lower than 7.14, I do recommend migration to LTSR version 7.15
  • In version 7.15 LHC import is done successfully in every second attempt. Error is written to the event log but it does not affect the service. Removing an orphaned SIDs from XenApp configuration is important if event ID 505 is reported by your monitoring system. If you do not have monitoring system for XenDesktop specific items please see my post for XenDesktop customised monitoring templates for Zabbix.

Corrective actions – long track

It is good to do some deep investigation just to confirm the real root cause issuse in the system logs. It could happen that another issue will be causing problem during LHC import. The best method is to enable reporting for Citrix Synchronizer Service. Reporting is disabled by default and to enable it you have to modify the registry key using the comand listed below:

#
New-ItemProperty -Path HKLM:\SOFTWARE\Citrix\DesktopServer\LHC -Name EnableCssTraceMode -PropertyType DWORD -Value 1
#

Output is presented in the Figure 4 below.

Figure 4

When reporting is enabled, report file called CitrixBrokerConfigSyncReport.html is created in the following path: C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Temp. File is located in hiden folder AppData. Turn on an option to display hidden items in windows explorer to display this location. Check the report location in windows explorer or list the folder content on the command line. Output is presented in the Figure 5 below.

Figure 5

I do prefer to rename this file to avoid file reloading when report is refreshed. I just run rename commad to change the file name to CitrixBrokerConfigSyncReport-offline.html

Figure 6

The content of the report is displayed in Figures 7 and 8 below.

Figure 7

In the Figure 8 below you see in red the issue. In this case exception in the report match the issue description reported in the windows event log.

Figure 8

When you complete troubleshooting disable reporting for Citrix Synchronizer Service. The command example is listed below.

#
Set-ItemProperty -Path HKLM:\SOFTWARE\Citrix\DesktopServer\LHC -Name EnableCssTraceMode -Value 0
#

Output is presented in the Figure 9 below.

Figure 9

When all the steps are completed run the command provided in the fast track section above to displayed applications with an orphaned SIDs and remove all not existing accounts from applications. Event 505 should not be logged any longer (until the next orphaned SID will be find).

Issue nr 2

Issue summary:

Event log: Application

Severity: Error

Source: Citrix ConfigSync Service

Event ID: 505

Event description: The Citrix Config Sync Service failed an import.

Error details: Failed to connect to back-end server ‘localhost’ on port 89 using binding WSHttp. The server may be off-line or may not be running the appropriate service

Related issue: “Citrix High Availability Service” is unreachable

Issue description presented in the Figure 10  below is writen to the event log only once.

Figure 10

Issue description presented in the Figure 11  below is writen to the event log every 1 minute.

Figure 11

 

Root cause:

Error is reported in the event log because CitrixHA SQLlocalDB is stopped/corrupted and/or Citrix High Availability Service is stopped.

Troubleshooting:

Troubleshooting must be done in serveral steps

Step 1 – Verify the status of Citrix High Availability Service. The command example is listed below.

#
Get-Service CitrixHi*
#

Step 2 – Verify status of SqlLocalDB.

Download PsExec on the Delivery Controller from PsExec – Windows Sysinternals 

Open the CommandPrompt and PsExec in the Network Service account context. The command example is listed below.

#
psexec -i -u "NT AUTHORITY\NETWORK SERVICE" cmd 
#

Run the command “whoami ” to confirm service account.

Important note:

Please make sure you run PsExec in the Network Service account context. Tool SqlLocalDB.exe lists all instances of SQL LocalDB owned by the current user.

On the command prompt navigate to the path  “C:\Program Files\Microsoft SQL Server\120\Tools\Binn”

Display the SQL local DB instances configured on the Delivery Controller. Use command “SqlLoaclDB i|info”. As you see on this server we have 2 localDB instances: default instance MSSQLLocalDB and our CitrixHA instance. Output is presented in the Figure 12 below.

Figure 12

Output in Figure 13 below shows instances available for user LAB\administrator on the same Delivery Controller.

Figure 13

Display the status of CitrixHA instance with command “SqlLoaclDB i CitrixHA”. Output is presented in the Figure 13 below.

Figure 14

If needed start CitrixHa instance using command “SqlLoaclDB start CitrixHA”. Output is presented in the Figure 14 below.

Figure 15

 

If issuse is not solved and CitrixHA instance is still down or import is still reporting the problem, you have to recreate XenDesktop 7.15 Local Host Cache.

I hope you will find this post useful. Feel free to add your comments and rate this article.

[yasr_visitor_votes size=”medium”]