Unhandled exception by nopCommerce

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
5 years ago
Hi,

I see in my backoffice logs that the website is restarting a lot. When it happens, the website is inaccessible during several seconds.

It seems to be an issue to connect to the database, because I am also seeing this log:

Application: Nop.Web.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: System.InvalidOperationException at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnection(System.Data.Common.DbConnection, System.Data.ProviderBase.DbConnectionFactory, System.Threading.Tasks.TaskCompletionSource`1<System.Data.ProviderBase.DbConnectionInternal>, System.Data.Common.DbConnectionOptions) at System.Data.SqlClient.SqlConnection.TryOpenInner(System.Threading.Tasks.TaskCompletionSource`1<System.Data.ProviderBase.DbConnectionInternal>) at System.Data.SqlClient.SqlConnection.TryOpen(System.Threading.Tasks.TaskCompletionSource`1<System.Data.ProviderBase.DbConnectionInternal>) at System.Data.SqlClient.SqlConnection.Open() at System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.<Open>b__36(System.Data.Common.DbConnection, System.Data.Entity.Infrastructure.Interception.DbConnectionInterceptionContext) at System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Dispatch[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.__Canon, System.Action`2<System.__Canon,System.__Canon>, System.__Canon, System.Action`3<System.__Canon,System.__Canon,System.__Canon>, System.Action`3<System.__Canon,System.__Canon,System.__Canon>) at System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.Open(System.Data.Common.DbConnection, System.Data.Entity.Infrastructure.Interception.DbInterceptionContext) at System.Data.Entity.Core.EntityClient.EntityConnection.<Open>b__2() at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy+<>c__DisplayClass1.<Execute>b__0() at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.Func`1<System.__Canon>) at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute(System.Action) at System.Data.Entity.Core.EntityClient.EntityConnection.Open() Exception Info: System.Data.Entity.Core.EntityException at System.Data.Entity.Core.EntityClient.EntityConnection.Open() at System.Data.Entity.Core.Objects.ObjectContext.EnsureConnection(Boolean) at System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.Func`1<Int32>, System.Data.Entity.Infrastructure.IDbExecutionStrategy, Boolean, Boolean) at System.Data.Entity.Core.Objects.ObjectContext.SaveChangesToStore(System.Data.Entity.Core.Objects.SaveOptions, System.Data.Entity.Infrastructure.IDbExecutionStrategy, Boolean) at System.Data.Entity.Core.Objects.ObjectContext+<>c__DisplayClass2a.<SaveChangesInternal>b__27() at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.Func`1<Int32>) at System.Data.Entity.Core.Objects.ObjectContext.SaveChangesInternal(System.Data.Entity.Core.Objects.SaveOptions, Boolean) at System.Data.Entity.Core.Objects.ObjectContext.SaveChanges(System.Data.Entity.Core.Objects.SaveOptions) at System.Data.Entity.Internal.InternalContext.SaveChanges() at System.Data.Entity.Internal.LazyInternalContext.SaveChanges() at System.Data.Entity.DbContext.SaveChanges() at Nop.Data.EfRepository`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Insert(System.__Canon) at Nop.Services.Logging.DefaultLogger.InsertLog(Nop.Core.Domain.Logging.LogLevel, System.String, System.String, Nop.Core.Domain.Customers.Customer) at Nop.Services.Logging.LoggingExtensions.FilteredLog(Nop.Services.Logging.ILogger, Nop.Core.Domain.Logging.LogLevel, System.String, System.Exception, Nop.Core.Domain.Customers.Customer) at Nop.Services.Tasks.TaskThread.Run() at Nop.Services.Tasks.TaskThread.TimerHandler(System.Object) at System.Threading.TimerQueueTimer.CallCallbackInContext(System.Object) at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) at System.Threading.TimerQueueTimer.CallCallback() at System.Threading.TimerQueueTimer.Fire() at System.Threading.TimerQueue.FireQueuedTimerCompletion(System.Object) at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem() at System.Threading.ThreadPoolWorkQueue.Dispatch() at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()


Does anybody know what to do?

Thank you for your answers.
5 years ago
Yes it is Trying to Open connection. But cant able to connect properly.

Can you try to login manually in your sql server and check everything seems ok ?

Thanks,
Jatin
5 years ago
Hello Jatin,

I am able to connect to the database and I don't see any issue.
I am seeing several different exceptions related to the database in my logs.

Regards,
Florent
5 years ago
Do you see any InnerException message with more details?
5 years ago
Hello New York,

Unfortunately, I don't. :/
5 years ago
Is your database server in the same facility as the web server?
Are you using any 3rd party or custom plugins, etc.?
5 years ago
New York wrote:
Is your database server in the same facility as the web server?
Are you using any 3rd party or custom plugins, etc.?


- Yes it is.
- Yes I am using both. The issue seems to happen after one of my plugins has been called. I used the tutorial to interact with a database. I don't think I have forgotten to code something though.
5 years ago
Are you using any type of threading or scheduled task to run something?
5 years ago
New York wrote:
Are you using any type of threading or scheduled task to run something?


No I am not doing anything like that.
The only scheduled task that is not by default is "Customer Reminders Task" from Nop-Templates.
https://www.nop-templates.com/customer-reminders-plugin-for-nopcommerce
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.