[RESOLVED] SambaPOS 4.1.41 crashes

Hi @emre

I am currently running SambaPOS 4.1.41 and it is crashing when I click Program Setting under Settings. It seems to be related to my MS SQL Express 2012.

Troubleshooting so far:

  1. Uninstalled SambaPOS and deleted all folders related to SambaPOS.
  2. Installed SambaPOS without attaching SQL database and Program Setting does not crash SambaPOS
  3. Added Data Connection String and SambaPOS crashes when I click Manage–>Settings–>Program Settings.

Below is the crash report.

Any assistance you can provide is greatly appreciated.

-----------------------------
[General Info]

Application: SambaPOS
Version:     4.1.41
Region:      en
DB:          SQ
Machine:     BAR
User:        User2
Date:        7/23/2014
Time:        6:39 PM

User Explanation:

User2 said ""
-----------------------------

[Exception Info 1]

Top-level Exception
Type:        System.MissingMethodException
Message:     No parameterless constructor defined for this object.
Source:      mscorlib
Stack Trace: at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
   at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
   at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
   at System.Activator.CreateInstance[T]()
   at Samba.Presentation.Common.ObjectCache.Activate[TView]()
   at Samba.Presentation.Common.ModuleBase.OnExecute[TView](TView obj)
   at Microsoft.Practices.Prism.Commands.DelegateCommand`1.<>c__DisplayClass6.<.ctor>b__2(Object o)
   at Microsoft.Practices.Prism.Commands.DelegateCommandBase.Execute(Object parameter)
   at Microsoft.Practices.Prism.Commands.DelegateCommandBase.System.Windows.Input.ICommand.Execute(Object parameter)
   at MS.Internal.Commands.CommandHelpers.CriticalExecuteCommandSource(ICommandSource commandSource, Boolean userInitiated)
   at System.Windows.Controls.Primitives.ButtonBase.OnClick()
   at System.Windows.Controls.Button.OnClick()
   at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
   at System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)
   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
   at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
   at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
   at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.Run()
   at System.Windows.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.RunInternal(Window window)
   at System.Windows.Application.Run(Window window)
   at Samba.Presentation.App.Main()

-----------------------------

[Assembly Info]

Samba.Services, Version=1.0.0.0
mscorlib, Version=4.0.0.0
System, Version=4.0.0.0
Microsoft.Practices.Prism, Version=4.0.0.0
WindowsBase, Version=4.0.0.0
Samba.Infrastructure, Version=1.0.0.0
Samba.Infrastructure.Data, Version=1.0.0.0
PresentationFramework, Version=4.0.0.0
System.Xaml, Version=4.0.0.0
Samba.Presentation.Services, Version=1.0.0.0
FluentValidation, Version=3.4.0.0
Samba.Domain, Version=1.0.0.0
DevExpress.Xpf.Grid.v14.1, Version=14.1.5.0
PresentationCore, Version=4.0.0.0
Stateless, Version=1.0.0.0
System.Core, Version=4.0.0.0
System.Drawing, Version=4.0.0.0
System.Windows.Forms, Version=4.0.0.0
System.ComponentModel.Composition, Version=4.0.0.0
Samba.Localization, Version=1.0.0.0
Microsoft.CSharp, Version=4.0.0.0
DevExpress.Xpf.Grid.v14.1.Core, Version=14.1.5.0
Microsoft.Practices.ServiceLocation, Version=1.0.0.0
Samba.Persistance, Version=1.0.0.0
Microsoft.Practices.Prism.MefExtensions, Version=4.0.0.0
DevExpress.Xpf.Core.v14.1, Version=14.1.5.0
PropertyTools, Version=2012.4.14.1

-----------------------------

[System Info]

Operating System
-Microsoft Windows 8.1
--CodeSet = 1252
--CSDVersion = 
--CurrentTimeZone = -300
--FreePhysicalMemory = 2539440
--OSArchitecture = 64-bit
--OSLanguage = 1033
--ServicePackMajorVersion = 0
--ServicePackMinorVersion = 0
--Version = 6.3.9600

Machine
-BAR
--Manufacturer = Dell Inc.
--Model = Inspiron One 2020
--TotalPhysicalMemory = 4178911232
--UserName = BAR\User2

-----------------------------

Additional troubleshooting.

I am unable to clear transactions using this script. It worked perfect SambaPOS 4.1.40 and prior. DeleteTransactions.zip (831 Bytes)

Below is the error message after running DeleteTransactions.sql.

Msg 208, Level 16, State 1, Line 1
Invalid object name ‘TicketEntities’.
Msg 208, Level 16, State 1, Line 2
Invalid object name ‘Tickets’.
Msg 208, Level 16, State 1, Line 2
Invalid object name ‘AccountTransactionDocuments’.
Msg 208, Level 16, State 1, Line 2
Invalid object name ‘AccountTransactions’.
Msg 208, Level 16, State 1, Line 2
Invalid object name ‘AccountTransactionValues’.
Msg 208, Level 16, State 1, Line 2
Invalid object name ‘Calculations’.
Msg 208, Level 16, State 1, Line 2
Invalid object name ‘CostItems’.
Msg 208, Level 16, State 1, Line 2
Invalid object name ‘InventoryTransactionDocuments’.
Msg 208, Level 16, State 1, Line 2
Invalid object name ‘InventoryTransactions’.
Msg 208, Level 16, State 1, Line 2
Invalid object name ‘Orders’.
Msg 208, Level 16, State 1, Line 2
Invalid object name ‘PaidItems’.
Msg 208, Level 16, State 1, Line 2
Invalid object name ‘PeriodicConsumptionItems’.
Msg 208, Level 16, State 1, Line 2
Invalid object name ‘PeriodicConsumptions’.
Msg 208, Level 16, State 1, Line 2
Invalid object name ‘ProductTimerValues’.
Msg 208, Level 16, State 1, Line 2
Invalid object name ‘Payments’.
Msg 208, Level 16, State 1, Line 2
Invalid object name ‘WarehouseConsumptions’.
Msg 208, Level 16, State 1, Line 2
Invalid object name ‘WorkPeriods’.
Msg 208, Level 16, State 1, Line 2
Invalid object name ‘Numerators’.
Msg 208, Level 16, State 1, Line 2
Invalid object name ‘EntityStateValues’.

Thanks in advance for all your assistance.

It sounds like you either did not put the correct string to your server or something is wrong with your sql install. The second part about the script not working is because your running it in the wrong database it cannot find the tables.

Both issues are not because of SambaPOS. Why it would crash if you entered wrong database might be something he could look at, but to fix your problem your going to have to fix your sql install or make 100% sure you have the right string entered.

I can not reproduce the issue. I agree with @Jesse

The errors reported by the script mean it can’t find the tables in the database. That script should also have this line at the very top of it, so it knows which DB to execute on:

USE [SambaPOS4]

Does the Database exist?

What does your connection string look like? Are you pointing to the correct database?

Data Source=localhost\sqlexpress; User Id=sa; Password=sambapos; Database=SambaPOS4;

The connection string is stored in one of the following following locations:

C:\Users\<USERNAME>\AppData\Roaming\SambaPOS\SambaPOS4\SambaSettings.txt

or sometimes here:

C:\ProgramData\SambaPOS\SambaPOS4\SambaSettings.txt

you will find it in that file like this:

<ConnectionString>Data Source=localhost\sqlexpress; User Id=sa; Password=sambapos; Database=SambaPOS4; </ConnectionString>

It looks like it can connect database but can not find tables. Do you have management studio? Can you connect database and see tables?

@Jesse, @QMcKay, @emre,

Thank you for pointing me in the right direction regarding DeletingTransactions.sql. This issue is resolved. I was running the sql script without selecting my SAMBAPOS database first. I am still new and learning SQL Server Management.

@emre,

SambaPOS 4.1.41 crashing still remains an issue when click Program Settings. I have 4 POS terminals connected to the same database and they all crash when I click Program Settings. I don’t recall SambaPOS 4.1.38 crashing on Program Settings.

Thank you,

Can you please PM me a zip file of your database backup? Thanks.

It may be helpful to post the text found in SambaSettings.txt as well.

This is probably related with an invalid entry in program settings that we store on database.

SambaSettings.zip (644 Bytes)
@QMcKay

Above is SambaSettings file. Thanks again.

@emreeren

PM sent.

So your SQL Instance Name is SAMBAPOS on computer MAINPOS, and the DB is also named SAMBAPOS …

<ConnectionString>Data Source=MAINPOS\SAMBAPOS; User Id=sa; Password=RemovedPassword; Database=SAMBAPOS;</ConnectionString>

The default instance name is SQLEXPRESS, but of course you may have changed that during SQL Server setup.

I’ll let @emre take it from here, since I see there is another user reporting crashes with 4.1.41.

Execute this SQL Script for quick fix.

Delete from ProgramSettingValues where Name = 'PaymentScreenValues'

Did you changed Program Settings before that problem started?

@QMcKay

Database is connected properly. I can enter a ticket from one terminal and it shows on the other terminal properly.

Thanks for your assistance.

@emre

You are a genius!!!. Running the above script fixed the issue.

I did not make any changes to Program Settings before error started.

OK. Thank you very much for reporting. On next release I’ll improve that to prevent it happen again.

1 Like