Whenever my UPS is connected via USB to my NAS, the NAS will automatically restart whenever it is powered off by any means. This includes:
Shutdown command in the Web GUI
Shutdown command in the console “GUI” (option 9)
Automatic shutdown due to going on battery power (!!!)
The behavior is the same in all three cases: As soon as the shutdown process is complete and about 2 seconds pass, the NAS just starts back up, as if the power button has been pressed.
This is especially terrible in the 3rd case. If there is a power loss, the NAS will shut down automatically after the configured 30 seconds, but then immediately boot back up still on battery power. It will complete boot up, realize it’s still on battery power and shut back down. Repeat until I plug the power back in!
This is not the “Restore on AC Power Loss” setting in my BIOS, which is set to “Power Off”.
This behavior stops if I unplug the USB connection to the UPS.
The “Power Off UPS” setting in the UPS service settings of TrueNAS makes no noticable difference to the behavior.
I am running TrueNAS SCALE ElectricEel-24.10.1 my UPS is a Eaton 5E.
You don’t mention any of your server hardware, but perhaps you can try a different USB-port? If you’ve tried USB 3.0-ones so far, try a USB 2.0 port or vice versa.
If that doesn’t help, are there USB settings in the BIOS you could play around with? Some motherboards let USB devices wake the computer, you likely don’t need that feature, try disabling it and see what happens, and so on.
@neofusion
It’s a low-budget home build from old-ish eBay hardware:
ASRock C226M WS
Intel Xeon E3-1225 v3
16GB ECC memory
I haven’t tried swapping USB ports yet, but will do so soon. Right now I have a long-running uninterruptible download running so I don’t want to do any reboots if I don’t have to. But I have already turned off any “allowed to wake the computer” settings in the BIOS long ago. If I remember there was USB, LAN, PS/2 and a bunch of other things. All of which are turned off.
Have you also disabled any option that keeps the USB-port powered when the computer is “off”? Use-case typically being that you connect your phone to your powered off computer to charge it. There may be more options in the USB-section that could change port behaviour in this situation, not just the things in the AC Power tab.
Looking through the manual I find these interesting options:
Chipset Configuration → On/Off Play - Disable
Chipset Configuration → Deep Sleep - I recommend trying with this off.
ACPI Configuration → Disable most if not all these “power on” or wake options if not done already.
While it’s a long shot, especially so because your issue doesn’t happen if the USB cable isn’t connected, but could this be due to an incorrectly or shorted power/reset chassis cable? You know, those thin ones that are always a pain to connect?
I assume you checked this already, but what are the settings in Truenas for the UPS service, it almost feels like it is set to power off as soon as it goes on battery.
If that is not it, how long does the UPS hold the server if the USB cable is not plugged in?
The buttons are not stuck, they both work fine on their own.
I don’t think it is a shorted cable, because this issue disappears if I disconnect the USB cable to the UPS.
It has an earth connection. I even tried running the NAS straight from the mains with a different cable, but still connected to the UPS via USB. The same behavior still happens with it rebooting.
It’s set to power off after 30 seconds of being on battery. This functions just fine. It just turns right back on, still on battery.
Here are the settings from the Web UI:
The “Power Off UPS” setting makes no difference either way and I cannot determine what it even does.
I honestly have not tried this and I am not sure I want to, because testing this would lead to a hard shutdown of the server, would it not? And it also seems to me like this would discharge the UPS battery to an unnecessarily deep level, which is bad for lead acid batteries. But maybe I am ignorant here.
Per specification the UPS can power a 100W load for 20 minutes. My NAS consumes roughly 60W on idle.
You do not appear to have anything in the ‘Shutdown Command’ box. I am not sure if there is a default one (there must be because your server shuts down!) and what it is. But I typed “shutdown -h now” (without the inverted commas) in this box, and this might be worth a try. Just in case the default is a reset or something!
PS the default is apparently “shutdown -P now”. I have never used it so I don’t know what effect it has on standard motherboards. Might be worth trying -h perhaps?
The issue is unrelated to the shutdown command, because it even happens when I shut down the machine unrelated to the UPS. Regardless, I tried your suggestion, but it made no difference.
Probably, because -h is “equivalent to --poweroff”, which is the same as -P. So it is the same command regardless.
I mean, this is a stretch, but maybe it is BIOS related, does there happen to be a new version of BIOS for your system? It seems like reboot after power loss is recognizing a shutdown as a power loss? Weird, but worth looking at.
The BIOS is up to date, for some definition of “up to date”. This is an older board, so the latest version is from 2018, but it is the latest version.
But again, this is not a power loss situation. This is a normal, bog-standard shutdown via the GUI. It also happens if it is a UPS-induced shut-down, but it happens for all shutdown commands issued via software, as long as the UPS is connected via USB.
The NUT software is not supposed to be able to turn the computer on, nor is it supposed to wake on USB activity according to your checks. It is hard to see this as anything other than a hardware electrical problem. Is the UPS earthed? Is there any voltage to earth measurable on the usb lead shield or negative pin? Does it happen with a different usb lead attached to the UPS?