Exceptions has been thrown by target of an invocation

Hello,
Did not changed anything but since this evening, i am getting error and POS is not working.


[General Info]

Application: SambaPOS
Version: 5.1.60
Region: en
DB: SQ
Machine: LAPTOP-EAJLH2LT
User: SPR
Date: 3/4/2017
Time: 10:46 PM

User Explanation:

SPR said “”

[Exception Info 1]

Top-level Exception
Type: System.Reflection.TargetInvocationException
Message: Exception has been thrown by the target of an invocation.
Source: mscorlib
Stack Trace: at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Delegate.DynamicInvokeImpl(Object[] args)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

Inner Exception 1
Type: System.Data.Entity.Infrastructure.RetryLimitExceededException
Message: Maximum number of retries (5) exceeded while executing database operations with ‘SambaExeuctionStrategy’. See inner exception for the most recent failure.
Source: EntityFramework
Stack Trace: at System.Data.Entity.Infrastructure.DbExecutionStrategy.Execute[TResult](Func1 operation) at System.Data.Entity.Core.Objects.ObjectQuery1.GetResults(Nullable1 forMergeOption) at System.Data.Entity.Core.Objects.ObjectQuery1.<System.Collections.Generic.IEnumerable.GetEnumerator>b__0()
at System.Data.Entity.Internal.LazyEnumerator1.MoveNext() at System.Collections.Generic.List1…ctor(IEnumerable1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source)
at Samba.Persistance.Data.Dao.Query[T](Expression1[] includes) at Samba.Persistance.Implementations.CacheDao.GetRules() at Samba.Services.Implementations.CacheService.get_Rules() at Samba.Services.Implementations.CacheService.GetAppRules(String eventName, Int32 terminalId, Int32 departmentId, Int32 userRoleId, Int32 ticketTypeId) at Samba.Services.Implementations.AutomationModule.RuleExecutor.GetActionGroups(Object dataParameter, Object logToken) at Samba.Services.Implementations.AutomationModule.RuleExecutor.ExecuteWithoutLogging(Object dataParameter, Action1 dataAction)
at Samba.Services.Implementations.AutomationModule.RuleExecutor.ExecuteWith(Object dataParameter, Action1 dataAction) at Samba.Services.Implementations.AutomationModule.NotificationService.NotifyEvent(String eventName, Object dataParameter, Int32 terminalId, Int32 departmentId, Int32 userRoleId, Int32 ticketTypeId, Action1 dataAction)
at Samba.Presentation.Services.Implementations.AutomationModule.NotificationClient.NotifyEvent(String eventName, Object dataObject)
at Samba.Modules.NavigationModule.NavigationModule.<.ctor>b__7_2(EventParameters1 x) at Microsoft.Practices.Prism.Events.EventSubscription1.InvokeAction(Action1 action, TPayload argument) at Microsoft.Practices.Prism.Events.EventSubscription1.<>c__DisplayClass2.b__0(Object[] arguments)
at Microsoft.Practices.Prism.Events.EventBase.InternalPublish(Object[] arguments)
at Microsoft.Practices.Prism.Events.CompositePresentationEvent`1.Publish(TPayload payload)
at Samba.Presentation.Services.Common.ExtensionMethods.Publish[TEventsubject](TEventsubject eventArgs, String eventTopic, Action expectedAction)

Inner Exception 2
Type: System.Data.Entity.Core.EntityCommandExecutionException
Message: An error occurred while executing the command definition. See the inner exception for details.
Source: EntityFramework
Stack Trace: at System.Data.Entity.Core.EntityClient.Internal.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior)
at System.Data.Entity.Core.Objects.Internal.ObjectQueryExecutionPlan.Execute[TResultType](ObjectContext context, ObjectParameterCollection parameterValues)
at System.Data.Entity.Core.Objects.ObjectQuery1.<>c__DisplayClass7.<GetResults>b__6() at System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T](Func1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess)
at System.Data.Entity.Core.Objects.ObjectQuery1.<>c__DisplayClass7.<GetResults>b__5() at System.Data.Entity.Infrastructure.DbExecutionStrategy.Execute[TResult](Func1 operation)

Inner Exception 3
Type: System.Data.SqlClient.SqlException
Message: Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
Source: .Net SqlClient Data Provider
Stack Trace: at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) at System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior) at System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.<Reader>b__c(DbCommand t, DbCommandInterceptionContext1 c)
at System.Data.Entity.Infrastructure.Interception.InternalDispatcher1.Dispatch[TTarget,TInterceptionContext,TResult](TTarget target, Func3 operation, TInterceptionContext interceptionContext, Action3 executing, Action3 executed)
at System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.Reader(DbCommand command, DbCommandInterceptionContext interceptionContext)
at System.Data.Entity.Internal.InterceptableDbCommand.ExecuteDbDataReader(CommandBehavior behavior)
at System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior)
at System.Data.Entity.Core.EntityClient.Internal.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior)

Inner Exception 4
Type: System.ComponentModel.Win32Exception
Message: The wait operation timed out
Source:


[Assembly Info]

mscorlib, Version=4.0.0.0
Samba.Services, Version=1.0.0.0
Samba.Domain, Version=1.0.0.0
Samba.Infrastructure.Data, Version=1.0.0.0
System.ComponentModel.Composition, Version=4.0.0.0
System.Core, Version=4.0.0.0
PresentationCore, Version=4.0.0.0
DevExpress.Xpf.LayoutControl.v14.1, Version=14.1.13.0
System.Xml, Version=4.0.0.0
DevExpress.Xpf.Grid.v14.1, Version=14.1.13.0
System, Version=4.0.0.0
DevExpress.Xpf.Grid.v14.1.Core, Version=14.1.13.0
WindowsBase, Version=4.0.0.0
System.Xaml, Version=4.0.0.0
PresentationFramework, Version=4.0.0.0
Samba.Infrastructure, Version=1.0.0.0
Microsoft.Practices.Prism, Version=4.0.0.0
System.Runtime.Serialization, Version=4.0.0.0
Microsoft.Practices.Prism.MefExtensions, Version=4.0.0.0
DevExpress.Xpf.Core.v14.1, Version=14.1.13.0
Samba.Presentation.Services, Version=1.0.0.0
System.Windows.Forms, Version=4.0.0.0
System.Drawing, Version=4.0.0.0
Stateless, Version=1.0.0.0
Samba.Persistance, Version=1.0.0.0
PropertyTools, Version=2012.4.14.1
Samba.Localization, Version=1.0.0.0
ReachFramework, Version=4.0.0.0
EntityFramework, Version=6.0.0.0
FluentValidation, Version=3.4.0.0
Omu.ValueInjecter, Version=2.3.0.0
Microsoft.Practices.ServiceLocation, Version=1.0.0.0
Microsoft.CSharp, Version=4.0.0.0


[System Info]

Operating System
-Microsoft Windows 10 Home Single Language
–CodeSet = 1252
–CSDVersion =
–CurrentTimeZone = 240
–FreePhysicalMemory = 2304244
–OSArchitecture = 64-bit
–OSLanguage = 1033
–ServicePackMajorVersion = 0
–ServicePackMinorVersion = 0
–Version = 10.0.14393

Machine
-LAPTOP-EAJLH2LT
–Manufacturer = TOSHIBA
–Model = Satellite C50t-B
–TotalPhysicalMemory = 4205207552
–UserName = LAPTOP-EAJLH2LT\SPR


Message: Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding.

SambaPOS can not connect to your database. Check to be sure your database is working.

1 Like

Inner Exception 3
Type: System.Data.SqlClient.SqlException
Message: Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
Source: .Net SqlClient Data Provider

Looks like the SQL DB Engine Service is not running.

What were you attempting to do when you got that error?

1 Like

Famous last words :stuck_out_tongue: By anything I assume you were referring to SambaPOS but did you change anything on the computer that would cause the database to not start?

No did not changed anything on the computer, it happened while POS was running. I even checked no updates installed by windows.

Could be a network issue.
Is the SQL hosting machine also a terminal?
If works on machine with SQL then likely network/firewall issue. If all machines more likely an SQL issue.

No its working on same machine, and i have just one machine running SAMBA POS

How do i check it. I opened Database in SQL Server Studio Management and it shows database there

Now, I am getting following in LOG:
I am able to open database in MS Server Management Studio, it says recover pending infront of SAMBAPOS (screenshort attached). I checked sambasetting.txt for connection string but the file does not exist. What should I do to make it work.


[General Info]

Application: SambaPOS
Version: 5.1.60
Region: en
DB: SQ
Machine: LAPTOP-EAJLH2LT
User: SPR
Date: 3/5/2017
Time: 12:48 PM

User Explanation:

SPR said “”

[Exception Info 1]

Top-level Exception
Type: System.Data.DataException
Message: An exception occurred while initializing the database. See the InnerException for details.
Source: EntityFramework
Stack Trace: at System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action)
at System.Data.Entity.Internal.InternalContext.PerformDatabaseInitialization()
at System.Data.Entity.Internal.LazyInternalContext.b__4(InternalContext c)
at System.Data.Entity.Internal.RetryAction1.PerformAction(TInput input) at System.Data.Entity.Internal.LazyInternalContext.InitializeDatabaseAction(Action1 action)
at System.Data.Entity.Internal.LazyInternalContext.InitializeDatabase()
at System.Data.Entity.Internal.InternalContext.ForceOSpaceLoadingForKnownEntityTypes()
at System.Data.Entity.DbContext.System.Data.Entity.Infrastructure.IObjectContextAdapter.get_ObjectContext()
at Samba.Persistance.Data.WorkspaceFactory.CreateReadOnly()
at Samba.Persistance.Data.Dao.CountT
at Samba.Presentation.Services.Common.DataGeneration.DataCreationService.ShouldCreateData()
at Samba.Presentation.Services.Common.DataGeneration.DataCreationService.CreateData()
at Samba.Presentation.Bootstrapper.InitializeShell()

Inner Exception 1
Type: System.Data.Entity.Core.EntityException
Message: The underlying provider failed on Open.
Source: EntityFramework
Stack Trace: at System.Data.Entity.Core.EntityClient.EntityConnection.Open()
at System.Data.Entity.Core.Objects.ObjectContext.EnsureConnection(Boolean shouldMonitorTransactions)
at System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T](Func1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess) at System.Data.Entity.Core.Objects.ObjectContext.<>c__DisplayClass651.b__63()
at System.Data.Entity.Infrastructure.DbExecutionStrategy.Execute[TResult](Func1 operation) at System.Data.Entity.Core.Objects.ObjectContext.ExecuteStoreQueryReliably[TElement](String commandText, String entitySetName, ExecutionOptions executionOptions, Object[] parameters) at System.Data.Entity.Core.Objects.ObjectContext.ExecuteStoreQuery[TElement](String commandText, Object[] parameters) at Samba.Persistance.Data.Initializer.InitializeDatabase(DataContext context) at System.Data.Entity.Internal.InternalContext.<>c__DisplayClassf1.b__e()
at System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action)

Inner Exception 2
Type: System.Data.SqlClient.SqlException
Message: Cannot open database “SambaPOS5” requested by the login. The login failed.
Login failed for user ‘LAPTOP-EAJLH2LT\SPR’.
Source: .Net SqlClient Data Provider
Stack Trace: at System.Data.SqlClient.SqlInternalConnectionTds…ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, DbConnectionPool pool, String accessToken, Boolean applyTransientFaultHandling)
at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions)
at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource1 retry, DbConnectionOptions userOptions) at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource1 retry, DbConnectionOptions userOptions)
at System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource1 retry) at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource1 retry)
at System.Data.SqlClient.SqlConnection.Open()
at System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.b__36(DbConnection t, DbConnectionInterceptionContext c)
at System.Data.Entity.Infrastructure.Interception.InternalDispatcher1.Dispatch[TTarget,TInterceptionContext](TTarget target, Action2 operation, TInterceptionContext interceptionContext, Action3 executing, Action3 executed)
at System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.Open(DbConnection connection, DbInterceptionContext interceptionContext)
at System.Data.Entity.Core.EntityClient.EntityConnection.b__2()
at System.Data.Entity.Infrastructure.DbExecutionStrategy.<>c__DisplayClass1.b__0()
at System.Data.Entity.Infrastructure.DbExecutionStrategy.Execute[TResult](Func`1 operation)
at System.Data.Entity.Infrastructure.DbExecutionStrategy.Execute(Action operation)
at System.Data.Entity.Core.EntityClient.EntityConnection.Open()


[Assembly Info]

mscorlib, Version=4.0.0.0
PresentationFramework, Version=4.0.0.0
PresentationCore, Version=4.0.0.0
System, Version=4.0.0.0
WindowsBase, Version=4.0.0.0
System.ComponentModel.Composition, Version=4.0.0.0
System.Configuration, Version=4.0.0.0
System.Xaml, Version=4.0.0.0
Samba.Services, Version=1.0.0.0
Microsoft.Practices.Prism.MefExtensions, Version=4.0.0.0
Samba.Presentation.Services, Version=1.0.0.0
Samba.Presentation.Common, Version=1.0.0.0
Samba.Domain, Version=1.0.0.0
Microsoft.Practices.Prism, Version=4.0.0.0
System.Core, Version=4.0.0.0
Samba.Infrastructure, Version=1.0.0.0
DevExpress.Xpf.Core.v14.1, Version=14.1.13.0
Microsoft.Practices.ServiceLocation, Version=1.0.0.0
Samba.Localization, Version=1.0.0.0
FastButton, Version=1.0.0.0
Samba.Persistance, Version=1.0.0.0


[System Info]

Operating System
-Microsoft Windows 10 Home Single Language
–CodeSet = 1252
–CSDVersion =
–CurrentTimeZone = 240
–FreePhysicalMemory = 2299508
–OSArchitecture = 64-bit
–OSLanguage = 1033
–ServicePackMajorVersion = 0
–ServicePackMinorVersion = 0
–Version = 10.0.14393

Machine
-LAPTOP-EAJLH2LT
–Manufacturer = TOSHIBA
–Model = Satellite C50t-B
–TotalPhysicalMemory = 4205207552
–UserName = LAPTOP-EAJLH2LT\SPR


######################### E N D #########################

Looks like your database got corrupted somehow. Google SQl recovery pending it has lots of things you can try to save the database.

Btw according to your screenshot you were NOT able to open the database. You can connect to the instance but database is not accessible which is causing the Sambapos error.

Inner Exception 2
Type: System.Data.SqlClient.SqlException
Message: Cannot open database “SambaPOS5” requested by the login. The login failed.
Login failed for user ‘LAPTOP-EAJLH2LT\SPR’.
Source: .Net SqlClient Data Provider

Your security permissions on the DB are preventing connection to the DB.

Nothing is working.
How do i completely install new SambaPOS on same machine and restore from the backup files? Its very critical my restaurant system is completely down.

Did you Google the issue like I asked? Your database is corrupt. Look at Google there are tons of things to try and recover your database. It’s not a Sambapos issue it’s a SQL database issue.

PS if you have a backup you can restore it in MSSMS into a new database if you can’t get the one that’s in recovery mode working.

Btw typically what causes this corruption is power outage or improperly shutting a pc down. It can also indicate drive failure if it can’t access the drive the mdf and log file are on.

I had recovery pending it’s fairly simple fix.

Find the mdf and info file and copy it to another folder

Import as a new database

It fixes it as it imports it