Jump to content

Auto Restart Certain Node Servers


Recommended Posts

Is there a way to automatically restart a certain node server from IoX or another device?  Since upgrading to 3x quite often if the Polisy is rebooted certain node servers will show online but will not really be working until I restart them.  For instance the Hue node server this morning that it is working but when I use IoX to turn on a Hue light I get an ND_slot error pop up.  Restarting the Hue node server fixes it.  I also see this with Ecobee and Elk node servers.  Possibly Kasa as well.  

What I'd like to be able to do is run a test program after a reboot that would turn on a light and then check to see if that light came on or not and if it did not then send me a notification but also restart that node server in the meantime.

Not sure it's related but the only way I can see the logs for any of the node servers is to download them, the real time just pops up a green window saying starting events log but I never see the logs.

I am on 3.2.2 but expect to update to 3.2.3 later today.

Thank you!

Edited by btreinders
Link to comment

@btreinders maybe @gregkinney can help you out as he just wrote something to do this. 

The underlying issue is that this shouldn't be necessary and issues should be addressed with the node server developer and/or UDI rather than thinking that just a random/nightly restart will "resolve" the issue. Not only would it help your situation, but could help the community as a whole for more reliable node server implementation. 

I run the Hue node server on eisy (PG3x) and don't have issues with it at the present time. In some early PG3x versions there would be issues after eisy update/reboot, but not in the last few months have I experienced a problem with it not running after eisy restarts. 

Link to comment

I have the Ecobee node server and I will agree with @Jimbo.Automates that it never needs to be restarted, however, the Hue node server is the one that caused me to previously post about restarting PG3. It would stop working until restarted about 1-2 times per month. As @Geddy mentions, his suggested format for dealing with these things is best. However, if you wish to shortcut that and do a band-aid, I did write a python script that restarts my PG3 nightly. I would be happy to share it with you and if you need, help you install it but you would need a Raspberry Pi or PC that's always on (or at least on during the time you want the script to run).

Link to comment

There are pros and cons to restarting PG3x often.   

If the node servers are having issues and not properly recovering from errors (which is really a bug in the node server), then restarting them may mask/hide the problem.  However, it's always best to try and work with either the node server author or UDI to get the node server bugs resolved, that helps everyone.

However, when PG3x starts, it has to start up all of the node servers which happens in a fairly short period of time.  In most cases, the node servers then try to update all of their data so the IoX gets blasted with everything all at once.  Depending on the node servers and number of node servers, this can overwhelm the IoX, possibly causing it to drop incoming connections.  In some cases, this can cause more issues with the node servers.

We've tried to minimize the start up issues, so normally this isn't a problem, but we've designed the system with the assumption that PG3x will typically only be restarted infrequently.

Given the 119 node servers that are now available, I'm only running a few of them.  But my Polisy was restarted for the first time in many many months about 3 days ago when we had a power outage that outlasted the battery backup.

  • Like 2
Link to comment

Understood on all.  I agree that restarting PG3.x often is a bad idea.  I just wondered if it was possible to automate restarting just one node server.  I will work with the developers to get any issues corrected for sure.  Maybe in the future PG3x can start node servers one by one after a restart to relieve the stress on IoX?  

Thank you for the responses.

 

 

  • Like 1
Link to comment
  • 2 weeks later...

I have the same question.  For the ST-Sonos node server requires regular restarts.  I have, in the past worked with both the developer and separately opened a ticket but we never got to the bottom it.  On average, I will find it in a failed state about twice a week.  While I'd of course love it if whatever is causing it to be addressed, in the interim, it would be great to programmatically restart regularly.

Link to comment
15 minutes ago, bcdavis75 said:

I have the same question.  For the ST-Sonos node server requires regular restarts.  I have, in the past worked with both the developer and separately opened a ticket but we never got to the bottom it.  On average, I will find it in a failed state about twice a week.  While I'd of course love it if whatever is causing it to be addressed, in the interim, it would be great to programmatically restart regularly.

Do you still have the ticket number?  I'd like to take a look at it now that I'm maintaining that node server.

Going into the failed state twice a week is definitely not normal. 

A lot of times, the node servers are written to handle normal behaviors, but don't handle unexpected issues very well.  It may be that something external to the node server is causing a failure that it's just not designed to handle.  It can be hard for developers to account for that when they don't see the same external issue.  I've been trying to be better at this so if I can see why/where it's failing, maybe I can make it recover properly.

Link to comment
On 9/11/2023 at 1:01 PM, bpwwer said:

Do you still have the ticket number?  I'd like to take a look at it now that I'm maintaining that node server.

Going into the failed state twice a week is definitely not normal. 

A lot of times, the node servers are written to handle normal behaviors, but don't handle unexpected issues very well.  It may be that something external to the node server is causing a failure that it's just not designed to handle.  It can be hard for developers to account for that when they don't see the same external issue.  I've been trying to be better at this so if I can see why/where it's failing, maybe I can make it recover properly.

[Ticket #19329] ST-SONOS NS failure

Link to comment

@bcdavis75 Thanks!

I don't see anything in the logs that you originally attached to the ticket so the next time it is in the "failed" state, please download the log package before re-starting it.  Then PM me the package.

For the log to be useful, it needs to be downloaded on the same day that the node server failed. 

Link to comment
Guest
This topic is now closed to further replies.

×
×
  • Create New...