Can no longer back up within Samba

I’ve searched the forum to see if anyone has had this problem before but no luck!

The hard drive I’ve been using for backups died on me sometime last month so I replaced it and setup the same (samba backups) folder on the new one but I get this message when I try to use the “backup database” button.

I can backup fine within SQL but having no luck with the Auto Backup feature.

Any help would be great as I’m not sure where to go from here…

Is it multi till system? Do all machines have same drive/location available?
Check in different location (not my documents folder) like root of c drive.

We need to see the actual log expecially the inner exceptions.

1 Like

I have 2 terminals and a server. I use an external hard drive connected to the server so no, I guess the terminals don’t have access to it. Tried C:/ but still says the same error.

This is the latest log…

[General Info]

Application: SambaPOS
Version:     5.1.57
Region:      en
DB:          SQ
Machine:     KEVIN
User:        Server
Date:        3/17/2016
Time:        2:54 PM

User Explanation:

Server 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.Reflection.RuntimeMethodInfo.UnsafeInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   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.DispatcherOperation.InvokeImpl()
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(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.Entity.Infrastructure.DbUpdateException
Message:     An error occurred while updating the entries. See the inner exception 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.Presentation.Common.ModelBase.EntityCollectionViewModelBase`2.<.ctor>b__0_3(EventParameters`1 x)
   at Microsoft.Practices.Prism.Events.EventSubscription`1.InvokeAction(Action`1 action, TPayload argument)
   at Microsoft.Practices.Prism.Events.EventSubscription`1.<>c__DisplayClass2.<GetExecutionStrategy>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.<Update>b__2(UpdateTranslator ut)
   at System.Data.Entity.Core.EntityClient.Internal.EntityAdapter.Update[T](T noChangesResult, Func`2 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](Func`1 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.<SaveChangesInternal>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:     The INSERT statement conflicted with the FOREIGN KEY constraint "FK_dbo.MenuItemPortions_dbo.MenuItems_MenuItemId". The conflict occurred in database "SambaPOS4", table "dbo.MenuItems", column 'Id'.
The statement has been terminated.
Source:      .Net SqlClient Data Provider
Stack Trace: at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 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)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
   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, DbCommandInterceptionContext`1 c)
   at System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch[TTarget,TInterceptionContext,TResult](TTarget target, Func`3 operation, TInterceptionContext interceptionContext, Action`3 executing, Action`3 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(Dictionary`2 identifierValues, List`1 generatedValues)
   at System.Data.Entity.Core.Mapping.Update.Internal.UpdateTranslator.Update()

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

[Assembly Info]

mscorlib, Version=4.0.0.0
DevExpress.Xpf.LayoutControl.v14.1, Version=14.1.11.0
System.Xml, Version=4.0.0.0
DevExpress.Xpf.Grid.v14.1, Version=14.1.11.0
System, Version=4.0.0.0
DevExpress.Xpf.Grid.v14.1.Core, Version=14.1.11.0
WindowsBase, Version=4.0.0.0
System.Xaml, Version=4.0.0.0
Samba.Domain, Version=1.0.0.0
System.Core, 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
System.ComponentModel.Composition, Version=4.0.0.0
PresentationCore, Version=4.0.0.0
DevExpress.Xpf.Core.v14.1, Version=14.1.11.0
Samba.Services, Version=1.0.0.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
Samba.Infrastructure.Data, Version=1.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 8.1 Pro with Media Center
--CodeSet = 1252
--CSDVersion = 
--CurrentTimeZone = -240
--FreePhysicalMemory = 5872720
--OSArchitecture = 64-bit
--OSLanguage = 1033
--ServicePackMajorVersion = 0
--ServicePackMinorVersion = 0
--Version = 6.3.9600

Machine
-KEVIN
--Manufacturer = Dell Inc.
--Model = Inspiron 3847
--TotalPhysicalMemory = 8502837248
--UserName = Kevin\Server

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

######################### E N D #########################
-----------------------------
[General Info]

Application: SambaPOS
Version:     5.1.57
Region:      en
DB:          SQ
Machine:     KEVIN
User:        Server
Date:        5/12/2016
Time:        8:15 PM

User Explanation:

Server said ""
-----------------------------

[Exception Info 1]

Top-level Exception
Type:        System.ComponentModel.Win32Exception
Message:     The printer name is invalid
Source:      Samba.Services
Stack Trace: at Samba.Services.Implementations.PrinterModule.Tools.PrinterHelper.GetPrinter(String szPrinterName)
   at Samba.Services.Implementations.PrinterModule.Tools.LinePrinter.StartDocument()
   at Samba.Services.Implementations.PrinterModule.PrintJobs.SlipPrinterJob.DoPrint(String[] lines)
   at Samba.Services.Implementations.PrinterModule.PrintJobs.PrintJobCache.Print()
   at Samba.Services.Implementations.PrinterModule.PrintJobs.PrintJobFactory.Print()
   at Samba.Services.Implementations.PrinterModule.TicketPrinter.InternalPrint(Ticket ticket, PrintJob printJob, Func`2 orderSelector)
   at Samba.Services.Implementations.PrinterModule.TicketPrinter.<>c__DisplayClass15_0.<Print>b__0()
   at Samba.Services.Implementations.PrinterModule.AsyncPrintTask.InternalExec(Action action, ILogService logService)

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

[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
Samba.Infrastructure, Version=1.0.0.0
Microsoft.Practices.Prism, Version=4.0.0.0
DevExpress.Xpf.Core.v14.1, Version=14.1.11.0
System.Core, Version=4.0.0.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 8.1 Pro with Media Center
--CodeSet = 1252
--CSDVersion = 
--CurrentTimeZone = -240
--FreePhysicalMemory = 5826980
--OSArchitecture = 64-bit
--OSLanguage = 1033
--ServicePackMajorVersion = 0
--ServicePackMinorVersion = 0
--Version = 6.3.9600

Machine
-KEVIN
–Manufacturer = Dell Inc.
–Model = Inspiron 3847
–TotalPhysicalMemory = 8502837248
–UserName = Kevin\Server


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

It has to do with this:

 The INSERT statement conflicted with the FOREIGN KEY constraint “FK_dbo.MenuItemPortions_dbo.MenuItems_MenuItemId”. The conflict occurred in database “SambaPOS4”, table “dbo.MenuItems”, column ‘Id’.

But I’m not sure what it means exactly. Have you done any thing to menu items table? It looks like a conflict with a menu item and portion.

1 Like

What is “menu items table”? I haven’t setup any inventory so no portions on my system.

Every product has a portion defined even if its just a default portion it has nothing to do with inventory. MenuItems is the actual items on the menu.

1 Like

Checked every Menu item (all 1535 and I think I fell asleep at least 3 times staring at the screen) and everyone has portion set to normal. I did find about 20 duplicate products which I thought to be impossible since when you make a product that already exists Samba tells you that and won’t let you. Also, noticed the date on the last recorded log is 03/17/16 and my problem only started about a month ago. I’m really thinking about redoing my whole system at this point as I am also unable to update past 5.1.57… Also flags a problem with the tables within SQL.

1 Like

Are eyou sure you haven’t manuipulated the database directly with SQL manager or script.

This may be way off base, but is your backup location on the same drive as your database? (in the Manage->Database Backups->Settings)

Bob

2 Likes

I don’t think so as I try to leave my live system alone and only experiment on my test computer to make sure everything I do works on it first.

No the database is on the C drive and the backups were saved on an external HD

I’ve started to redo my system now and one thing I’ve noticed is there’s no Action Type “Cancel Ticket Payments” in the latest Samba update. I know @emre hated the “reopen ticket” feature but did he take it out and would that have anything to do with my issue?

install advanced ticket actions module from samba market.

4 Likes

Any chance I can get the 5.1.57 version of samba? Apparently I can’t open this database without it and I’m hoping to “copy and paste” a lot of it to my new database.

You can install new version and it will update database.