Sql Error Message: Allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

  • Hi all, i'm not sure if this is the right place to put this post, so if anyone has an alternative place for it to go then please, suggest away.

    My problem here is a database (DB1) that resides on a 2005 server with 20 other databases. Around 6pm DB1 is innacessible. Yet all the other db's are able to be accessed. Now DB1 web client is held on another server, it is through the web interface that i receive this error message. I have checked that the settings on the server i.e. Named Pipes were enabled and they are. I checked the logs and the event viewer and nothing seems obvious to the cause of the error. I'd appreciate your help on this. Thanks in advance.

    Server Error in '/' Application.

    --------------------------------------------------------------------------------

    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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: 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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

    [SqlException (0x80131904): 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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)]

    System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +4846887

    System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +194

    System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject) +4860189

    System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +90

    System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +342

    System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +221

    System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +189

    System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +185

    System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +31

    System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +433

    System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66

    System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +499

    System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +65

    System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +117

    System.Data.SqlClient.SqlConnection.Open() +122

    System.Web.SessionState.SqlStateConnection..ctor(SqlPartitionInfo sqlPartitionInfo) +93

    [HttpException (0x80004005): Unable to connect to SQL Server session database.]

    System.Web.SessionState.SqlSessionStateStore.ThrowSqlConnectionException(SqlConnection conn, Exception e) +229

    System.Web.SessionState.SqlStateConnection..ctor(SqlPartitionInfo sqlPartitionInfo) +383

    System.Web.SessionState.SqlSessionStateStore.GetConnection(String id, Boolean& usePooling) +205

    System.Web.SessionState.SqlSessionStateStore.DoGet(HttpContext context, String id, Boolean getExclusive, Boolean& locked, TimeSpan& lockAge, Object& lockId, SessionStateActions& actionFlags) +134

    System.Web.SessionState.SqlSessionStateStore.GetItemExclusive(HttpContext context, String id, Boolean& locked, TimeSpan& lockAge, Object& lockId, SessionStateActions& actionFlags) +48

    System.Web.SessionState.SessionStateModule.GetSessionStateItem() +117

    System.Web.SessionState.SessionStateModule.BeginAcquireState(Object source, EventArgs e, AsyncCallback cb, Object extraData) +487

    System.Web.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +66

    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155

  • Any actitvity like patch or SP applied recently on that server ?

    -------Bhuvnesh----------
    I work only to learn Sql Server...though my company pays me for getting their stuff done;-)

  • No SP's or patch's. The mystery of this is the other database's on the same server are not being affected.

    TIA

  • if possible restart sql server agent

    -------Bhuvnesh----------
    I work only to learn Sql Server...though my company pays me for getting their stuff done;-)

  • I can do that, but, what benefits will restarting the sql agent have on connections to that server?

    TIA

  • Are there any sql jobs scheduled at 6:00 p.m. which are hindering your access to the database.

  • extremenovice (6/11/2010)


    I can do that, but, what benefits will restarting the sql agent have on connections to that server? TIA

    Sometimes trust your heart rather than Sql server 😀

    -------Bhuvnesh----------
    I work only to learn Sql Server...though my company pays me for getting their stuff done;-)

  • Hi Kiran, yes there was, but i have moved them to a later time now. Yet the error is still occuring.

    Thanks for you post.

  • Bhuvnesh (6/13/2010)


    extremenovice (6/11/2010)


    I can do that, but, what benefits will restarting the sql agent have on connections to that server? TIA

    Sometimes trust your heart rather than Sql server 😀

    Thanks Bhuvnesh, i will schedule it in for today, and will update the post in the next couple of days. Due to the error occuring intermittently I may not see the benefits immediately.

    Thanks for your posts, they are much appreciated.

  • Hi i tried the sql agent and it didnt work. The same error message has appeared.

    Do you have any other advice?

    TIA

  • Have you got anything from sp_readerrorlog ? and if possible restart sql server , this is the last weapon i have 🙂

    -------Bhuvnesh----------
    I work only to learn Sql Server...though my company pays me for getting their stuff done;-)

  • Unfortuntely not:( i've been scanning the error logs and event viewer for days now and there isnt anything that stands out. I can't restart the server as there are other systems on there that are required either Out of hours or in the day. Plus that's networks authority and they have already said no to that.

    Thanks for your advice upto now, its been much appreciated 🙂

  • Bhuvnesh (6/13/2010)


    extremenovice (6/11/2010)


    I can do that, but, what benefits will restarting the sql agent have on connections to that server? TIA

    Sometimes trust your heart rather than Sql server 😀

    That is both the funniest and the dumbest thing I've ever heard.

    :crazy:

Viewing 13 posts - 1 through 12 (of 12 total)

You must be logged in to reply to this topic. Login to reply