Unable to read beyond the end of the stream

Good day

Wondering if somebody on this forum can please assist ?

a Friend is running SambaPos version 4 for his restaurant (Great software btw.) and he currently experienced the below Error when adding a new inventory>transaction:

Below error Message pop’s up when you try to add a new transaction and the SambaPos close by itself:


[General Info]

Application: SambaPOS
Version: 4.1.82
Region: en
DB: SQ
Machine: FS1
User: FS1Admin
Date: 25/02/2019
Time: 08:14:27 AM

User Explanation:

FS1Admin said “”

[Exception Info 1]

Top-level Exception
Type: System.IO.EndOfStreamException
Message: Unable to read beyond the end of the stream.
Source: mscorlib
Stack Trace: at System.IO.BinaryReader.ReadByte()
at System.IO.BinaryReader.Read7BitEncodedInt()
at System.IO.BinaryReader.ReadString()
at Samba.Infrastructure.Data.BinarySerializer.SilverlightSerializer.Deserialize(Stream inputStream, Object instance)
at Samba.Infrastructure.Data.BinarySerializer.SilverlightSerializer.Deserialize(Byte[] bytes)
at Samba.Presentation.Controls.UIControls.EnhancedDataGrid.Load()
at Samba.Presentation.Controls.UIControls.EnhancedDataGrid.<>c__DisplayClass4.b__2(Object sender, RoutedEventArgs x)
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.BroadcastEventHelper.BroadcastEvent(DependencyObject root, RoutedEvent routedEvent)
at System.Windows.BroadcastEventHelper.BroadcastLoadedEvent(Object root)
at MS.Internal.LoadedOrUnloadedOperation.DoWork()
at System.Windows.Media.MediaContext.FireLoadedPendingCallbacks()
at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
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)
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 MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext 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 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, 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.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.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 10 Pro
–CodeSet = 1252
–CSDVersion =
–CurrentTimeZone = 120
–FreePhysicalMemory = 4960592
–OSArchitecture = 64-bit
–OSLanguage = 1033
–ServicePackMajorVersion = 0
–ServicePackMinorVersion = 0
–Version = 10.0.17763

Machine
-FS1
–Manufacturer = *******
–Model = ********
–TotalPhysicalMemory = *********
–UserName = *********


Can any one please assist in sorting out this issue ? My friend doesn’t want to upgrade to version 5 ( we are based in South Africa, and with the current ROA it’s just to expensive ). He’s asked me to assist him with this because when it comes to MSSQL and Computers :slight_smile: he’s clueless. I have some experience with MSSQL but can’t seem to find the source of the error.

Thank in advance

Show us the transaction.

Hi Kendash

The Error doesn’t find place with just one specific transaction in question. It find place every time you want to ADD or Edit a Transaction Document.

It happens when you navigate as follows with in Sambapos:

Manage>Inventory>Transactions>Add Transaction Document

or

Manage>Inventory>Transactions>Select any transaction and click Edit Transaction Document

In both cases the above error appears and when closed, SambaPos close completely as well.

Kind regards
And thank you for your response

It’s hard to say. It could be a bug that was fixed in v5. Maybe not. Did you try reinstalling? When did it start? Maybe a bad inventory document?

The system has been running for about 2-years, I’m thinking if it was a bug, why would it happen only now ? Haven’t tried reinstalling (Will give it a go) Just a question, seeing I’m new to Samba - If I reinstall, it won’t delete any of the existing SQL server instances or databases ? We can’t afford to lose any data. Can you perhaps point me in the direction of the process of reinstalling Samba? The issue started 22/02/19. I have deleted the last couple of inventory document leading up to before the Error occurred and it hasn’t proven to be a fix.

Kind regards.

No it won’t delete or change your database.

And the hard drive is not close to full?

Always run a backup first.

No, there are 2x 500gd HHD in the machine. And 1 is allocated for SambaPOS only.

:+1:t2: Will do a full SQL database backup before starting.

I would recommend running a backup then try deleting more documents until it works. If it starts to work you still have the backup data but at least you would know if the culprit is a bad transaction. If it doesn’t resolve you can always load the backup.

Will give it a try and let you know if the Error presist. Thanx for the suggestions.