Error: "Database could not be contacted" When Opening Desktop Studio

Error: "Database could not be contacted" When Opening Desktop Studio

book

Article ID: CTX134575

calendar_today

Updated On:

Description

The following error occurs when opening Desktop Studio and accessing the Dashboard tab:
“Database could not be contacted”

User-added image

In the Desktop Studio Logs, the following error is displayed:
“A database operation failed and could not be recovered: Reason Object reference not set to an instance of an object.”
Note: Apart from these two error messages, there appears to be no other issues and the users are unaffected.

Resolution

Complete the following steps to resolve the issue:

  1. Backup the XenDesktop database.

  2. Verify that you can see incorrect Controller reference in desktop studio.

    User-added image

    This can also be confirmed by running Get-BrokerController PowerShell command on one of the XenDesktop brokers in the site.

    Example - Correct Entry

    ActiveSiteServices                 : {ControllerReaper, ControllerNameCacheRefresh, Licensing, BrokerReaper...}
    AssociatedHypervisorConnectionUids : {1}
    ControllerVersion                  : 5.6.0.33
    DNSName                            : FQDN
    DesktopsRegistered                 : 2
    LastActivityTime                   : 10/08/2012 10:41:23
    LastStartTime                      : 18/07/2012 21:22:54
    LicensingBurnInDate                : 17/02/2012 00:00:00
    MachineName                        : domain\machinename
    OSType                             : Win32NT
    OSVersion                          : 6.1.7601.65536
    SID                                : S-X-X-XX-XXXXXXXXX-XXXXXXXXX-XXXXXXXXX-XXXXX
                                         158
    State                              : Active
    Uid                                : 1
    
    Example - Incorrect Entry
    ActiveSiteServices                 : {}
    AssociatedHypervisorConnectionUids : {}
    ControllerVersion                  :
    DNSName                            :
    DesktopsRegistered                 : 0
    LastActivityTime                   :
    LastStartTime                      :
    LicensingBurnInDate                :
    MachineName                        : S-X-X-XX-XXXXXXXXX-XXXXXXXXX-XXXXXXXXX-XXXXX
    OSType                             :
    OSVersion                          :
    SID                                : S-X-X-XX-XXXXXXXXX-XXXXXXXXX-XXXXXXXXX-XXXXX
    State                              : Off
    Uid                                : 2
  1. Follow this procedure to remove any incorrect broker from the site - Add, remove, or move Controllers, or move a VDA.

  2. Run Get-BrokerController command to verify that the incorrect Controller reference is removed from the database.

  3. Open Desktop Studio and verify that there are no errors while accessing the Dashboard tab.


Problem Cause

The problem occurs when joining a new Controller to a Site fails half-way through. This leaves the database in an inconsistent state.

Issue/Introduction

This article provides a resolution to the error "Database could not be contacted" that occurs when opening Desktop Studio.

Additional Information

CTX128075 - XDDBDiag for XenDesktop
CTX127969 - Desktop Studio Logging Options for XenDesktop 5