The Calling thread must be STA - Error

Good Morning! not posted for a long time, we are now open and SAMBAPOS is working great! I do however have a little issue that I would like to resolve although this isn’t causing too much of a problem.

I keep getting the following error

this shows up on the main server screen and also on another terminal.

I haven’t pinpointed exactly when this happens but I notice it when I am viewing the ‘KItchen Order’ entity screen. and I think it is when an order is either then made ready or served. This also causes a lag when clicking between entity screens and can cause the system to freeze for all users for upto 20 seconds or there abouts.

I have tried uninstalling and re-installing .net on both machines and have also upgraded to Sambapos V 4.1.42

any help would be great. I can post log file or db backup is required.

Many Thanks and hope everyone is doing well.

Best Wishes


log file if this helps (11.7 KB)

Hello @windinghouse. I’ve noticed that error in your log file.

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified

It seems SambaPOS tries to display an error message but since that error occurs during a background operation instead of displaying error message it displays STA-Error message.

Do you experience loosing network connection issues on that terminal?

Hi @emre I will monitor the network status today and see if there is an issue with connection. I haven’t noticed any disconnection notifications but as SambaPOS is always running in full screen these may be hidden in the background. I will also attach the log file from the server as we get the same STA-Error message on there too which is running SQL server.

I will see if I can jump on remotely now and grab the log file.

Thanks for your time as always


here is the log file from the server (30.3 KB)

Looking at the logfile from the server posted above - there are no events showing for yesterday, however this issue did happen yesterday, and it happens several times everyday.

That error message mostly occurs when we want to show a message box on screen. Does it give an idea? Do you display notification messages to users on kitchen screen?

@emre we did broadcast messages when orders were ready and when new orders came to the kitchen but this was getting annoying when we were busy as there would be multiple messages that the waitress would have to clear before they could place other orders etc. so I disabled these. I have had a look throught the rules and can’t see anywhere that these were still enabled. I have deleted the message received rules now although these weren’t mapped or called by other rules.
I will test again today and see what happens, but what you say did make sense as something I noticed yesterday is that when an order is placed on a tablet (rdp connection) the ticket would print instantly but the order wouldn’t display in ticket lister widget for about 20 seconds or so and during this time the terminal showing the widget would freeze - which could possibly be due to it expecting a message but that not being there ( if that makes sense )

I will see how it goes today and let you know.

Many Thanks as always for your help and support.


I’ve investigated it deeply and found that the screen freeze issue can happen only while ticket lister screen refreshes after reading changes from database. Does it happen on a specific terminal?

it seems to happen on both terminals …when a certain rule runs we get about 20 second delay from ticket printing to being displayed on ticket lister. still getting sta error but not as frequent since deleting message broadcast rules

Hello @windinghouse. Did you enabled auto refresh for widget?

Hi @emre I think there must be an error in one of our combo deal rules as it only seems to happen then… auto refresh is enabled. its hard to pinpoint error as orders are always coming through :smile:

Can you send me a backup of your database before trying to fix something?

hi @emre we are still getting sta errors and finding that we have frequent lockups when switching between entity screens… when an order is submitted the ticket prints immediately but there appears to be a lag displaying the ticket on the screens that we use to monitor incoming orders at the bar and the kitchen… this is quite possibly hardware but I have attached a backup for your expert eyes!!! thanks as always for you help. (1.2 MB)

Can you try with 4.1.47 and let me know if it works better or not?

I installed 4.1.47 today, before starting work period, and I noticed an improve in response when opening a new table and adding first order.

I had some lags, not much, not to long, but now seems more responsive,

If possible (intrigue is killing me) I would like to kno what in hell did you do… LOL!!!



sorry for confusing you @gerlandog but I’ve released 3 versions today and 4.1.47 released few minutes before lol. Every new release will work better…

ok… sorry… I ment 4.1.46


thanks @emre I have just logged on to both static terminals and updated! fingers crossed we will put to the test today and I will let you know how we get on.

Can’t thank you enough for creating SambaPos even our customers comment on how good a system it is! and how efficient it makes our service!

WELL DONE for making THE BEST EPOS system out there :smile:

@emre since the release of 4.1.47 everything appears to be much more stable and slicker! not sure what you have done … but it appears to be working … not had a single STA error and orders are appearing on ticket lister without delay and we are not getting any freezing! so fingers crossed this has sorted it!

Can you please check the Log file Maybe he will explain why I get this error message every few minutes.
Thanks. (7.6 KB)