Friday 16 December 2011

Citrix XenApp failed to connect to the Data Store

We had an issue with one of the Citrix servers in our farm after a reboot. The server came up fine, however, the IMA service would not start. The following errors showed up in the event log in succession every time we tried starting the service.
  1. Citrix XenApp failed to connect to the Data Store. ODBC error while connecting to the database: S1000 -> [Microsoft][ODBC Microsoft Access Driver] Cannot open database ‘(unknown)’.  It may not be a database that your application recognizes, or the file may be corrupt.
  2. Failed to load plugin C:\Program Files\Citrix\System32\Citrix\IMA\SubSystems\ImaPsSs.dll with error IMA_RESULT_FAILURE
  3. Failed to load plugin C:\Program Files\Citrix\System32\Citrix\IMA\SubSystems\ImaRuntimeSS.dll with error IMA_RESULT_FAILURE
  4. Failed to load initial plugins with error IMA_RESULT_FAILURE
  5. The Citrix Independent Management Architecture service terminated with service-specific error 2147483649 (0×80000001).

The reason why the IMA service would not start was due to an issue with the Local Host Cache database. The Local Host Cache database is used in a Citrix farm to allow a Citrix server to function even if it loses temporary access to the data store. It is an MS Access database named lmalhc.mdb and is stored by default in <ProgramFiles>\Citrix\Independent Management Architecture\ folder.
The solution for this issue was to recreate the LHC database using the dsmaint command. Before you run the dsmaint command, double check and ensure the following is true:
  1. The Citrix IMA Service isnt running (duh!)
  2. The datastore is available.
Once you have checked both the above, run the following command to recreate the LHC database.

dsmaint recreatelhc

This command performs the following:
  1. Renames the existing LHC database.
  2. Creates a new database.
  3. Modifies the following registry key HKEY_LOCAL_MACHINE\SOFTWARE\Citrix\IMA\Runtime\PSRequired key to 1. Setting the value PSRequired to 1 forces the server to establish communication with the data store in order to populate the Local Host Cache database. When the IMA service is restarted, the LHC is recreated with the current data from the data store.
Once the command has been run, restart the IMA service and it should start normally now.

No comments:

Post a Comment

Next previous home