SambaPOS Crashing Live

Sambapos crashes whenever I try to pay and close a ticket. I’m not sure what’s causing it. I did not touch any Rules. I was testing out the demo for GOKiosk when this happened.


[General Info]

Application: SambaPOS
Version: 5.2.26
Region: en
Machine: DESKTOP-HAB492E
User: K&L Employee
Date: 1/9/2020
Time: 7:27 PM

User Explanation:

K&L Employee 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.DbUpdateException
Message: An error occurred while saving entities that do not expose foreign key properties for their relationships. The EntityEntries property will return null because a single entity cannot be identified as the source of the exception. Handling of exceptions while saving can be made easier by exposing foreign key properties in your entity types. See the InnerException for details.
Source: EntityFramework
Stack Trace: at System.Data.Entity.Internal.InternalContext.SaveChanges()
at System.Data.Entity.Internal.LazyInternalContext.SaveChanges()
at System.Data.Entity.DbContext.SaveChanges()
at Samba.Infrastructure.Data.SqlData.EFWorkspace.CommitChanges()
at Samba.Persistance.Data.CachedDao.CacheSave[T](T entity)
at Samba.Persistance.Data.Dao.Save[T](T entity)
at Samba.Persistance.Implementations.TicketDao.Save(Ticket ticket)
at Samba.Services.Implementations.TicketModule.TicketServiceBase.SaveTicket(Ticket ticket, TicketType ticketType) in C:\Users\vehbi\Source\Repos\sambapos-v5-pro\Samba.Services\Implementations\TicketModule\TicketServiceBase.cs:line 154
at Samba.Services.Implementations.TicketModule.TicketServiceBase.SubmitTicket(Ticket ticket, TicketType ticketType, AppState appState) in C:\Users\vehbi\Source\Repos\sambapos-v5-pro\Samba.Services\Implementations\TicketModule\TicketServiceBase.cs:line 596
at Samba.Services.Implementations.TicketModule.TicketServiceBase.CloseTicket(Ticket ticket, AppState appState) in C:\Users\vehbi\Source\Repos\sambapos-v5-pro\Samba.Services\Implementations\TicketModule\TicketServiceBase.cs:line 628
at Samba.Presentation.Services.Implementations.TicketModule.TicketService.CloseTicket(Ticket ticket)
at Samba.Presentation.ClientLibrary.Modules.PosModule.PosViewModel.CloseTicket() in C:\Users\vehbi\Source\Repos\sambapos-v5-pro\Samba.Presentation.ClientLibrary\Modules\PosModule\PosViewModel.cs:line 707
at Samba.Presentation.ClientLibrary.Modules.PosModule.PosViewModel.OnTicketEvent(EventParameters1 obj) in C:\Users\vehbi\Source\Repos\sambapos-v5-pro\Samba.Presentation.ClientLibrary\Modules\PosModule\PosViewModel.cs:line 529 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.UpdateException
Message: An error occurred while updating the entries. See the inner exception for details.
Source: EntityFramework
Stack Trace: at System.Data.Entity.Core.Mapping.Update.Internal.UpdateTranslator.Update()
at System.Data.Entity.Core.EntityClient.Internal.EntityAdapter.b__2(UpdateTranslator ut)
at System.Data.Entity.Core.EntityClient.Internal.EntityAdapter.Update[T](T noChangesResult, Func2 updateFunction) at System.Data.Entity.Core.EntityClient.Internal.EntityAdapter.Update() at System.Data.Entity.Core.Objects.ObjectContext.<SaveChangesToStore>b__35() at System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T](Func1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess)
at System.Data.Entity.Core.Objects.ObjectContext.SaveChangesToStore(SaveOptions options, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction)
at System.Data.Entity.Core.Objects.ObjectContext.<>c__DisplayClass2a.b__27()
at System.Data.Entity.Infrastructure.DbExecutionStrategy.Execute[TResult](Func`1 operation)
at System.Data.Entity.Core.Objects.ObjectContext.SaveChangesInternal(SaveOptions options, Boolean executeInExistingTransaction)
at System.Data.Entity.Core.Objects.ObjectContext.SaveChanges(SaveOptions options)
at System.Data.Entity.Internal.InternalContext.SaveChanges()

Inner Exception 3
Type: System.Data.SqlClient.SqlException
Message: Could not allocate space for object ‘dbo.Tickets’.‘IX_Tickets_TicketId’ in database ‘sqlexpress’ because the ‘PRIMARY’ filegroup is full. Create disk space by deleting unneeded files, dropping objects in the filegroup, adding additional files to the filegroup, or setting autogrowth on for existing files in the filegroup.
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, Boolean shouldCacheForAlwaysEncrypted)
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.Mapping.Update.Internal.DynamicUpdateCommand.Execute(Dictionary2 identifierValues, List1 generatedValues)
at System.Data.Entity.Core.Mapping.Update.Internal.UpdateTranslator.Update()

[Assembly Info]

mscorlib, Version=
System, Version=
Samba.Services, Version=
Samba.Domain, Version=
Samba.Infrastructure.Data, Version=
System.ComponentModel.Composition, Version=
Samba.Presentation.Services, Version=
System.Core, Version=
PresentationCore, Version=
WindowsBase, Version=
PresentationFramework, Version=
DevExpress.Xpf.LayoutControl.v16.2, Version=
System.Xml, Version=
DevExpress.Xpf.Grid.v16.2, Version=
DevExpress.Xpf.Grid.v16.2.Core, Version=
System.Xaml, Version=
Samba.Infrastructure, Version=
Microsoft.Practices.Prism, Version=
System.Runtime.Serialization, Version=
Microsoft.Practices.Prism.MefExtensions, Version=
DevExpress.Xpf.Core.v16.2, Version=
System.Windows.Forms, Version=
System.Drawing, Version=
Samba.Persistance, Version=
Stateless, Version=
PropertyTools, Version=2012.4.14.1
Samba.Localization, Version=
ReachFramework, Version=
EntityFramework, Version=
FluentValidation, Version=
NCalc, Version=
Microsoft.CSharp, Version=
Omu.ValueInjecter, Version=
Microsoft.Practices.ServiceLocation, Version=
DevExpress.Data.v16.2, Version=
WindowsInput, Version=

[System Info]

Operating System
-Microsoft Windows 10 Enterprise
–CodeSet = 1252
–CSDVersion =
–CurrentTimeZone = -300
–FreePhysicalMemory = 12104980
–OSArchitecture = 64-bit
–OSLanguage = 1033
–ServicePackMajorVersion = 0
–ServicePackMinorVersion = 0
–Version = 10.0.17763

–Manufacturer =
–Model =
–TotalPhysicalMemory = 17042657280
–UserName = DESKTOP-HAB492E\K&L Employee


Oh boy this again…

I dropped the “Tasks” Table, but what would happen if I drop other larger tables?
Can I drop the first half of the “Orders” Table? What bad things would happen?

I wouldnt drop orders, yet alone part table, asking for issues with references etc.
Personally id take a logical date like financial year end or stocktake and do a backup and clear all transactions. That way youstill have the historical data if needed.

Your system that is generating tasks is wrong. Something is configured wrong. You shouldn’t be running out of space like that.

You can fix whatever automation is generating the large tasks or upgrade to standard edition of SQL so you have more than 10gb. The best option is to fix whatever is generating the large tasks.

Or backup your database and clear all transactions. Start fresh, but you would still have your archived data.

SQL Server standard will run you around $1000 total after CALS I think… been a while since I Looked into it.

You are approaching the limit of 10gb regardless of tasks or not though. YOu may want to consider full sql or archiving the db like I mentioned.

These are the prices for Standard SQL, if I’m calculating the prices correctly. Purchasing SQL licensing is NOT an option for me or probably anyone who uses SambaPOS.

You wouldn’t need 7 Cal’s. But yes it’s expensive. Your best bet is to backup and clear transactions. But no there are plenty of locations using it. We will be installing it at some locations next month.

Even with SQL Server Standard the cost if owning and running Sambapos is fraction of most of our competitors.

That’s not USD is it…

You can find it cheaper at around $850sh and much less for a cal. But you wont need a CAL for every user. It only needs it for each terminal I believe. It may need just 1 I cant remember I would have to look into it.

1 Like

That is not a crazy amount. It is if your used to paying next to nothing for a POS. However I agree I wish we had a better option. But then again most people wouldnt need to worry about the 10gb limit. You can always just archive the database once a year and start fresh.

1 Like

I’ve never looked at price for full SQL but as you say, if your hitting 10GB it’s fairly substantial setup and cost is relative.
I’ve got into habit of archiving and clearing hotel DB anyway for performance reasons on some of the report based automation.

I have 7 terminals (including the server computer) so I would need 7 CALs.

Please let me know how much it costs after you’re done.

For me, a person making a living in US, it’s not going to be the end of the world. But frequenting the forums, I see a lot of users from many different countries, countries with a national average income that’s just a fraction of what a teenager makes working at a Walmart for a month.
It may not happen this year or next year or even this decade, but when users’ databases eventually start to max out, it won’t be pretty.

How would I do this? Keeping all Entity Screens, Rules, etc. and at least keeping 1 year’s worth of transactions.

Start fresh, it wouldn’t keep 1 year in samba. Clear transactions script clears all transaction data leaving all setup data, products entities etc untouched.
Make a backup before so you have the data for safekeeping is ever needed.

@rightguys you have an issue with Tasks, it’s been seen before and I saw it myself on your DB. You never properly resolved that issue, that is why you will always have these issues coming up until you resolve the underlying issue.

If I remember, you had an old disabled kitchen screen that was still generating tasks.

1 Like

It’s been resolved a while ago. You can test it out, if you still have my db.
But even with the Tasks table dropped, the size of my db is just under 8 GBs (with under 5 years of use).

Ok. Sounds simple.

Whats you use by table on the DB?
The hotel here peaked before i cleared out history with aprox 250k tickets, while I cant remember actual DB size the backups peaked at around 300-350MB.
But there is no tasks useage wich does to to mount up quickly for those using it extensively.
I started cleaing out DB and archiving every 3-4 months after a stocktake as some of my entity screens were using report ticket details which is not a WP specific expression meaning it was querying whole DB for each entity which causes slow loading of entity screen. Clearing DB out every few months helped this however when I get time I would look at changing the reporting expressions to maybe find an alternative which was less incentive.

Post #3 in this thread.

1 Like