Error report, please help me read what is the problem


[General Info]

Application: SambaPOS
Version: 5.3.0
Region: en
DB: SQ
Machine: SERVER
User: Administrator
Date: 21 Mar 2022
Time: 13:21

User Explanation:

Administrator 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 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.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.SubmitTicket(Ticket ticket, TicketType ticketType, AppState appState) in C:\Users\Vehbi\Documents\Source\Repos\sambapos-v5-pro\Samba.Services\Implementations\TicketModule\TicketServiceBase.cs:line 610
at Samba.Services.Implementations.TicketModule.TicketServiceBase.CloseTicket(Ticket ticket, AppState appState) in C:\Users\Vehbi\Documents\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\Documents\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\Documents\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.<>c.b__21_0(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__153_0() 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__DisplayClass148_0.b__0()
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.ReportTemp’ in database ‘SAMBAPOS5’ 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.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.InternalExecuteNonQuery(TaskCompletionSource1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.<>c.b__4_0(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.NonQuery(DbCommand command, DbCommandInterceptionContext interceptionContext) at System.Data.Entity.Internal.InterceptableDbCommand.ExecuteNonQuery() at System.Data.Entity.Core.Mapping.Update.Internal.DynamicUpdateCommand.Execute(Dictionary2 identifierValues, List`1 generatedValues)
at System.Data.Entity.Core.Mapping.Update.Internal.UpdateTranslator.Update()


[Assembly Info]

mscorlib, Version=4.0.0.0
System, Version=4.0.0.0
Samba.Services, Version=5.3.7390.41537
Samba.Domain, Version=5.3.7390.41536
Samba.Infrastructure.Data, Version=5.3.7390.41536
System.ComponentModel.Composition, Version=4.0.0.0
Samba.Presentation.Services, Version=5.3.7390.41539
System.Core, Version=4.0.0.0
PresentationCore, Version=4.0.0.0
WindowsBase, Version=4.0.0.0
PresentationFramework, Version=4.0.0.0
DevExpress.Xpf.LayoutControl.v17.2, Version=17.2.13.0
System.Xml, Version=4.0.0.0
DevExpress.Xpf.Grid.v17.2, Version=17.2.13.0
DevExpress.Xpf.Grid.v17.2.Core, Version=17.2.13.0
System.Xaml, Version=4.0.0.0
Samba.Infrastructure, Version=5.3.7390.41533
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
DevExpress.Xpf.Core.v17.2, Version=17.2.13.0
System.Windows.Forms, Version=4.0.0.0
System.Drawing, Version=4.0.0.0
Samba.Persistance, Version=5.3.7390.41536
Stateless, Version=1.0.0.0
PropertyTools, Version=2012.4.14.1
Samba.Localization, Version=5.3.7390.41534
ReachFramework, Version=4.0.0.0
EntityFramework, Version=6.0.0.0
FluentValidation, Version=3.4.0.0
NCalc, Version=1.3.8.0
Microsoft.CSharp, Version=4.0.0.0
Omu.ValueInjecter, Version=2.3.0.0
Microsoft.Practices.ServiceLocation, Version=1.0.0.0
DevExpress.Data.v17.2, Version=17.2.13.0
WindowsInput, Version=1.0.4.0


[System Info]

Operating System
-Microsoft Windows Server 2019 Standard
–CodeSet = 1252
–CSDVersion =
–CurrentTimeZone = 120
–FreePhysicalMemory = 2918020
–OSArchitecture = 64-bit
–OSLanguage = 1033
–ServicePackMajorVersion = 0
–ServicePackMinorVersion = 0
–Version = 10.0.17763

Machine
-SERVER
–Manufacturer = Dell Inc.
–Model = OptiPlex 990
–TotalPhysicalMemory = 8464822272
–UserName = SERVER\Administrator


I have deleted the table dbo.“Report Temp”
I have run the Metrik script, it says it wasn’t there on database.

Your hd is full or your sql server is full. It really looks like your hard drive is full.

Not HD, how to I minimize the size safely Jesse?

ok tried shrink DB via SQL, that didn’t work

here are my screen shots after I have shrunk DB and deleted ReportTemp

Please check your db settings to ensure auto growth is enabled.

Also, you have 4-times the amount of tasks as you do orders. What are you using tasks for?

for tasks I have implemented most of the tutorials on this V5. Some I use, some I don’t, but to know what is important and what to deleted is the question… I have a normal restaurant setup with many screens as we have many departments and I use the Task Printer Screen system and 2 main departments and 5 small kitchens (bar,coffee, milkshakes,pizza,main meal,etc)

I could not save todays work period because of that same error I shared in 1st port, had to Backup yesterdays work period unfortunately so cash up and stock take will be an nightmare.

So what I have done so far in case anyone else has same problem:

  • shrink DB via SMMS (task)
  • run Metrik script from this forum to eliminate old ReportTemp DB table via SMMS
  • made sure Autoshrink was enabled
  • made sure Autogrowth was enabled and increased it to 100mb (MSSQL Database Autogrowth Configuration)
  • Increased DB allocated size (same link)

You could also upgrade to full sql. Or even try the developer version although you are not supposed to use that in production.

Jesse has a point - you may be hitting some limitation of the express version.

I’d want to investigate the the huge tasks table.

Hey @Jesse, once a task is marked complete, can that task be restarted/enabled in the future? I know nothing of tasks but I’m wondering if OP could just delete all the completed tasks from the table without impacting current operations.

1 Like

What can I send you a screen-shot of to see the Tasks active?

From what I gather from your posts, you’re using tasks to route orders to various kitchen displays, no?

You can delete any tasks. It shouldn’t impact it. It will only be a bandaide he should consider upgrading. Or archiving data if upgrading isn’t an option.

1 Like

yes, mostly task print screen.

Does the data for ELG Event Log need to persist?

I doubt it must be important…

This i believe is the origin:

In the above scenario, we solved that by disabling the default cancel order rule and instead implemented automation that voids the orders but the ticket persists. Then ticket logging works without issue.

Backup your database before executing any changes.

I am assuming that the tasks have been marked as completed.

If you want to keep your the logging data, execute this script in SSMS:

BEGIN TRANSACTION;
BEGIN TRY
    DECLARE @ErrorMessage NVARCHAR(MAX);
    DECLARE @ErrorSeverity INT;
    DECLARE @ErrorState INT;

    DECLARE @TaskTypeId INT;

    SELECT @TaskTypeId = Id
    FROM dbo.TaskTypes
    WHERE Name = 'ELG Event Log';

    DELETE FROM dbo.Tasks
    WHERE TaskTypeId <> @TaskTypeId
          AND Completed = 1;

    COMMIT TRANSACTION;
END TRY
BEGIN CATCH
    IF @@TRANCOUNT > 0
    BEGIN
        ROLLBACK TRANSACTION;

        SET @ErrorMessage = ERROR_MESSAGE();
        SET @ErrorSeverity = ERROR_SEVERITY();
        SET @ErrorState = ERROR_STATE();
        RAISERROR(@ErrorMessage, @ErrorSeverity, @ErrorState);
    END;
END CATCH;

if you don’t care about the log data, use this script:

BEGIN TRANSACTION;
BEGIN TRY
    DECLARE @ErrorMessage NVARCHAR(MAX);
    DECLARE @ErrorSeverity INT;
    DECLARE @ErrorState INT;

    DELETE FROM dbo.Tasks
    WHERE Completed = 1;

    COMMIT TRANSACTION;
END TRY
BEGIN CATCH
    IF @@TRANCOUNT > 0
    BEGIN
        ROLLBACK TRANSACTION;

        SET @ErrorMessage = ERROR_MESSAGE();
        SET @ErrorSeverity = ERROR_SEVERITY();
        SET @ErrorState = ERROR_STATE();
        RAISERROR(@ErrorMessage, @ErrorSeverity, @ErrorState);
    END;
END CATCH;
3 Likes

The task DB is much smaller now…

There’s still quite a bit of data in there. My guess is some tasks aren’t being marked complete.

If you want to completely clear the table and don’t care about anything stored in that table, this will clear the rest out for you.

Also, be sure to shrink the database - use SSMS and select the following:

image

BEGIN TRANSACTION;
BEGIN TRY
    DECLARE @ErrorMessage NVARCHAR(MAX);
    DECLARE @ErrorSeverity INT;
    DECLARE @ErrorState INT;

    TRUNCATE TABLE dbo.Tasks;

    COMMIT TRANSACTION;
END TRY
BEGIN CATCH
    IF @@TRANCOUNT > 0
    BEGIN
        ROLLBACK TRANSACTION;

        SET @ErrorMessage = ERROR_MESSAGE();
        SET @ErrorSeverity = ERROR_SEVERITY();
        SET @ErrorState = ERROR_STATE();
        RAISERROR(@ErrorMessage, @ErrorSeverity, @ErrorState);
    END;
END CATCH;
2 Likes

Msg 50000, Level 16, State 1, Line 19
Cannot truncate table ‘dbo.Tasks’ because it is being referenced by a FOREIGN KEY constraint.

This is response from SMS after running the query