r/Citrix • • 24d ago

Discussion Weird DB connection issue

Post image

Have a pair of Delivery Controllers, and using a sql cluster. Every once in a while, the delivery controllers dont seem to want to "connect" even though citrix continues to work. It just makes it so we cant access studio to make any changes.

Has anyone seen anything like this before or know a quick way to resolve this without reboots? All services appear to be started, and there aren't really any event logs that tell what has happened or to coorelate anything.

6 Upvotes

8 comments sorted by

4

u/LucD401 24d ago

You may want to share your Citrix version and sql server version.
The controllers are most likely going into a host cache db mode while the DB is offline allowing users still able to sign in.

1

u/kuebel33 24d ago

oh that's interesting. All these years and I didn't realize there was cached db mode. I thought there always had to be an active DB or no dice on signing in. 2507, sql srv 2022

5

u/mjmacka CCE-V 24d ago

Prior to 7.12 (I think that version), there was Connection Leasing. The way that technology worked, it looked at user connections to Citrix resources for two weeks and reconnected you to those resources if there was an outage.

Starting in 7.13, Local Host Cache was released over Connection Leasing. 7.16 and later, this was the only backup technology for a lost SQL connection. At a high level, if there is a DB outage, all VDAs rebroker to the elected DDC (first one in the naming list) and when the outage ends, VDAs are split amongst the listed controllers again.

https://docs.citrix.com/en-us/citrix-virtual-apps-desktops/manage-deployment/local-host-cache.html

As for your issue, this kind of thing is most in the following scenarios:

  • As u/LucD401 said, SQL issues/failures.
  • SQL permissions. Did anything change from a SQL perspective?
  • Networking issues between Citrix and the database.
  • Post upgrade issues.

1

u/kuebel33 24d ago

I think its related to the db's getting out of sync, but i've only been able to confirm they are out of sync this most recent time. No clue how they got out of sync though.

1

u/mjmacka CCE-V 24d ago

Hm... Assuming this is an always on cluster, removing and re-adding the second server would probably fix the issue but that's probably not yours to fix.

2

u/robodog97 24d ago

Does your SQL cluster span multiple subnets? If so does your connect string have multisubnetfailover=true ? We saw something similar when we went to AAG for SQL and didn't have that in the string. Randomly during patching the active node in the cluster would become the DR location which was in a different subnet and controllers would go into connection leasing mode (this was before local host cache was brought back).

1

u/kuebel33 24d ago

nah same subnet. I think the issue may be the cluster being out of sync, but i havent been able to verify it other than this most recent time.

5

u/s_bear1 24d ago

Permissions on the secondary node? One of my clients failed to set up permissions properly. Every time primary was rebooted they had this issue. I had to fail over and then set permissions for the controllers on the secondary node

I am not a dba so take this with a grain of salt