Sambapos crashes when taking big order, What's wrong ?:(

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.NullReferenceException
Message: Object reference not set to an instance of an object.
Source: Samba.Services
Stack Trace: at Samba.Services.Implementations.CacheService.<>c__DisplayClass38_0.b__1(MenuItemPortion x) in C:\Users\vehbi\Source\Repos\sambapos-v5-pro\Samba.Services\Implementations\CacheService.cs:line 131
at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable1 source, Func2 predicate)
at Samba.Services.Implementations.CacheService.GetMenuItemPortion(Int32 menuItemId, String portionName) in C:\Users\vehbi\Source\Repos\sambapos-v5-pro\Samba.Services\Implementations\CacheService.cs:line 131
at Samba.Services.Implementations.TicketModule.TicketServiceBase.AddOrder(Ticket ticket, MenuItem menuItem, Nullable1 quantity, Boolean enforceQuantity, String portionName, String orderState, String orderTagJson, AppState appState, Nullable1 price) in C:\Users\vehbi\Source\Repos\sambapos-v5-pro\Samba.Services\Implementations\TicketModule\TicketServiceBase.cs:line 178
at Samba.Presentation.Services.Implementations.TicketModule.TicketService.AddOrder(Ticket ticket, Int32 menuItemId, Nullable1 quantity, Boolean enforceQuantity, String portionName, String orderState, String orderTagJson) at Samba.Presentation.ClientLibrary.Modules.PosModule.TicketOrdersViewModel.AddOrder(Int32 menuItemId, Nullable1 quantity, Boolean enforceQuantity, String portionName) in C:\Users\vehbi\Source\Repos\sambapos-v5-pro\Samba.Presentation.ClientLibrary\Modules\PosModule\TicketOrdersViewModel.cs:line 209
at Samba.Presentation.ClientLibrary.Modules.PosModule.TicketOrdersViewModel.AddOrder(ScreenMenuItemData data) in C:\Users\vehbi\Source\Repos\sambapos-v5-pro\Samba.Presentation.ClientLibrary\Modules\PosModule\TicketOrdersViewModel.cs:line 216
at Samba.Presentation.ClientLibrary.Modules.PosModule.PosViewModel.OnMenuItemSelected(EventParameters1 obj) in C:\Users\vehbi\Source\Repos\sambapos-v5-pro\Samba.Presentation.ClientLibrary\Modules\PosModule\PosViewModel.cs:line 484 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)

I am not sure if I am reading this correctly but do you have 0 priced items or 0 quantity for one of the products?

0 price should be ok, I do it although does need allowing in ticket type but sure it is handled if not enabled.
However never seen or tried 0 qty so that sounds more likely cause.

This is the order, I cant find any zero quantity order in this list

There is also mention to portion name.
Can you check the products on ticket and their portion names.

Show your product for that menu item we need to see the portion. Looks like you may not have a portion defined correctly.

Does this happen as you press buttons for products or does it happen after your press one of the buttons like Close, Cancel All, Abort Ticket etc.?

Jesse could it be + in the product name depending on his regional formatting settings?

Its happening when taking long order. This name and everything was okay . Some fire happened recently I had to change the system and restored the backup. After restoring this thing started.

See , same items if I take as seperate order no issue at all

What if you do 2 orders?

It will be sent to the kitchen with out any issue

any solutions? Please help me to fix it

The message is pretty vaige so its hard to give you much of a sugestion without seeing more of your system.

It’s something with your setup. I can make very large orders in Sambapos all day and it does not crash. So we can’t really help you if we can’t see what mistake you have in your configuration. Help us help you and share more information we can go on.

Or email

What versions of SambaPOS are you using before and after?

You can show it by double clicking the upper left corner where the apple is. SambaPOS will go into windowed mode and you can see the version no. Please post the screen captures.

Not exactly like you case but I did run into incompatibility issues once a while when restoring from system with different versions of SambaPOS and SQL servers installed.

1 Like