Database is full

I had this error pop up tonight whkle in full operation. Turns out my database is full… who jnew that was a thing! Ive tried to shrink it with no luck and im petrified about deleting any files. Anyone had this issue? Are there certain
Files i can delete? At least to get me through the night! Always on Fridays!!

ion: 5.2.22
Region: en
DB: SQ
Machine: KEVIN
User: Server
Date: 12/2/2023
Time: 12:25 AM

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.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.Implementations.SettingDao.GetNextNumber(Int32 numeratorId)
at Samba.Services.Implementations.SettingsModule.SettingService.GetNextNumber(Int32 numeratorId) in C:\Users\vehbi\Source\Repos\sambapos-v5-pro\Samba.Services\Implementations\SettingsModule\SettingService.cs:line 112
at Samba.Services.Implementations.TicketModule.TicketServiceBase.SaveTicket(Ticket ticket, TicketType ticketType) in C:\Users\vehbi\Source\Repos\sambapos-v5-pro\Samba.Services\Implementations\TicketModule\TicketServiceBase.cs:line 145
at Samba.Services.Implementations.TicketModule.TicketServiceBase.SubmitTicket(Ticket ticket, TicketType ticketType, AppState appState) in C:\Users\vehbi\Source\Repos\sambapos-v5-pro\Samba.Services\Implementations\TicketModule\TicketServiceBase.cs:line 563
at Samba.Services.Implementations.TicketModule.TicketServiceBase.CloseTicket(Ticket ticket, AppState appState) in C:\Users\vehbi\Source\Repos\sambapos-v5-pro\Samba.Services\Implementations\TicketModule\TicketServiceBase.cs:line 595
at Samba.Presentation.Services.Implementations.TicketModule.TicketService.CloseTicket(Ticket ticket)
at Samba.Presentation.ClientLibrary.Modules.PosModule.PosViewModel.CloseTicket() in C:\Users\vehbi\Source\Repos\sambapos-v5-pro\Samba.Presentation.ClientLibrary\Modules\PosModule\PosViewModel.cs:line 700
at Samba.Presentation.ClientLibrary.Modules.PosModule.PosViewModel.OnTicketEvent(EventParameters1 obj) in C:\Users\vehbi\Source\Repos\sambapos-v5-pro\Samba.Presentation.ClientLibrary\Modules\PosModule\PosViewModel.cs:line 522 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.b__2(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__35() 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__DisplayClass2a.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: Could not allocate space for object ‘dbo.ReportTemp’ in database ‘SambaPOS4’ 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.b__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=1.0.0.0
Samba.Domain, Version=1.0.0.0
Samba.Infrastructure.Data, Version=1.0.0.0
System.ComponentModel.Composition, Version=4.0.0.0
Samba.Presentation.Services, Version=1.0.0.0
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.v16.2, Version=16.2.13.0
System.Xml, Version=4.0.0.0
DevExpress.Xpf.Grid.v16.2, Version=16.2.13.0
DevExpress.Xpf.Grid.v16.2.Core, Version=16.2.13.0
System.Xaml, 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
DevExpress.Xpf.Core.v16.2, Version=16.2.13.0
System.Windows.Forms, Version=4.0.0.0
System.Drawing, Version=4.0.0.0
Samba.Persistance, Version=1.0.0.0
Stateless, Version=1.0.0.0
PropertyTools, Version=2012.4.14.1
Samba.Localization, Version=1.0.0.0
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.v16.2, Version=16.2.13.0
WindowsInput, Version=1.0.4.0


[System Info]

Operating System
-Microsoft Windows 8.1 Pro with Media Center
–CodeSet = 1252
–CSDVersion =
–CurrentTimeZone = -300
–FreePhysicalMemory = 3429276
–OSArchitecture = 64-bit
–OSLanguage = 1033
–ServicePackMajorVersion = 0
–ServicePackMinorVersion = 0
–Version = 6.3.9600

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


I think i know my problem and hopefully someone can help me with this…

I made the kitchen/bar display years ago. Problem is, no one used the bar display and because if it, the orders have never been deleted. If i try the computer eventualy freezes (I left it loading over night once and it still hadnt loaded) and i have to restart Samba. Is there a way to delete these through sql?

In Microsoft SQL Server Management Studio, right click on Database -> Reports -> Standard Reports -> Disk Usage by Table then sort by size. Post a screen shot of the results.

This might post might be of some help:

This may also be of interest, read the post in it’s entirety:

1 Like

Its likely you will need to migrate the database on to a new computer or upgrade your current storage.

Old backups can occupy a lot of space too, you can clear up some space by deleting old out of date backup .zip files.

If your device is not out of disk storage then you can adjust via SQL Server Management Studio on how much space is allocated for your database.

Inner Exception 3
Type: System.Data.SqlClient.SqlException
Message: Could not allocate space for object ‘dbo.ReportTemp’ in database ‘SambaPOS4’ 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.

dbo.ReportTemp is a table in the database used previously by older version of metrik. If you are no longer using that version of metrik then this table is of no use to you and you can safely remove it.

You can run this Query in your database. Also, can check this link for more info about metrik v1 removal.

2 Likes

Thanks to both of you!

Here’s the screenshots



I ran the script and it gave me close to 500mb of space, so hopefully that will get me through this busy weekend!!

Thanks again to @Bob_be and Posflow you guys saved me a lot of headache!

1 Like

Yeah it looks like clearing the ReportTemp table fixed the space issue for you, but you are also right about the kitchen task (display printer) issue, as it keeps running the Tasks table keeps growing indefinitely.

Been close to 4 years now…

I had the same problem with one of the site we manage,
their Kitchen display was left unused for almost a year,
the tickets just piled up and made the server really slow and sometimes will freeze and cause SambaPOS to crash.

but this was couple of years ago, If I remembered correctly,
there is a database task you can add and it will clear the tasks eg. Kitchen Display tickets. and then you will just have to disable the rules for tickets not to send anymore.

I will try to see if I can find the executable database task for you.

Thank you! Don’t waste too much time on it though… I’m building a new server from scratch for this and other reasons and what @Bob_be advised me to do, cleared a lot of space. Definitely curious to see the difference at this point though!