Citrix Studio: Cannot Communicate with the Database

I have recently came across an issue where I got the below error message upon launching Citrix Studio.

Cause:

Normally, you would just check if the database server is online and there is no connectivity issue between that and Citrix delivery controller. But most of the times that’s not the cause of the issue.

In my case, the Citrix was set up in a way to serve multiple clients, so each client had their own delivery group and machine catalog configured which was pointing to their own domain controllers using a two-way trust relationship between their domain and the domain citrix was set up on.

One of the clients was decommissioned i.e. their domain controller was decommissioned or taken offline prior to removing them off Citrix hence that caused this issue. Now in order to resolve the issue we would have to manually delete the SID of that client’s administrator from Citrix XenDesktop Database. We would have to first find that SID of the client that got decommissioned.

Fix:

  • Connect to the SQL server that hosts Citrix Database read-write copy.
  • Expand the database – Tables – Das.Administrators and select Top 1000 rows. This will list all administrators SIDs that are in Citrix. These SIDs needs to be converted to usernames.
  • Right-click on one of the records and select “save results as” and save it in csv format.
  • We can use the following command to convert all SIDs to usernames so it would be easier to see which one needs to be removed.

Import-csv “csvfile path” | Select-Object Sid,@{n=’User’;e={(New-Object System.Security.Principal.SecurityIdentifier $_.Sid).Translate([System.Security.Principal.NTAccount]).Value}}

  • In the output, if the username is blank or it says “trust relationship not valid” that’s the culprit username and needs deleting from the database.
  • Once you have found the bad SID in previous step, go back to 2nd step and look for that SID we found in previous step and find the associated ID with it.
  • Go to SQL database of Xendektop – Tables – DA Administrators – Edit top 200 rows.
  • Right-click on that ID and delete it OR you can use the SQL query to delete it as well.
  • Delete From DAS.Administrators Where ID = ‘ID number of the SID’
  • Open Citrix Studio now and it should open up fine now.

One thought on “Citrix Studio: Cannot Communicate with the Database

Add yours

  1. Hi Salman. I have this error, but that is due to the fact that the SQL DBs dont exist anymore, as the SQL server crashed and no backups were made.

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Create a website or blog at WordPress.com

Up ↑

%d bloggers like this: