Failed to start NUT-UPS service due to a system error. Check the service is configured correctly via it's spanner icon

Brief description of the problem

I have a rack mount APC SMART UPS 1500. Just trying to set nut-ups where I’ll have another server connected to it.

Detailed step by step instructions to reproduce the problem

Went to configuration first. Set it up. Then went to click the start

Web-UI screenshot

[Drag and drop the image here]

Error Traceback provided on the Web-UI

Traceback (most recent call last):
  File "/opt/rockstor/src/rockstor/smart_manager/views/nut_service.py", line 41, in post
self._switch_nut(command, self._get_config(service))
  File "/opt/rockstor/src/rockstor/smart_manager/views/nut_service.py", line 64, in _switch_nut
systemctl('nut-server', 'start')
  File "/opt/rockstor/src/rockstor/system/services.py", line 63, in systemctl
return run_command([SYSTEMCTL_BIN, switch, service_name])
  File "/opt/rockstor/src/rockstor/system/osi.py", line 98, in run_command
raise CommandException(cmd, out, err, rc)
CommandException: Error running a command. cmd = ['/usr/bin/systemctl', 'start', 'nut-server']. rc = 1. stdout = ['']. stderr = ["A dependency job for nut-server.service failed. See 'journalctl -xe' for details.", '']

Per the above, these are the logs around that time:

Jul 04 10:24:06 rockstor systemd[1]: Reloading.
Jul 04 10:24:06 rockstor systemd[1]: Configuration file /usr/lib/systemd/system/auditd.service is marked world-inaccessible. This has no effect as configuration data is accessible via APIs without restrictions. Proceeding anyway.
Jul 04 10:24:06 rockstor systemd[1]: Configuration file /usr/lib/systemd/system/wpa_supplicant.service is marked executable. Please remove executable permission bits. Proceeding anyway.
Jul 04 10:24:07 rockstor systemd[1]: Starting Network UPS Tools - power device driver controller...
-- Subject: Unit nut-driver.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit nut-driver.service has begun starting up.
Jul 04 10:24:07 rockstor systemd-tmpfiles[15406]: Failed to open '/etc/tmpfiles.d/nut-run.conf', ignoring: No such file or directory
Jul 04 10:24:07 rockstor upsdrvctl[15409]: Error: you must specify a port name in ups.conf. Try -h for help.
Jul 04 10:24:07 rockstor upsdrvctl[15409]: Network UPS Tools - APC Smart protocol driver 3.1 (2.7.2)
Jul 04 10:24:07 rockstor upsdrvctl[15409]: APC command table version 3.1
Jul 04 10:24:07 rockstor systemd[1]: nut-driver.service: control process exited, code=exited status=1
Jul 04 10:24:07 rockstor systemd[1]: Failed to start Network UPS Tools - power device driver controller.
-- Subject: Unit nut-driver.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit nut-driver.service has failed.
--
-- The result is failed.
Jul 04 10:24:07 rockstor systemd[1]: Dependency failed for Network UPS Tools - power devices information server.
-- Subject: Unit nut-server.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit nut-server.service has failed.
--
-- The result is dependency.
Jul 04 10:24:07 rockstor systemd[1]: Job nut-server.service/start failed with result 'dependency'.
Jul 04 10:24:07 rockstor systemd[1]: Unit nut-driver.service entered failed state.
Jul 04 10:24:07 rockstor systemd[1]: nut-driver.service failed.
Jul 04 10:24:07 rockstor upsdrvctl[15409]: Driver failed to start (exit status=1)
Jul 04 10:24:07 rockstor upsdrvctl[15409]: Network UPS Tools - UPS driver controller 2.7.2

@xantonin Hello again and thanks for the report. From the logs it looks like this driver is complaining about not having a port entry. I think this can result from the wrong driver being selected. Which one did you select during the NUT-UPS configuration? And what type of cable connects your Rockstor machine to the UPS?

From the link provided on the configuration page Hardware compatibility list for guidance which doesn’t list your model specifically, it is worth trying the usbhid-ups driver; assuming of course your cable interconnect is USB.

And from Smart-UPS 1500 page on the networkupstools.org site we have:-

This device is known to work with driver usbhid-ups.

so it looks like this is the one to go for when using USB interconnect which is much preferred anyway. Plus that driver should work with the ‘auto’ port setting and has a higher ‘Support level’ rating on that first page than the alternative apcsmart driver.

Hope that helps.

Hi, thanks again for the reply! Sorry for the missing details; I was using the “apcsmart” driver which I thought was correct from researching the hardware compatibility guide, but I think I’ll try the usbhid-ups driver. It is USB connected.

I got the same error though - however I see now that I am leaving the “port” field blank. I thought that the auto listed in the field was populated.

Looks like I have to actually type in auto. So, just an end user/UI error. I didn’t go back and test if “apcsmart” would work if I manually typed auto, but it probably would.

Thanks again!

1 Like

@xantonin Yes the greyed out entries are suggestions and in this case it is a little tricky as each driver has different options it can work with for port and I don’t think the apcsmart driver does support the auto setting so don’t think that is worth trying, also it’s a less highly rated driver so probably best to stick with usbhid-ups; even though it’s more generic.

You should be good to just type the suggested auto and Submit the change as the rest looks good. Nice to see someone using the netserver mode by the way.

Thanks for the update and we could probably do better on the user prompts here. I am due to revisit / extend this interface in time but that will probably not be for a while yet.

For what its worth, the grayed out “auto” setting had me scratching my head too. When you know that a grayed out text is a suggestion, this method of presenting the information is very intuitive. If you don’t know that grayed out test is a suggestion but think it is a default, it can be irritating.

As I’m not super familiar with all of the possibilities of configuring services, is it ever appropriate to leave that field blank? If not, perhaps an asterisk should appear when you click on the submit button and indicate that it needs to be manually filled out. On the other hand, forcing someone to fill stuff out that isn’t really required is just as irritating, especially if it causes the setup to fail. Maybe issue a pop up stating that it looks like indicated fields are blank and suggest that the user fill it in but have a, “No, I really do want to submit this configuration as-is!” button would be appropriate.

Thanks All

This fixed my issue too.

I have an APC Smart-UPS 1000VA: I scanned down the Hardware Compatibility List and saw that I needed the apcsmart driver for my Smart-UPS. This didn’t work for me, but I found this thread and tried the usbhid-ups (with “auto” typed into the USB Port) and it worked.

Looking back at the HCL I can see that the “Smart-UPS USB USB” option does indeed take the usbhid-ups :slight_smile:

@f2fbf60b Glad it worked for you and a belated welcome to the Rockstor community.

Thanks for confirming the configuration with this model.

Thank you for this information, it helps me too. I have an apc pro model.