NetTalk Central

Author Topic: GetServers() error after restart server  (Read 18102 times)

tglomb

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
    • AObit Software
    • Email
GetServers() error after restart server
« on: July 06, 2015, 10:04:13 AM »
Hello,
I have an App according to Scenario One. A NetClient App (on a Client PC in a LAN) is asking (polling) the NetServer App (on a virtual Server in the LAN) if it has data for the Cleint. The NetServer is answering with data or with no. In the Process method of the NetClient is a "if GetServers()..". This works for one week without any Problems - except..
Every sunday the Server is restartet, the NetServer App starts automatically (in a script). But then in the NetClient Apps in Process method the GetServers() method returns with error. After closing and starting the NetServer App  again everything works perfect again for one week (next Server restart).
Does anyone have an idea what happens ?
Any ideas appreciated,
regards, Thomas
(C10gold, NT8.44)

tglomb

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
    • AObit Software
    • Email
Re: GetServers() error after restart server
« Reply #1 on: July 10, 2015, 04:58:39 AM »
No takers on this.. ?

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: GetServers() error after restart server
« Reply #2 on: July 10, 2015, 05:55:57 AM »
Not much from my side - sorry Thomas...

>> Every sunday the Server is restarted

How is this done? does the machine do a proper shutdown? does your app do a proper shutdown when windows closes down? Or does everything just get chopped off at the knees?

>> But then in the NetClient Apps in Process method the GetServers() method returns with error.

what is the error?


cheers
Bruce
 

tglomb

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
    • AObit Software
    • Email
Re: GetServers() error after restart server
« Reply #3 on: July 11, 2015, 11:27:51 AM »
Hello Bruce,
the Server is one of several VM's on a physical Server. Every sunday all the VM's were restartet automatically. I have the "Clean CloseDown" template on this App.
I try to get the error info. It's difficult, the system is 24x7 at work. I had not coded any kind of logging..
Ciao, Thomas

tglomb

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
    • AObit Software
    • Email
Re: GetServers() error after restart server
« Reply #4 on: July 11, 2015, 11:40:21 AM »
oops.. I meant the Frame Extension template - Enable shutdown. I don't use the CleanCloseDown procedure..

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: GetServers() error after restart server
« Reply #5 on: July 12, 2015, 03:21:19 AM »
yeah,
I recommend logging program starts and program ends.
That way you'll know if the server is closing "correctly" or if it is just being terminated.

cheers
Bruce

tglomb

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
    • AObit Software
    • Email
Re: GetServers() error after restart server
« Reply #6 on: July 18, 2015, 11:58:30 AM »
hey Bruce,
GetServers() returns in this case -16. Interestingly also sometimes over the day when the physical Server and the VM's were running without break.
Do you have any idea ?
Ciao, Thomas

tglomb

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
    • AObit Software
    • Email
Re: GetServers() error after restart server
« Reply #7 on: July 19, 2015, 11:22:15 PM »
hey,
the same procedure as every monday. Alll the Servers were restarted at sunday, my NetServer prog also starts automatically. Then monday morning the Client PC is restartet and so my NetClient prog.. GetServers() returns -16 then. After manual closing and restarting of the NetServer prog immediately everything is fine.
So again.. why GetServers() don't see the NetServer prog in this szenario ?
Ciao, Thomas

tglomb

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
    • AObit Software
    • Email
Re: GetServers() error after restart server
« Reply #8 on: July 27, 2015, 01:09:26 PM »
"I dont like mondays"..
Ok, I snitched this from the Boomtown Rats ;-) 
But the same procedure as every monday, no matter what I do. Here's the event flow..
* NetClient and NetServer are running, everything is fine.. for one week
* all the Server VM's are restarted at sunday, one is running the NetServer prog
* my NerServer prog closes gracefully when the request is coming from the OS
* the NetClient prog(s) runining and GetServers() giving now error -16 - which is ok
* now with the restart of hte VM my NetServer prog is also restarted and it runs fine !
* ====> but now never the Netclients GetServers() find the NetServer (always -16)
* closing/Restarting the Clients doesn't helps
* ====> but if I close/restart my NetServer prog manually, immediately all the NetClients GetServers() return error 0 and the progs working as expected

Can there be a problem with the restart of the OS of the NetServer machine and running NetCleint progs in the LAN ? Do they loose track somehow ?

I'm totally lost here ! Any hints appreciated !
TIA. Thomas

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: GetServers() error after restart server
« Reply #9 on: July 27, 2015, 05:15:41 PM »
Hi Thomas, just a stab in the dark but could it be a permissions\firewall issue? How is the restart on the server different to when you manually restart? Is it running as a service etc?

peterH

  • Sr. Member
  • ****
  • Posts: 413
    • View Profile
Re: GetServers() error after restart server
« Reply #10 on: July 27, 2015, 07:25:50 PM »
Hi Thomas,
Another stab in the dark: does the NetServer program have any dependencies?

Quote
* now with the restart of hte VM my NetServer prog is also restarted and it runs fine !

What does "fine" mean in this context and how do you know?

Peter

tglomb

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
    • AObit Software
    • Email
Re: GetServers() error after restart server
« Reply #11 on: July 30, 2015, 10:53:31 AM »
@ Kevin
don't get me wrong. Wtih restarting the Servers I mean only the the VM's (the different Server OS's). My NetServer program is then started basing on a script (auto started).
Monday morning then I must do a teamviewer session into the VM where my prog is running (and the NetClients are accessing to), Close my prog and doubleclick start again. Thne everything is fine.

@ Peter
no further dependencies, everything is there whats needed. I know that it's running fine when the NetClients reacting on the data (which are filled by other non-NT progs in a shared database), Monday morning they simply don't see the NetServer prog, the data are definitely there.. The NetServer is running fine because it can prepare correctly the data for the NetClients which are coming from the nonNT prog. When strating the NetServer all the worker procedure are starting automatically. I can see from the Logs that the procedures starting and running fine.
Only the NetClients didn't see the NetServer..

Ciao (from Sardinia)

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: GetServers() error after restart server
« Reply #12 on: July 30, 2015, 03:00:02 PM »
Hi Thomas,

> Monday morning then I must do a teamviewer session into the VM where my prog is running (and the NetClients are accessing to), Close my prog and doubleclick start again. Thne everything is fine.

What happens if you close and restart using your script (not double clicking on your program). Does it work?

If it does, what user account is it running in when the server auto starts it with the script?

Maybe it is better to make your program a service and use the service options to start it on a re-boot. Again you need to check the permissions when it starts under the service account.

tglomb

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
    • AObit Software
    • Email
Re: GetServers() error after restart server
« Reply #13 on: August 02, 2015, 03:26:07 PM »
Hi Kevin,
script or direct starting makes no difference, it works after. The VM is starting into a Admin user (me, always the same) and then starts the mentioned prog and others too (no probs with the others non NT progs)..
If I have time again I'll try it as a service. But my experiences wit hservices are if it not runs as normal then it also not runs as a Service..
Ciao, Thomas

Poul

  • Full Member
  • ***
  • Posts: 160
    • View Profile
Re: GetServers() error after restart server
« Reply #14 on: August 17, 2015, 01:25:43 PM »
Hi Thomas,

Its not clear but I am assuming if everything is working and you simply reboot the Server VM it would work just fine? (without manual intervention)
causing you to believe the problem is with Sunday's scheduled reboots of all servers?

WAG, do you use Static IPs? If not perhaps a DHCP or DNS issue?
if you are rebooting all servers and workstations in the Network, perhaps your Server is starting before some other dependent server or service.
You could perhaps delay the starting of your Server VM or schedule a second restart.

otherwise if it never works from a reboot, something is wrong in your Startup approach on the Server VM 
perhaps delaying when you start the Nettalk application a few more minutes after the server has restarted would work.
(FWIW, I think it should be setup and tested as a service.)

poul