Unable to save UPS configuration

LKO

Cadet
Joined
Jun 22, 2020
Messages
7
I've got an odd interface problem when editing my UPS configuration. I want to change the shutdown timer from 30 to 300 seconds. I change the value, but I cannot get the save button to enable. Running FreeNAS-11.3-U3.2, using Firefox from a linux system to access the FreeNAS web site. Tried flushing the browser cache, to no avail.
I also tried manually editing upssched.conf via SSH, but the system at some point overrides the file with the values from the web site.
How do I get that pesky save button to enable?
 

jlpellet

Patron
Joined
Mar 21, 2012
Messages
287
I have a vague recollection of a similar issue, resolved by adding a value in the "Monitor Password" field. I used my root pwd. Goog luck.
 

LKO

Cadet
Joined
Jun 22, 2020
Messages
7
That field already has a value in it, from when the UPS was added months ago. The UPS service was configured back then (when the FreeNAS version was 11.2.x), and was running fine in slave mode. Upgraded to 11.3 about four months ago. After an extended power loss yesterday, I thought I should tweak a couple of the units slaved to the UPS. That's when I discovered I could change fields on the screen, but the save button never enables for me to save the changes.
I think that I will backup the config, and see if I can change the value directly in the database. That, or see if I can change the value through the API.
 

LKO

Cadet
Joined
Jun 22, 2020
Messages
7
Worked around the problem.
ssh'ed in, then:
sqlite3 /data/freenas-v1.db
> select * from services_ups;
Only had one ups defined, so I could just do this:
> update services_ups set ups_shutdowntimer=300;
> .exit

Restarted the UPS service from the web page, and the new value was used. Guess it's a GUI-bug that will be fixed sometime. Until then, I can just edit the database directly.
 

LKO

Cadet
Joined
Jun 22, 2020
Messages
7
Just an update to this issue; still seems to exist. Have updated to TrueNAS-12.0-U4.1, needed to change the email used for UPS alerts, and the same issue. Update the GUI, but the save-button never enables. Had to edit the database directly again.
 

ChrisRJ

Wizard
Joined
Oct 23, 2020
Messages
1,919
What happens if you delete the entry from the DB altogether and then reboot? That GUI behavior indicates that some of the underlying data are not "to its taste", perhaps combined with some kind of caching issue.
 

rogerh

Guru
Joined
Apr 18, 2014
Messages
1,111
If I have understood the problem aright this is a feature, not a bug. If the FreeNAS server is acting as a NUT slave, then the computer that is controlling the UPS decides the delay before shutdown, and notifies the slaves a defined time before it shuts down itself and, usually, switches the UPS off. The slave does not shutdown on the basis of the UPS status but on the instructions of the NUT master computer. If the master shuts down the UPS before FreeNAS has decided to shutdown that is a Bad Thing. Even if the master does not shut down the UPS it ceases to communicate with slaves when it shuts down so FreeNAS will not know if the mains comes back on or the UPS runs out of battery. The GUI wants you to shut down a few seconds after the NUT master suggests it, and does not allow settings that would frustrate this.
 

LKO

Cadet
Joined
Jun 22, 2020
Messages
7
What happens if you delete the entry from the DB altogether and then reboot? That GUI behavior indicates that some of the underlying data are not "to its taste", perhaps combined with some kind of caching issue.

This is a good diagnostic; I'll have to try this when I get some time and the NAS isn't busy. I will delete the row, reboot, and see if I can enter the data again. Now, I do know the screen worked at least once, when I first set up NUT on it. Just seems that once I did that initial setup, it wouldn't let me change anything after that.
 

LKO

Cadet
Joined
Jun 22, 2020
Messages
7
If I have understood the problem aright this is a feature, not a bug. If the FreeNAS server is acting as a NUT slave, then the computer that is controlling the UPS decides the delay before shutdown, and notifies the slaves a defined time before it shuts down itself and, usually, switches the UPS off. The slave does not shutdown on the basis of the UPS status but on the instructions of the NUT master computer. If the master shuts down the UPS before FreeNAS has decided to shutdown that is a Bad Thing. Even if the master does not shut down the UPS it ceases to communicate with slaves when it shuts down so FreeNAS will not know if the mains comes back on or the UPS runs out of battery. The GUI wants you to shut down a few seconds after the NUT master suggests it, and does not allow settings that would frustrate this.

Good point. There seems to be a more general problem with the page, in that once I did the initial setup, it has refused to let me change anything, even after a few software upgrades. I'm going to play with it when I get the chance, and I do have a workaround, so it's not bothering me too much.
 

seb101

Contributor
Joined
Jun 29, 2019
Messages
142
I can confirm this bug. I have had the same UPS setup since the 11.x days and now I need to change the UPS identifer field. I am unable to do this in the GUI as nothing I try enables the 'Save' button.
 

LKO

Cadet
Joined
Jun 22, 2020
Messages
7
I admit laziness has stopped me from trying the "delete the row and reenter the data again" test. In the end, I just went into SQL and hand-edited the row. I may not push myself to go beyond hand-editing the UPS settings until I decide to rearrange the whole UPS signalling timing/master-slaves thing. And that isn't a TrueNAS question, but a NUT question, that I'll deal with later. For now it seems to be working.

@seb101, if you are handy with SQL, then you can just try what I did above. Or, if you don't mind tinkering, just delete the UPS setup in TrueNAS and set it up again. That would be a nice bit of diagnostic information to know if the GUI only works once, or if it gets "locked down" once the initial entry is saved.
 
Top