NUT is in a Shutdown loop and has other odd behavior

Started by vk2him, May 21, 2025, 09:07:07 AM

Previous topic - Next topic
I'm running the latest OPNsense 25.1.7_2-amd64 and the issues below occurred on the previous 25.1.6

I had NUT running fine for quite a while in Netclient mode connected to a Cyberpower UPS that is connected to a Synology NAS.

I got a second CyberPower UPS this week with the OPNsense NUC now being powered by it (previously it wasn't UPS protected as it's on a different floor to the Synology). So now I wanted OPNsense to work in Standalone mode connected to the USB UPS that's right next to it.

In the NUT UPS Type tab I unticked Netclient, saved and restarted the service, then Enabled Standalone and the USB-HID Driver option, plugged in the USB into the OPNsense NUC and restarted the service.

The Diagnostics shows it's still connected to the Netclient mode UPS in the garage and it won't recognise the standalone UPS plugged into the USB port. I tried all sorts of combinations and it always showed it was still connected via netclient.

So I uninstalled NUT, reinstalled it and rebooted OPNsense. Immediately when OPNsense starts up, it shuts down. It look me a few restarts to quickly go into the GUI and disable NUT to prevent the loop.

Here's the log when it starts then shuts down - 192.168.1.252 is the Synology NAS

2025-05-21T14:47:52 Notice kernel ---<<BOOT>>---
2025-05-21T14:47:52 Notice syslog-ng syslog-ng starting up; version='4.8.2'
2025-05-21T14:46:19 Notice kernel <6>ovpns1: link state changed to DOWN
2025-05-21T14:46:18 Notice syslog-ng syslog-ng shutting down; version='4.8.2'
2025-05-21T14:45:56 Notice upsmon Auto logout and shutdown proceeding
2025-05-21T14:45:56 Critical upsmon Executing automatic power-fail shutdown
2025-05-21T14:45:56 Notice upsmon UPS ups@192.168.1.252:3493: forced shutdown in progress
2025-05-21T14:45:51 Notice configctl event @ 1747802750.95 exec: system event config_changed response: OK
2025-05-21T14:45:51 Error upsmon Login on UPS [ups@192.168.1.252:3493] failed - got [ERR ACCESS-DENIED]

So even though I have disabled Netclient mode, it's still trying to connect, it fails, then 5 seconds later it decides to shutdown.

Looking at the logs, at one stage it did recognise the UPS via USB, but disconnected/attempted again which I discovered by googling that some Cyberpower UPS do this until they connect to the driver?

2025-05-21T14:34:59 Notice kernel ugen0.2: <CPS BR1200ELCD> at usbus0 (disconnected)
2025-05-21T14:34:59 Notice kernel ugen0.2: <CPS BR1200ELCD> at usbus0
2025-05-21T14:34:59 Notice kernel ugen0.2: <CPS BR1200ELCD> at usbus0 (disconnected)
2025-05-21T14:34:59 Notice kernel ugen0.2: <CPS BR1200ELCD> at usbus0
2025-05-21T14:34:59 Notice kernel ugen0.2: <CPS BR1200ELCD> at usbus0 (disconnected)
2025-05-21T14:34:59 Notice kernel ugen0.2: <CPS BR1200ELCD> at usbus0

Any suggestions would be appreciated - I'm not too keen to re-enable NUT as I think it will shutdown as soon as I enable it?

Quote from: vk2him on May 21, 2025, 09:07:07 AMI'm running the latest OPNsense 25.1.7_2-amd64 and the issues below occurred on the previous 25.1.6

I had NUT running fine for quite a while in Netclient mode connected to a Cyberpower UPS that is connected to a Synology NAS.
I got a second CyberPower UPS this week with the OPNsense NUC now being powered by it (previously it wasn't UPS protected as it's on a different floor to the Synology). So now I wanted OPNsense to work in Standalone mode connected to the USB UPS that's right next to it.

In the NUT UPS Type tab I unticked Netclient, saved and restarted the service, then Enabled Standalone and the USB-HID Driver option, plugged in the USB into the OPNsense NUC and restarted the service.

The Diagnostics shows it's still connected to the Netclient mode UPS in the garage and it won't recognise the standalone UPS plugged into the USB port. I tried all sorts of combinations and it always showed it was still connected via netclient.

So I uninstalled NUT, reinstalled it and rebooted OPNsense. Immediately when OPNsense starts up, it shuts down. It look me a few restarts to quickly go into the GUI and disable NUT to prevent the loop.

Here's the log when it starts then shuts down - 192.168.1.252 is the Synology NAS

2025-05-21T14:47:52    Notice    kernel    ---<<BOOT>>---   
2025-05-21T14:47:52    Notice    syslog-ng    syslog-ng starting up; version='4.8.2'   
2025-05-21T14:46:19    Notice    kernel    <6>ovpns1: link state changed to DOWN   
2025-05-21T14:46:18    Notice    syslog-ng    syslog-ng shutting down; version='4.8.2'   
2025-05-21T14:45:56    Notice    upsmon    Auto logout and shutdown proceeding   
2025-05-21T14:45:56    Critical    upsmon    Executing automatic power-fail shutdown   
2025-05-21T14:45:56    Notice    upsmon    UPS ups@192.168.1.252:3493: forced shutdown in progress   
2025-05-21T14:45:51    Notice    configctl    event @ 1747802750.95 exec: system event config_changed response: OK   
2025-05-21T14:45:51    Error    upsmon    Login on UPS [ups@192.168.1.252:3493] failed - got [ERR ACCESS-DENIED]

So even though I have disabled Netclient mode, it's still trying to connect, it fails, then 5 seconds later it decides to shutdown.

Looking at the logs, at one stage it did recognise the UPS via USB, but disconnected/attempted again which I discovered by googling that some Cyberpower UPS do this until they connect to the driver?

2025-05-21T14:34:59    Notice    kernel    ugen0.2: <CPS BR1200ELCD> at usbus0 (disconnected)   
2025-05-21T14:34:59    Notice    kernel    ugen0.2: <CPS BR1200ELCD> at usbus0   
2025-05-21T14:34:59    Notice    kernel    ugen0.2: <CPS BR1200ELCD> at usbus0 (disconnected)   
2025-05-21T14:34:59    Notice    kernel    ugen0.2: <CPS BR1200ELCD> at usbus0   
2025-05-21T14:34:59    Notice    kernel    ugen0.2: <CPS BR1200ELCD> at usbus0 (disconnected)   
2025-05-21T14:34:59    Notice    kernel    ugen0.2: <CPS BR1200ELCD> at usbus0

Any suggestions would be appreciated - I'm not too keen to re-enable NUT as I think it will shutdown as soon as I enable it?

You can fix the issue by manually clearing old NUT config files via SSH and setting up a fresh standalone configuration for your USB-connected UPS. You can then verify detection with usbconfig and configure ups.conf, upsmon.conf, and nut.conf to avoid fallback to the previous Netclient setup.