while specific related pipes open occurred not network for establishing error could cannot asp.net sql-server connection named-pipes

asp.net - specific - sql server error 53 connection



Extraño error de conexión SQL intermitente, se corrige en el reinicio, regresa después de 3-5 días(ASP.NET) (4)

"He notado muchos inicios de sesión ANÓNIMOS en el registro de seguridad en la mitad de la noche de nuestro servidor AD, lo cual es extraño, y también algunos de un IP en Amsterdam".

Parece como si pudieras tener a alguien tratando de entrar en tu sistema y tal vez estas son las conexiones que no se están cerrando. Me gusta la sugerencia de usar perfmon y profiler para ver el problema.

Por alguna razón cada 3-5 días nuestra aplicación web pierde la capacidad de abrir una conexión a la base de datos con el siguiente error, lo extraño es que todo lo que tenemos que hacer es reiniciar el contenedor (es un VPS) y se restaura a la funcionalidad normal. Luego, unos días más tarde o así, vuelve a suceder. ¿Alguien ha tenido tal problema? He notado un montón de LOGONOS ANÓNIMOS en el registro de seguridad en la mitad de la noche de nuestro servidor de AD, lo cual es extraño, y también algunos de un IP en Amsterdam. No estoy seguro de cómo decir exactamente qué significan, si está relacionado o no.

Server Error in ''/ntsb'' 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: Line 11: Line 12: Line 13: dbConnection.Open() Line 14: Line 15: Source File: C:/Inetpub/wwwroot/includes/connection.ascx Line: 13 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) +248 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +245 System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject) +475 System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +260 System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +2445449 System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +2445144 System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +354 System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +703 System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +54 System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +2414696 System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +92 System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +1657 System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +84 System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +1645687 System.Data.SqlClient.SqlConnection.Open() +258 ASP.includes_connection_ascx.getConnection() in C:/Inetpub/wwwroot/includes/connection.ascx:13 ASP.default_aspx.Page_Load(Object sender, EventArgs e) in C:/Inetpub/wwwroot/Default.aspx:16 System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +42 System.Web.UI.Control.OnLoad(EventArgs e) +132 System.Web.UI.Control.LoadRecursive() +66 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2428 Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053


¿Has intentado recopilar información básica con perfmon y profiler (trace) para ver cuántas conexiones se hacen, estadísticas de memoria y otras cosas interesantes?


El número de conexiones permitidas al servidor sql es un recurso fijo. Parece que tienes un código en alguna parte que no está cerrando correctamente su conexión, y después de un período no puedes abrir ninguno más.


Recientemente enfrentamos un problema similar en nuestro entorno de producción y después de muchas rondas de "debugdiag" ging y análisis de los vertederos llegamos a la conclusión de que un montón de objetos grande y en gran parte fragmentado estaba causando esto. Ref http://msdn.microsoft.com/en-us/magazine/cc534993.aspx . En resumen, es posible que su aplicación se haya quedado sin memoria y no tenga suficiente espacio contiguo para abrir las conexiones. Puede usar VMMap http://technet.microsoft.com/en-us/sysinternals/dd535533 con el fin de identificar el espacio libre disponible. ¿Estás reciclando tus AppPools regularmente? AppPool recicla rasga la aplicación y libera cualquier memoria de ayuda, por lo tanto, resuelve cualquier problema relacionado.