Bug 1468835 - usbhid-ups will exit on error instead of retrying
usbhid-ups will exit on error instead of retrying
Status: NEW
Product: Fedora
Classification: Fedora
Component: nut (Show other bugs)
Unspecified Unspecified
unspecified Severity low
: ---
: ---
Assigned To: Michal Hlavinka
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2017-07-08 12:02 EDT by David Hill
Modified: 2017-08-15 05:25 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
logs and /etc/ups folder (541.23 KB, application/x-gzip)
2017-07-17 15:58 EDT, David Hill
no flags Details

  None (edit)
Description David Hill 2017-07-08 12:02:41 EDT
Description of problem:
usbhid-ups will exit on error instead of retrying and at this point, I'm not sure if it's a hardware issue or if it's a driver/nut issue.  The UPS is a brand new SMART1500LCD (Bus 007 Device 002: ID 09ae:3016 Tripp Lite)

Jul 08 11:45:32 zappa.orion systemd[1]: Starting Network UPS Tools - power device driver controller...
Jul 08 11:45:32 zappa.orion upsdrvctl[12138]: Using subdriver: TrippLite HID 0.82
Jul 08 11:45:32 zappa.orion upsdrvctl[12138]: Network UPS Tools - Generic HID driver 0.41 (2.7.4)
Jul 08 11:45:32 zappa.orion upsdrvctl[12138]: USB communication driver 0.33
Jul 08 11:45:33 zappa.orion usbhid-ups[12141]: Startup successful
Jul 08 11:45:33 zappa.orion upsdrvctl[12138]: Network UPS Tools - UPS driver controller 2.7.4
Jul 08 11:45:33 zappa.orion systemd[1]: Started Network UPS Tools - power device driver controller.
Jul 08 11:46:59 zappa.orion usbhid-ups[12141]: libusb_get_report: Input/output error
Jul 08 11:47:01 zappa.orion usbhid-ups[12141]: Can't claim USB device [09ae:3016]: No such file or directory
Jul 08 11:47:01 zappa.orion systemd[1]: nut-driver.service: Main process exited, code=exited, status=1/FAILURE
Jul 08 11:47:01 zappa.orion systemd[1]: nut-driver.service: Unit entered failed state.
Jul 08 11:47:01 zappa.orion systemd[1]: nut-driver.service: Failed with result 'exit-code'.

Version-Release number of selected component (if applicable):

How reproducible:
Every minutes or so

Steps to Reproduce:
1. Configure a tripp lite SMART1500LCD in nut
2. One once in a while do a "upsc myups"

Actual results:
At some point, usbhid-ups will die and upsc no longer returns something useful

[root@zappa ups]# upsc myups
Init SSL without certificate database
Error: Driver not connected
Init SSL without certificate database

[root@zappa ups]# systemctl restart nut-driver
[root@zappa ups]# upsc myups | wc -l

Expected results:
Some kind of retry might be great if it's possible

Additional info:
This is a new device connected via USB on a Rawhide Fedora installation.  Also since I don't have another device to test this one, I don't know if it's a device issue, a driver issue or something else.
Comment 1 Michal Hlavinka 2017-07-10 07:29:31 EDT
This seems like usb device stealing. Do you have ModemManager installed? Do you use it/needed? If not, try to uninstall it and see if it helps.
Comment 2 David Hill 2017-07-10 14:21:51 EDT
The service is not running:

[root@zappa .ssh]# systemctl list-unit-files | grep -i modem
ModemManager.service                        disabled

Should I still uninstall it?
Comment 3 David Hill 2017-07-10 14:36:09 EDT
I uninstalled it and restarted the services but it still goes away every now and then.
Comment 4 Michal Hlavinka 2017-07-11 11:24:08 EDT
Yes, uninstallation is necessary, as it is triggered by dbus and hw detection, not usual service.

Please reboot your machine. Wait for the problem to occur and then attach:
1) dmesg output
$ dmesg >dmesg.log

2) journal "since boot" output
$ journalctl -b >journal.log

3) your ups configuration

Also, before attaching here, check your configuration does not contain any passwords. If they do, replace passwords with some other strings.

PS: Please do not overuse needinfo feature. It's for specific use cases:
1) answer is really urgent - like blocker bugs that needs to be solved so product can be released on schedule
2) you get no answer for a really long time
3) you need answer from someone else than reporter/assignee
Comment 5 David Hill 2017-07-17 15:58 EDT
Created attachment 1300082 [details]
logs and /etc/ups folder
Comment 6 Michal Hlavinka 2017-07-20 08:06:33 EDT
Thanks for the logs. As a first attempt, please try to change your [myups] configuration in ups.conf to the following:

driver = usbhid-ups
pollinterval = 10
vendorid = 09ae
port = auto

restart all nut related services (or reboot the computer) and check if it helps.
Comment 7 David Hill 2017-07-20 11:26:21 EDT
It did the same thing.  Need the logs?  Is rebooting really necessary because of systemd or something or it's only because you want to make sure nut-* were restarted ?
Comment 8 Michal Hlavinka 2017-07-21 11:16:18 EDT
Logs are not needed this time. 

Rebooting is not necessary if you restart nut properly. Better way is to stop all nut-*.service and then start it

Try to edit /usr/lib/systemd/system/nut-driver.service
and in the [Service] section, add


and see if it helps.

You will need to reboot 


reload systemd config with
$ systemctl daemon-reload
and stop+start nut services
$ systemctl stop nut-driver.service nut-server.service nut-monitor.service
$ systemctl start nut-server.service nut-monitor.service
(nut-driver service will be start automatically as a dependency)

If it does not help, please attach the journal log. I will look at it once I'm back from vacation
Comment 9 David Hill 2017-07-27 19:17:54 EDT
I got this now:

Init SSL without certificate database
Error: Data stale
Init SSL without certificate database
Error: Data stale
Init SSL without certificate database
Error: Data stale
Comment 10 Michal Hlavinka 2017-08-10 09:26:41 EDT
Where do you see those messages?
Did the restart configuration help or not?
Comment 11 David Hill 2017-08-11 10:07:10 EDT
I see that when I run "upsc myups" and at some point, the drivers will stop loading and the only way I've found to recover from that is to actually disconnect the USB cable and reconnect it.
Comment 12 Jan Kurik 2017-08-15 05:25:54 EDT
This bug appears to have been reported against 'rawhide' during the Fedora 27 development cycle.
Changing version to '27'.

Note You need to log in before you can comment on or make changes to this bug.