Bug 1468835

Summary: usbhid-ups will exit on error instead of retrying
Product: [Fedora] Fedora Reporter: David Hill <dhill>
Component: nutAssignee: Michal Hlavinka <mhlavink>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: 27CC: dhill, mhlavink
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-11-30 17:52:21 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
logs and /etc/ups folder none

Description David Hill 2017-07-08 16:02:41 UTC
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):
nut-2.7.4-9.fc27.x86_64

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"
3.

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
45

[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 11:29:31 UTC
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 18:21:51 UTC
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 18:36:09 UTC
I uninstalled it and restarted the services but it still goes away every now and then.

Comment 4 Michal Hlavinka 2017-07-11 15:24:08 UTC
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 19:58:17 UTC
Created attachment 1300082 [details]
logs and /etc/ups folder

Comment 6 Michal Hlavinka 2017-07-20 12:06:33 UTC
Thanks for the logs. As a first attempt, please try to change your [myups] configuration in ups.conf to the following:

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

restart all nut related services (or reboot the computer) and check if it helps.
Thanks

Comment 7 David Hill 2017-07-20 15:26:21 UTC
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 15:16:18 UTC
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

RestartSec=1
Restart=on-failure
StartLimitIntervalSec=120

and see if it helps.

You will need to reboot 

OR

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 23:17:54 UTC
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 13:26:41 UTC
Where do you see those messages?
Did the restart configuration help or not?

Comment 11 David Hill 2017-08-11 14:07:10 UTC
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 09:25:54 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 27 development cycle.
Changing version to '27'.

Comment 13 Ben Cotton 2018-11-27 18:29:13 UTC
This message is a reminder that Fedora 27 is nearing its end of life.
On 2018-Nov-30  Fedora will stop maintaining and issuing updates for
Fedora 27. It is Fedora's policy to close all bug reports from releases
that are no longer maintained. At that time this bug will be closed as
EOL if it remains open with a Fedora  'version' of '27'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 27 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 14 Ben Cotton 2018-11-30 17:52:21 UTC
Fedora 27 changed to end-of-life (EOL) status on 2018-11-30. Fedora 27 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.