KNOWLEDGE BASE

Error: "Could not connect to server" When using the "Test Connection" Option on Tableau Server With MSSQL Impersonation


Published: 09 Mar 2017
Last Modified Date: 12 Jul 2017

Issue

When testing a connection to a published data source on Tableau Server, the following error might occur after clicking the "Test Connection" option: 

Could not connect to server
An internal error occurred while establishing an impersonated database connection.

Environment

  • Tableau Server
  • MS SQL Server

Resolution

Test the connection by connecting to the published data source using Tableau Desktop. 

Cause

SQL Server will not accept an Active Directory (AD) username and password passed from a separate AD user account. 

Typically, "Test Connection" will function because it creates a direct connection to the database and does not involve the Run As User service account. However in this case, "Test Connection" is attempting to validate the user signed into Tableau Server instead of the Run As User. If this user does not have connect permissions, using the "Test Connection" option will fail. 

When Tableau Server runs a refresh or connects to SQL it will use the Tableau Server Run As user account and the connection will succeed. It is expected behavior that the Database connection will connect with the Run As User account before providing SQL Server the impersonated user's credentials through the query. 
Did this article resolve the issue?