gawindx / WinNUT-Client

This is a NUT windows client for monitoring your ups hooked up to your favorite linux server.
GNU General Public License v3.0
380 stars 70 forks source link

Cancellation of the extinguishing process #98

Open tzeappa opened 2 years ago

tzeappa commented 2 years ago

Hello, I encounter this strange behavior that after the UPS switches to battery and back again to AC the WinNut client keeps popping up and doing "Cancellation of the Extinguishing Process". This happens usually for days and I have no way of stopping it. Is this normal and if not, maybe there's something in the settings that I'm doing wrong. Can you please help me with some info?

Thank you!

gbakeman commented 2 years ago

That phrase is slightly confusing to me as an English speaker, but the resource is being used in UPS_Network.vb. it looks like the program has detected the UPS coming back online, and is trying to cancel a shutdown. It should only do this once when the UPS comes back, so this doesn't sound like intended behavior. The network code is about to get an overhaul so this bug should be hit then. Thanks for reporting!

eats7 commented 2 years ago

yup having the same issue, and on the newest development branch, it triggers a shutdown event as soon as the app is opened now. even though the battery charge is at 100 percent. I've had to uninstall it as i cant use it having this window pop in and out every second.

RBLink001 commented 2 years ago

yup having the same issue, and on the newest development branch, it triggers a shutdown event as soon as the app is opened now. even though the battery charge is at 100 percent. I've had to uninstall it as i cant use it having this window pop in and out every second.

I have the same behaviour. The only way to avoid it is to disconnect USB cable between UPS (APC) and NAS (Synology). After reconnecting the USB cable, it works normally.

tzeappa commented 2 years ago

I have discovered that rebooting my Synology will resolve the issue, I suppose it's something on the NUT server installed on the nas, not sure what exactly... I haven't tried disconnecting the USB.

gbakeman commented 2 years ago

I have discovered that rebooting my Synology will resolve the issue, I suppose it's something on the NUT server installed on the nas, not sure what exactly... I haven't tried disconnecting the USB.

Have you upgraded to DSM 7? I've had issues with the upsd server misbehaving in DSM 6 requiring either a service restart via command line or rebooting like you said. I remember Synology at least mentioning NUT in their release notes so I wonder if that might help.

tzeappa commented 2 years ago

I have discovered that rebooting my Synology will resolve the issue, I suppose it's something on the NUT server installed on the nas, not sure what exactly... I haven't tried disconnecting the USB.

Have you upgraded to DSM 7? I've had issues with the upsd server misbehaving in DSM 6 requiring either a service restart via command line or rebooting like you said. I remember Synology at least mentioning NUT in their release notes so I wonder if that might help.

I did, I'm on DSM 7. I tried rebooting the service but the old script doesn't work anymore thus the only option was rebooting.

gbakeman commented 2 years ago

Ok, good to know, unfortunately. Sorry this is taking so long, I'm going back and forth between developing the underlying library and implementing it into WinNUT (see issue #54 for more info). It's going to take longer than I thought since the last update.

coldfire0200 commented 2 years ago

I just started using WinNUT and notice the issue with Synology Network UPS Server (DS920+, DSM7). This happens when I turn on the vacuum cleaner and surge trips the UPS momentarily. The problem is that, before UPS is tripped, the status is "OL", after UPS enters and leaves battery mode, it status stuck to "FSD OL". Since UPS_Network processes each word in the status string, it first encounters "FSD" however this raises the exception and skips all subsequent words, thus "OL" never has a chance to cancel the shutdown. And the status will be stuck in "FSD OL" until you restart the Synology. Also the UPS_Follow_FSD does not seem to control anything, I previously assume it controls handling of FSD but actually not. the FSD is processed regardless. Two things I have to made to the code as workaround:

If UPS_Follow_FSD Then LogFile.LogTracing("Stop condition imposed by the NUT server", LogLvl.LOG_NOTICE, Me, WinNUT_Globals.StrLog.Item(AppResxStr.STR_LOG_NUT_FSD)) ShutdownStatus = True End If

And after processed all word in status string, I would do:

If ShutdownStatus Then RaiseEvent Shutdown_Condition() End If

The idea is: 1) only process FSD when flag is set 2) FSD does not raise exception right away, instead it only raise exception when all words are processed and ShutdownStatus is still true Item 1 is really not quite necessary but I did it anyway.

g-cranston commented 2 years ago

I experience this issue also, with a Synology as UPS server, which I assume (for me anyway) is related to https://community.synology.com/enu/forum/17/post/102712

It seems more like a Synology bug with the information that it passes from its UPS server. For me, after power is restored and charging again, it sometimes (not always) either continues to indicate in Windows NUT Client "UPS on battery", or returns back to "UPS On Line" for a short period before then switching again to "UPS on battery". This status only seems to exist on the NUT clients, not on the actual UPS or NAS info itself. I assume what is happening is that the UPS server is sending some On Battery/FSD signal continuously (it doesn't do this when it goes onto battery initially). The client says "Stop condition imposed by the NUT server", then "Cancellation of the Extinguishing Process". Thankfully it doesn't just shutdown with this (not sure why!), however the option "Shutdown on Nut's FSD signal" is set.

I had been disabling/reenabling the UPS in the Synology control panel, but I noted the suggestion of just reinserting the USB cable which resolves the issue much more easily!

shaarkys commented 2 years ago

Funny, have exactly the same issues, I had even to record slowmotion video to catch this popup - thanks all for the workarounds ! I was almost thinking I have been hacked...

thebatfink commented 2 years ago

Also have this problem. Server is also DSM 7 synology. On my win 10 client after it boots up, shortly after this starts appearing over and over and it causes a popup to keep flashing up interfering with use of the desktop so I have to kill the program. No power outages or anything, just running the app.