XenApp/XenDesktop 7.X: Test Site Run Via Citrix Studio Fails With Error: "Database Cannot Be Reached. Check Database Connection Settings And User Permission"

XenApp/XenDesktop 7.X: Test Site Run Via Citrix Studio Fails With Error: "Database Cannot Be Reached. Check Database Connection Settings And User Permission"

book

Article ID: CTX238583

calendar_today

Updated On:

Description

XenApp/XenDesktop Site is up and running and there is no functional impact.

However, when Test Site task is run via Citrix Studio, Site Configuration Testing Report shows error "Check database connection settings and user permissions" for "Check There is a recent database backup" test.

testsite
 

Resolution

To verify this behavior, run the following query:

SELECT l.name as grantee_name, p.state_desc, p.permission_name
FROM sys.server_permissions AS p JOIN sys.server_principals AS l
ON p.grantee_principal_id = l.principal_id
WHERE permission_name = 'VIEW ANY DATABASE' ;
GO

Once you run this query, You should be seeing output similar to below:

Testsite2


To grant/deny the VIEW ANY DATABASE permission to a specific login, run the following SQL query:

Grant VIEW ANY DATABASE to PUBLIC
DENY VIEW ANY DATABASE to [USER]
 

If you wish to deny this for a  specific login, we can run the below statement instead of DENY VIEW ANY DATABASE TO PUBLIC. After running the below statement, this login won't be able to see databases except for any database that this login is the database owner, but all other logins can see the database as long as you did not also deny view to Public.

USE MASTER
GO
GRANT VIEW ANY DATABASE TO PUBLIC; -- turn this back on if it was off
GO
DENY VIEW ANY DATABASE TO USER_A;
GO

Note: Always take a database backup before making any changes to the SQL database.
 

Problem Cause

By default, the VIEW ANY DATABASE permission is granted to the PUBLIC role.Therefore, by default, EVERY user that connects to an instance of SQL Server can see ALL databases in the instance.

However, in this case "VIEW ANY DATABASE” permissions were denied for Public role due to which Site tests to read the backup information of Citrix databases which is fetched from in Master database was failing.

 

Issue/Introduction

XenApp/XenDesktop 7.X: Test Site Run Via Citrix Studio Fails With Error: "Database Cannot Be Beached.Check Database Connection Settings And User Permission"