[RESOLVED] Throwing exception on initializing for localsettings

the type initializer for local settings throwing exception.

received this error few days ago on different tablet
today receving the same error on cashier system
server is ok

how can i resolve this error and what could be the cause?

Delete sambasettings.txt and restart. Will need to reset your connection string after.

you mean to delete this file from system and tablet :
C:\ProgramData\SambaPOS\SambaPOS4\Settings.txt

i have experienced exact same error message on version 4.1.37

Locate SambaPOS4,Samba Data folder and then move the SamaSettings.txt file from Samba data folder (i.e place SamaSettings.txt file onto desktop) then run Sambapos4 again. this should load Sambapos4. Your will need to configure your settings again.

I have experienced this issue on my seconds POSt termail with Standard windows User Accounts, it did not affect the Administrator account.

PS; You only need to carry out above only on affected terminal.

It appears some how the SamaSettings.txt file got corrupted. if you open that file you will see its blank.

i will try and update once i reach cafe

@emre @morshed1 and @Jesse after deleting the sambasettings.txt i got the message for check database version.

after reinstalling the database i am gettung this message

and later this

copy sambasettings_backup.txt to sambasettings.txt.

i have replace the file but now when i open the sambapos it is giving the database connection string error

so opened the sambasettings.txt the connection string tag is empty

going to replace now…

If the backup file does not work see referenced quotes

i put the connection string but it was giving a connection string error…going look at it then will get back

@Jesse

i have double check the string but still receiveing error

here is the exception:

-----------------------------
[General Info]
Application: SambaPOS
Version:     4.1.81
Region:      en
DB:          SQ
Machine:     ALATURKA-PC
User:        Alaturka
Date:        2/16/2015
Time:        2:36 PM
User Explanation:
Alaturka 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.<InitializeDatabase>b__4(InternalContext c)
   at System.Data.Entity.Internal.RetryAction`1.PerformAction(TInput input)
   at System.Data.Entity.Internal.LazyInternalContext.InitializeDatabaseAction(Action`1 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.Infrastructure.Data.SqlData.EFWorkspace..ctor(CommonDbContext context)
   at Samba.Persistance.Data.WorkspaceFactory.Create()
   at Samba.Presentation.Services.Common.DataGeneration.DataCreationService..ctor()
   at Samba.Modules.SettingsModule.SettingsViewModel.ForceConnectionUpdate()
   at Samba.Modules.SettingsModule.SettingsView.ButtonInfo_Click(Object sender, RoutedEventArgs e)
   at DevExpress.Xpf.Editors.ButtonInfo.RaiseClickEvent(Object sender, RoutedEventArgs e)
   at DevExpress.Xpf.Editors.ButtonInfo.OnButtonClick(Object sender, RoutedEventArgs e)
   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.RaiseEvent(RoutedEventArgs e)
   at System.Windows.Controls.Primitives.ButtonBase.OnClick()
   at System.Windows.Controls.Button.OnClick()
   at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonDown(MouseButtonEventArgs e)
   at System.Windows.UIElement.OnMouseLeftButtonDownThunk(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.OnMouseDownThunk(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()
Inner Exception 1
Type:        System.Data.ProviderIncompatibleException
Message:     An error occurred while getting provider information from the database. This can be caused by Entity Framework using an incorrect connection string. Check the inner exceptions for details and ensure that the connection string is correct.
Source:      EntityFramework
Stack Trace: at System.Data.Entity.ModelConfiguration.Utilities.DbProviderServicesExtensions.GetProviderManifestTokenChecked(DbProviderServices providerServices, DbConnection connection)
   at System.Data.Entity.ModelConfiguration.Utilities.DbConnectionExtensions.GetProviderInfo(DbConnection connection, DbProviderManifest& providerManifest)
   at System.Data.Entity.DbModelBuilder.Build(DbConnection providerConnection)
   at System.Data.Entity.Infrastructure.EdmxWriter.WriteEdmx(DbContext context, XmlWriter writer)
   at System.Data.Entity.Migrations.Extensions.DbContextExtensions.<>c__DisplayClass1.<GetModel>b__0(XmlWriter w)
   at System.Data.Entity.Migrations.Extensions.DbContextExtensions.GetModel(Action`1 writeXml)
   at System.Data.Entity.Migrations.Extensions.DbContextExtensions.GetModel(DbContext context)
   at System.Data.Entity.Migrations.DbMigrator..ctor(DbMigrationsConfiguration configuration, DbContext usersContext)
   at System.Data.Entity.Internal.InternalContext.<CreateDatabase>b__0(DbMigrationsConfiguration config, DbContext context)
   at System.Data.Entity.Internal.DatabaseCreator.CreateDatabase(InternalContext internalContext, Func`3 createMigrator, ObjectContext objectContext)
   at System.Data.Entity.Internal.InternalContext.CreateDatabase(ObjectContext objectContext)
   at System.Data.Entity.Database.Create(Boolean skipExistsCheck)
   at Samba.Persistance.Data.Initializer.Create(CommonDbContext context)
   at Samba.Persistance.Data.Initializer.InitializeDatabase(DataContext context)
   at System.Data.Entity.Database.<>c__DisplayClass2`1.<SetInitializerInternal>b__0(DbContext c)
   at System.Data.Entity.Internal.InternalContext.<>c__DisplayClass8.<PerformDatabaseInitialization>b__6()
   at System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action)
Inner Exception 2
Type:        System.Data.ProviderIncompatibleException
Message:     The provider did not return a ProviderManifestToken string.
Source:      System.Data.Entity
Stack Trace: at System.Data.Common.DbProviderServices.GetProviderManifestToken(DbConnection connection)
   at System.Data.Entity.ModelConfiguration.Utilities.DbProviderServicesExtensions.GetProviderManifestTokenChecked(DbProviderServices providerServices, DbConnection connection)
Inner Exception 3
Type:        System.Data.SqlClient.SqlException
Message:     Login failed for user 'sa'.
Source:      .Net SqlClient Data Provider
Stack Trace: 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, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
   at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
   at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
   at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
   at System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)
   at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
   at System.Data.SqlClient.SqlConnection.Open()
   at System.Data.SqlClient.SqlProviderServices.UsingConnection(SqlConnection sqlConnection, Action`1 act)
   at System.Data.SqlClient.SqlProviderServices.UsingMasterConnection(SqlConnection sqlConnection, Action`1 act)
   at System.Data.SqlClient.SqlProviderServices.GetDbProviderManifestToken(DbConnection connection)
   at System.Data.Common.DbProviderServices.GetProviderManifestToken(DbConnection connection)
-----------------------------
[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.6.0
DevExpress.Xpf.Grid.v14.1.Core, Version=14.1.6.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
DevExpress.Xpf.Core.v14.1, Version=14.1.6.0
EntityFramework, Version=4.4.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
Microsoft.Practices.ServiceLocation, Version=1.0.0.0
Samba.Persistance, Version=1.0.0.0
Microsoft.Practices.Prism.MefExtensions, Version=4.0.0.0
PropertyTools, Version=2012.4.14.1
-----------------------------
[System Info]
Operating System
-Microsoft Windows 7 Professional
--CodeSet = 1252
--CSDVersion = Service Pack 1
--CurrentTimeZone = 480
--FreePhysicalMemory = 6566632
--OSArchitecture = 64-bit
--OSLanguage = 1033
--ServicePackMajorVersion = 1
--ServicePackMinorVersion = 0
--Version = 6.1.7601
Machine
-ALATURKA-PC
--Manufacturer = Gigabyte Technology Co., Ltd.
--Model = P55A-UD5
--TotalPhysicalMemory = 8584966144
--UserName = Alaturka-PC\Alaturka
-----------------------------

That is part of the error message. Ensure you have the correct User Name and Password in your connection string.

@QMcKay thankyou the password was typed incorrect.

may i know which part in the exception it states the error so next time its easy to be identified

got it inneer exception 3

Yes, Inner Exception 3. The most insight into the issue is almost always the innermost Exception (the highest number), because it is the real “root” of the error.

This is why we ask people to post the Detail of the error. The generic error is the outermost part, and is not informative enough - it is too generic. We need to see the innermost to discern the actual root cause.

@madiha, why not upgrade to 4.1.82 ?

2 Likes

i have upgraded to 82 already…

now i know will look into inner most exception

1 Like