Failed to construct DatabaseContext object. Connection to database failed.
search cancel

Failed to construct DatabaseContext object. Connection to database failed.

book

Article ID: 154999

calendar_today

Updated On:

Products

IT Management Suite Client Management Suite

Issue/Introduction

Symantec Management Platform server (SMP Server or NS Server) stopped communicating with the SQL database.  The NS  Console will no longer open and the a.log files are full of red errors.  This may happen on an existing SMP server or a fairly new install.

Priority: 1
Date: 9/6/2011 8:39:06 AM
Tick Count: 1537156226
Host Name: <SMPservername>
Process: w3wp (8516)
Thread ID: 299
Module: w3wp.exe
Source: Altiris.TaskManagement.ClientTask.*
Description: BaseXmlHttpCallback Exception: Altiris.NS.Exceptions.DatabaseNotReadyException: Failed to construct DatabaseContext object. Connection to database failed. ---> Altiris.NS.Exceptions.AeXException: Failed to open database connection. Current user is domain\svc-altiris. Error: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) ---> System.Data.SqlClient.SqlException: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
   at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
   at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
   at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)

Priority: 1
Date: 9/6/2011 8:39:06 AM
Tick Count: 1537155898
Host Name: <SMPservername>
Process: CTDataLoad (7772)
Thread ID: 6
Module: CTDataLoad.exe
Source: Altiris.TaskManagement.ClientTask.*
Description: LocalClientTaskReporting.SendPendingEvents(): Error in processing loop: Altiris.NS.Exceptions.DatabaseNotReadyException: Failed to construct DatabaseContext object. Connection to database failed. ---> Altiris.NS.Exceptions.AeXException: Failed to open database connection. Current user is domain\svc-altiris. Error: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) ---> System.Data.SqlClient.SqlException: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)

Priority: 1
Date: 9/6/2011 8:39:06 AM
Tick Count: 1537149751
Host Name: <SMPservername>
Process: w3wp (8516)
Thread ID: 57
Module: w3wp.exe
Source: Altiris.NS.AgentManagement.PolicyRequest.GetPolicies
Description: Unable to generate agent policies for resource 00000000-0000-0000-0000-000000000000.
**CEDUrlStart** :http://entced.symantec.com/entt?product=SMP&version=Unknown&language=en&module=NZkB/5hwsqx2uIhAsaNYTtl2SNo+MS62b6k6+PPZWWM=&error=-122517562&build=**CEDUrlEnd**


( Exception Details: Altiris.NS.Exceptions.DatabaseNotReadyException: Failed to construct DatabaseContext object. Connection to database failed. ---> Altiris.NS.Exceptions.AeXException: Failed to open database connection. Current user is domain\svc-altiris. Error: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) ---> System.Data.SqlClient.SqlException: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
   at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
   at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
   at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
   at System.Data.SqlClient.SqlConnection.Open()
   at Altiris.NS.Utilities.DbUtils.OpenConnection(SqlConnection dbConn)
   --- End of inner exception stack trace ---
   at Altiris.NS.Utilities.DbUtils.OpenConnection(SqlConnection dbConn)
   at Altiris.NS.Utilities.DbUtils.CreateConnection(String server, String catalog, String user, String password)
   at Altiris.NS.ContextManagement.AdminDatabaseContext.OpenDbConnection()
   at Altiris.Database.DatabaseContext`1.Initialize(Boolean beginTransaction, IsolationLevel isolationLevel)

 

Priority: 1
Date: 9/6/2011 8:39:06 AM
Tick Count: 1537149486
Host Name: <SMPservername>
Process: w3wp (8516)
Thread ID: 38
Module: w3wp.exe
Source: GetPackageInfo::Page_Load
Description: Unable to get the package info for the specified request (Request: , Exception: Altiris.NS.Exceptions.DatabaseNotReadyException: Failed to construct DatabaseContext object. Connection to database failed. ---> Altiris.NS.Exceptions.AeXException: Failed to open database connection. Current user is domain\domain. Error: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) ---> System.Data.SqlClient.SqlException: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
   at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
   at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
   at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
   at System.Data.SqlClient.SqlConnection.Open()

**CEDUrlStart** :http://entced.symantec.com/entt?product=SMP&version=Unknown&language=en&module=y/f5nBK5Scq/tPRbnpyiP7gSjz/00RdcTYZmP93eSKo=&error=-1342478313&build=**CEDUrlEnd**

Cause

DNS entry for the SQL server in question is missing. 

Resolution

Add a static DNS entry for the SQL server that is having problems.

OR edit the Hosts file on the SMP and add the IP / Hostname for the SQL server