SambaPOS freezing. Error message I haven't seen before

Almost once a day starting from 8 days ago, SambaPOS running on all of my terminals runs VERY slowly and crashes in the end, leaving this error as shown on the bottom of this post. It’s not the same error message I got when by database reached 10 GB; this time, it’s different. Does anyone know what is causing this?

Inner Exception 2
Type:        System.Data.SqlClient.SqlException
Message:     A transport-level error has occurred when receiving results from the server. (provider: Session Provider, error: 19 - Physical connection is not usable)
Source:      .Net SqlClient Data Provider


    FULL ERROR MESSAGE
    [General Info]

    Application: SambaPOS
    Version:     5.2.26
    Region:      en
    DB:          SQ
    Machine:     DESKTOP-HAB492E
    User:        K&L Employee
    Date:        1/30/2020
    Time:        2:09 PM

    User Explanation:

    K&L Employee 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.Core.EntityCommandExecutionException
    Message:     An error occurred while executing the command definition. See the inner exception for details.
    Source:      EntityFramework
    Stack Trace: at System.Data.Entity.Core.EntityClient.Internal.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior)
       at System.Data.Entity.Core.Objects.Internal.ObjectQueryExecutionPlan.Execute[TResultType](ObjectContext context, ObjectParameterCollection parameterValues)
       at System.Data.Entity.Core.Objects.ObjectQuery`1.<>c__DisplayClass7.<GetResults>b__6()
       at System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T](Func`1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess)
       at System.Data.Entity.Core.Objects.ObjectQuery`1.<>c__DisplayClass7.<GetResults>b__5()
       at System.Data.Entity.Infrastructure.DbExecutionStrategy.Execute[TResult](Func`1 operation)
       at System.Data.Entity.Core.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption)
       at System.Data.Entity.Core.Objects.ObjectQuery`1.<System.Collections.Generic.IEnumerable<T>.GetEnumerator>b__0()
       at System.Data.Entity.Internal.LazyEnumerator`1.MoveNext()
       at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable`1 source)
       at System.Data.Entity.Core.Objects.ELinq.ObjectQueryProvider.<GetElementFunction>b__2[TResult](IEnumerable`1 sequence)
       at System.Data.Entity.Core.Objects.ELinq.ObjectQueryProvider.ExecuteSingle[TResult](IEnumerable`1 query, Expression queryRoot)
       at System.Data.Entity.Core.Objects.ELinq.ObjectQueryProvider.System.Linq.IQueryProvider.Execute[TResult](Expression expression)
       at System.Linq.Queryable.SingleOrDefault[TSource](IQueryable`1 source, Expression`1 predicate)
       at Samba.Infrastructure.Data.SqlData.ReadOnlyEFWorkspace.Single[T](Expression`1 predictate, Expression`1[] includes)
       at Samba.Persistance.Data.Dao.Single[T](Expression`1 predictate, Expression`1[] includes)
       at Samba.Persistance.Implementations.UserDao.GetUserByPinCode(String pinCode)
       at Samba.Services.Implementations.UserModule.UserServiceBase.GetUserByPinCode(String pinCode) in C:\Users\vehbi\Source\Repos\sambapos-v5-pro\Samba.Services\Implementations\UserModule\UserServiceBase.cs:line 25
       at Samba.Presentation.Services.Implementations.UserModule.UserService.LoginUser(String pinValue)
       at Samba.Presentation.ClientLibrary.Modules.LoginModule.LoginModule.PinEntered(String pin) in C:\Users\vehbi\Source\Repos\sambapos-v5-pro\Samba.Presentation.ClientLibrary\Modules\LoginModule\LoginModule.cs:line 87
       at Samba.Presentation.ClientLibrary.Modules.LoginModule.LoginModule.<OnPreInitialization>b__10_2(EventParameters`1 x) in C:\Users\vehbi\Source\Repos\sambapos-v5-pro\Samba.Presentation.ClientLibrary\Modules\LoginModule\LoginModule.cs:line 80
       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.SqlClient.SqlException
    Message:     A transport-level error has occurred when receiving results from the server. (provider: Session Provider, error: 19 - Physical connection is not usable)
    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.TdsParserStateObject.ReadSniError(TdsParserStateObject stateObj, UInt32 error)
       at System.Data.SqlClient.TdsParserStateObject.ReadSniSyncOverAsync()
       at System.Data.SqlClient.TdsParserStateObject.TryReadNetworkPacket()
       at System.Data.SqlClient.TdsParserStateObject.TryPrepareBuffer()
       at System.Data.SqlClient.TdsParserStateObject.TryReadByte(Byte& value)
       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, 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, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
       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.EntityClient.Internal.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior)

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

    [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 10 Enterprise
    --CodeSet = 1252
    --CSDVersion = 
    --CurrentTimeZone = -300
    --FreePhysicalMemory = 12820760
    --OSArchitecture = 64-bit
    --OSLanguage = 1033
    --ServicePackMajorVersion = 0
    --ServicePackMinorVersion = 0
    --Version = 10.0.17763

    Machine
    -DESKTOP-HAB492E
    --Manufacturer =                                  
    --Model =                                  
    --TotalPhysicalMemory = 17042657280
    --UserName = DESKTOP-HAB492E\K&L Employee

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

Looks like a network issue at a glance. Is this on a ‘slave’ terminal?

Yes, I did recently add a wifi access point and plug it in the same network switch that all the other computers are plugged into.

Yes its about network. I think there is a problem with SQLServer

1 Like

Ok I’m going to remove the wifi access point from the switch and get a 100 ft ethernet cord and plug it in directly to the router. I’ll report back. Thank you guys for the quick response.

1 Like

No problem. Please report us last status.

1 Like

It still froze up.

When it freezes up, it only lasts for 10 minutes, but it feels like forever.
The red error message pops up when I press anything, but sometimes it just crashes, leaving the crash message.
I tried testing my internet connection on the same computer. Websites still load properly.

When it starts to work again, everything goes back to normal speed.

Database is still not full yet…

It’s a connection issue. Either physical or software with the SQL server. We need to diagnose it.

Should I try “Rebuild Indexes”?

That won’t help if it’s connection issue. The server the database is on. When it slows down check the resources on it.

Check if it’s downloading updates. Or if virus scanner is on.

Or a backup may be running?

Lol there are servers in Russia, Netherlands, etc trying to bruteforce rdp into my server computer.
https://www.abuseipdb.com/check/82.202.247.81

Let me tidy this mess up first.

1 Like

Hmm yes it may be a DOS attack. Please use a firewall i you are using a static IP

Ok I put the firewall back, but is there any reason why SambaPOS prefers the firewall to be off?

Edit: I put the firewall back on and the terminals couldn’t reach the SQL server.
How do I make it so that SambaPOS and my firewall both work?

SambaPOS doesn’t prefer it to be off. Its most people have no idea how to configure one so its easier to just say turn it off. Firewalls are not our expertise. We can recommend ports and settings but we can not offer solutions for all firewalls so its easier for troubleshooting to just ask them to turn it off.

I can help you open the correct ports so you can keep your firewall on. Its really only a few ports honestly. FIrst is port 9000 for Message server second is the ports for SQL Server but we need to be sure SQL Server is set to run on specific ports and not the Dynamic ports it usually installs on by default.

Give me a few minutes I will provide you a step by step for how to ensure SQL Server is running on the correct ports.

EDIT: Actually our KB has been updated to show the correct method for installing SQL Server including opening the correct ports on the firewall.

https://kb.sambapos.com/en/2-1-3-a-sql-express-server-setup/

Read through that tutorial and open the ports it shows as well as read down to where it shows how to set SQL Server to run on those ports. By default it sets SQL Server to run on dynamic ports you need to disable that and set it to run on port 1433 this is explained in the tutorial.

You really shouldnt turn firewall off on an externally exposed machine.
Your router should have a firewall built in and without dmz or port forwarding it shouldnt be posible to get to a pc on internal 192. Type ip from WAN without being a serious hacker.
Once you open a port on router you with inevitably get attempts from port scanners.
The phone systems I’ve worked on even with non default port for sip still get rouge registration attempts.
On default port was getting hundreds.
So where posible changing to non default port and remapping to correct port internally helps reduce.
But definatly dont blindly turn of firewall on router or pc if have open ports etc on router.

Yes I do not suggest opening up ports on the router. I was specifically referring to the firewall for internal network. There are a few use cases where we might open up port 9000 if we want to serve graphql to the internet. But even then the best route would be to host your own webserver and redirect internally.

I say that on sugestion of a DOS attack. If you have dos attach internally then more serious issues LOL.