Server connection error

Posts   
 
    
Pablo
User
Posts: 81
Joined: 21-Mar-2005
# Posted on: 27-Oct-2009 19:17:54   

Hello, I ran into a strange problem. I have my ASP.NET web application running on a shared webhost account. Normally this works like a charm. However, today, the application pool was being shut down. I know because I logged the following message in my db log: Application is shutting down. Reason: Hosting environment is shutting down.

I log this using the ASP.NET HealthMonitor option.

12 minutes after that event, I receive the first HTTP request. It fails. I've logged this succesfully in the database.

The exception being: An exception was caught during the execution of an action query: 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). Check InnerException, QueryExecuted and Parameters of this exception to examine the cause of this exception.Could not find a HttpHandler.

Stacktrace being: at SD.LLBLGen.Pro.ORMSupportClasses.ActionQuery.Execute() at SD.LLBLGen.Pro.ORMSupportClasses.BatchActionQuery.Execute() at SD.LLBLGen.Pro.ORMSupportClasses.DaoBase.ExecuteActionQuery(IActionQuery queryToExecute, ITransaction containingTransaction) at SD.LLBLGen.Pro.ORMSupportClasses.DaoBase.AddNew(IEntityFields fields, ITransaction containingTransaction) at TopLib.DAL.Mambo.EntityClasses.Sys_EventLogEntity.InsertEntity() in C:\vsdev\TopWebPlatform\TopLib\DAL\Mambo\EntityClasses\Sys_EventLogEntity.cs:line 554 at SD.LLBLGen.Pro.ORMSupportClasses.DaoBase.PersistQueue(List1 queueToPersist, Boolean insertActions, ITransaction transactionToUse, Int32& totalAmountSaved) at SD.LLBLGen.Pro.ORMSupportClasses.EntityBase.Save(IPredicate updateRestriction, Boolean recurse) at SD.LLBLGen.Pro.ORMSupportClasses.EntityBase.Save() at TopLib.AppMod.Kernel.BL.EventLog.LogException(TopRequestContext topRequest, EventType eventType, Exception e, String message, Nullable1 outerExceptionLogId) in C:\vsdev\TopWebPlatform\TopLib\AppMod\Kernel\BL\EventLog\EventLog.cs:line 158 at TopLib.AppMod.Kernel.BL.EventLog.LogCriticalException(Exception e, String message) in C:\vsdev\TopWebPlatform\TopLib\AppMod\Kernel\BL\EventLog\EventLog.cs:line 83 at TopLib.AppMod.Kernel.BL.TopApp..cctor() in C:\vsdev\TopWebPlatform\TopLib\AppMod\Kernel\BL\TopApp\TopApp.cs:line 55

The innerexception being: 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).

the innerexception stacktrace being: 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 SD.LLBLGen.Pro.ORMSupportClasses.ActionQuery.Execute()

I simply don't get it. The system reports that we cannot connect to the database. The same database is used when logging the error and that does work fine! Strange? This means that the database does not suffer a problem, otherwise I could not log it this way.

Does anyone have any idea on how to solve this?

Thanx, Paul

ps.Using: Selfservice, version 2.6 Final. Sept 12th 2008

MTrinder
User
Posts: 1461
Joined: 08-Oct-2008
# Posted on: 27-Oct-2009 21:34:40   

How are the server and database names configured ?

Matt

Pablo
User
Posts: 81
Joined: 21-Mar-2005
# Posted on: 28-Oct-2009 09:49:50   

Hello, I use for this one connection string in the web.config file, containing servername, database name, username and password. Paul

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 28-Oct-2009 10:01:23   

To narrow the posibilities down...could you login to the database using normal ADO.NET code?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 28-Oct-2009 11:33:17   

indeed. As 'named pipes' failed, it might be it's either a firewall or security issue, or a listener service isn't running. Logging is perhaps done with tcp connections, but not sure. It is stange.

Frans Bouma | Lead developer LLBLGen Pro
Pablo
User
Posts: 81
Joined: 21-Mar-2005
# Posted on: 28-Oct-2009 23:58:32   

Logging is done by my own code, using the same Entity.Save calls

I have this problem ones every so many days. I can't reproduce, other than wait.

Everytime it happens I also try to get information from the hosting company. Today they came back with the information that they've seen a problem with the Database service on that webserver. They restarted it ... and then everything was fine again.

Humm .... still, if there's an outage, I also can't log the error. I've adjusted my logging a bit, that when logging to the database doesn't work, I log to file. Maybe that gives new insights.

Could it have something to do with 'old' entity objects, which I keep in memory for cashing, that are being reused ... I'll have to see if this actually could happen.

The logging entity I allways create on the fly, when loggin.

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 29-Oct-2009 07:50:11   

I'm afraid we are helpless here. I hope your logs catchs the real cause.

I'll close this thread for now, and it will be automatically re-opened when you post a reply. Hope that comes with good news from the logs.