How to recreate Local Host Cache on Citrix Virtual Apps & Desktops

How to recreate Local Host Cache on Citrix Virtual Apps & Desktops

book

Article ID: CTX228758

calendar_today

Updated On:

Description

Citrix ConfigSync Service outputs Event ID 505 errors periodically, "The Citrix Config Sync Service failed an import.".

Resolution

1. Logon to one delivery controller that will be used to recreate the LHC database.

2. On the chosen delivery controller, download PsExec Sysinternal tool and copy it to C:\Temp.
    PsExec: https://docs.microsoft.com/en-us/sysinternals/downloads/psexec

3. Stop the Citrix High Availability Service on all delivery controllers in the site. 

4. On the delivery controller being used to recreate the LHC database: Open Command Prompt using "Run as administrator", navigate to C:\Temp, then execute the below command to elevate the Command Prompt with Network Service account:

    PsExec -i -u "NT AUTHORITY\NETWORK SERVICE" cmd

5. Run the command "whoami" to confirm that Command Prompt is running as the "NT AUTHORITY\NETWORK SERVICE" account.

6. Use Command Prompt to navigate to the SqlLocalDB instance:
    For SQL LocalDB 2014: cd "C:\Program Files\Microsoft SQL Server\120\Tools\Binn"
    For SQL LocalDB 2017: cd "C:\Program Files\Microsoft SQL Server\140\Tools\Binn"
    For SQL LocalDB 2019: cd "C:\Program Files\Microsoft SQL Server\150\Tools\Binn"
    For SQL LocalDB 2022: cd "C:\Program Files\Microsoft SQL Server\160\Tools\Binn"

7. Execute the below two command to Stop and delete CitrixHA (LocalDB) database.
    SqlLocalDB stop CitrixHA
    SqlLocalDB delete CitrixHA

8. Remove the below files located in C:\Windows\ServiceProfiles\NetworkService
    HADatabaseName.*
    HADatabaseName_log.*
    HAImportDatabaseName.* (If exists)
    HAImportDatabaseName_log.* (If exists)

9. Start Citrix High Availability Service on only the delivery controller that was used in the previous steps.

10. In Command Prompt, execute the below command to confirm that CitrixHA is recreated:
    SqlLocalDB i

*Note that there should be two files: 
    CitrixHA (disappears just after Stop/delete in step 7, and appears after start Citrix High Availability Service in step 9)
    MSSQLLocalDB
        
11. Finally, start the Citrix High Availability Service on the remaining delivery controllers.


Problem Cause

LHC may be corrupted by multiple rebooting