System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.

Topics: ASP.NET 2.0, Business Logic Layer
Aug 25, 2009 at 9:06 AM
Edited Aug 25, 2009 at 9:07 AM

Now and again I am getting the following error.  Temporary fix is to ammend the web.config file to restart the application pool.  please help ( Shared Godaddy host and running BE 1.4.5.12)

======================error=======================

Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.

 

Server Error in '/mysite.com' Application.

Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.

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: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.

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): Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.]
   System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +428
   System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +65
   System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +117
   System.Data.SqlClient.SqlConnection.Open() +122
   BlogEngine.Core.Providers.DbBlogProvider.LoadSettings() +385
   BlogEngine.Core.Providers.BlogService.LoadSettings() +46
   BlogEngine.Core.BlogSettings.Load() +130
   BlogEngine.Core.BlogSettings..ctor() +420
   BlogEngine.Core.BlogSettings.get_Instance() +77
   BlogEngine.Core.Web.HttpModules.ReferrerModule..cctor() +83

[TypeInitializationException: The type initializer for 'BlogEngine.Core.Web.HttpModules.ReferrerModule' threw an exception.]

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck) +0
   System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache) +86
   System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache) +230
   System.Activator.CreateInstance(Type type, Boolean nonPublic) +67
   System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +1051
   System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +111
   System.Web.Configuration.Common.ModulesEntry.Create() +38
   System.Web.Configuration.HttpModulesSection.CreateModules() +167
   System.Web.HttpApplication.InitModules() +30
   System.Web.HttpApplication.InitInternal(HttpContext context, HttpApplicationState state, MethodInfo[] handlers) +699
   System.Web.HttpApplicationFactory.GetNormalApplicationInstance(HttpContext context) +281
   System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext context) +118
   System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +290



Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.4049

 

Coordinator
Aug 26, 2009 at 10:46 PM

I'm fairly certain this is due to problems at GoDaddy.  A 'timeout' means there is either a lack of connectivity between the web and database server, or the DB or DB server is offline or not responding.

Mar 2, 2010 at 6:47 PM

same here i already check my server and all loks fine other sites run fine.

Mar 2, 2010 at 11:44 PM

hi again i already fix this issue searching on the web find this solution at this moment works for me if the same error show again i will tell you

in your Web.Config on target

<connectionStrings>
        <clear/>
        <add name="BlogEngine" connectionString="Data Source=localhost;User ID=user_bd;Password=password_user;persist security info=False;initial catalog=bd_name;" providerName="System.Data.SqlClient"/>
    </connectionStrings>

after catalog add 

Connect Timeout=200;
Like this
<connectionStrings> <clear/> <add name="BlogEngine" connectionString="Data Source=localhost;User ID=user_bd;Password=password_user;persist security info=False;initial catalog=bd_name;Connect Timeout=200;" providerName="System.Data.SqlClient"/> </connectionStrings>

regards
Mar 3, 2010 at 8:18 AM

thanks soptecpe.  I will give it a go.