hassio-addons / addon-nut

Network UPS Tools - Home Assistant Community Add-ons
https://addons.community
MIT License
192 stars 37 forks source link

NUT fails to start: Can't claim USB device: Other error / Driver failed to start #349

Closed wqrwefdgfv closed 7 months ago

wqrwefdgfv commented 9 months ago
`s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service base-addon-banner: starting

-----------------------------------------------------------
 Add-on: Network UPS Tools
 Manage battery backup (UPS) devices
-----------------------------------------------------------
 Add-on version: 0.13.0
 You are running the latest version of this add-on.
 System: Home Assistant OS 11.5  (amd64 / qemux86-64)
 Home Assistant Core: 2024.2.2
 Home Assistant Supervisor: 2024.01.1
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
s6-rc: info: service base-addon-banner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service base-addon-timezone: starting
s6-rc: info: service base-addon-log-level: starting
s6-rc: info: service fix-attrs successfully started
[20:40:00] INFO: Configuring timezone (Europe/Minsk)...
Log level is set to DEBUG
s6-rc: info: service base-addon-log-level successfully started
s6-rc: info: service base-addon-timezone successfully started
s6-rc: info: service legacy-cont-init: starting
cont-init: info: running /etc/cont-init.d/nut.sh
[20:40:09] INFO: Setting mode to netserver...
[20:40:10] INFO: Connected USB devices:
Bus 001 Device 005: ID 0627:0001 Adomax Technology Co., Ltd QEMU Tablet
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
**Bus 004 Device 003: ID 0d9f:0004 Powercom Co., Ltd HID UPS Battery**
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 002: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 003: ID 1a86:55d4 QinHeng Electronics SONOFF Zigbee 3.0 USB Dongle Plus V2
Bus 002 Device 002: ID 10c4:ea60 Silicon Labs CP210x UART Bridge
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
[20:40:11] INFO: Generating /etc/nut/upsd.users...
[20:40:15] INFO: Configuring user: user1
[20:40:17] DEBUG: Password SHA1: F52D18BBAEC8E3C77D30C99E20ED0417A6E424D1
[20:40:17] DEBUG: Requested API resource: https://api.pwnedpasswords.com/range/F52D1
[20:40:17] DEBUG: API HTTP Response code: 200
[20:40:17] INFO: Password is NOT in the Have I Been Pwned database! Nice!
[20:40:20] INFO: Configuring Device named powercom...
[20:40:21] INFO: Starting the UPS drivers...
   0.000000 [D1] Starting UPS: powercom
Network UPS Tools - Generic HID driver 0.47 (2.8.0)
USB communication **driver (libusb 1.0) 0.43**
Can't claim USB device [0d9f:0004]@0/0: Other error
Network UPS Tools - UPS driver controller 2.8.0
   **0.092585   Driver failed to start (exit status=1)**
cont-init: info: /etc/cont-init.d/nut.sh exited 1
cont-init: info: running /etc/cont-init.d/nutclient.sh
cont-init: info: /etc/cont-init.d/nutclient.sh exited 0
cont-init: warning: some scripts exited nonzero
s6-rc: warning: unable to start service legacy-cont-init: command exited 1
/run/s6/basedir/scripts/rc.init: warning: s6-rc failed to properly bring all the services up! Check your logs (in /run/uncaught-logs/current if you have in-container logging) for more information.
/run/s6/basedir/scripts/rc.init: fatal: stopping the container.
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service base-addon-timezone: stopping
s6-rc: info: service base-addon-log-level: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service base-addon-timezone successfully stopped
s6-rc: info: service base-addon-log-level successfully stopped
s6-rc: info: service base-addon-banner: stopping
s6-rc: info: service base-addon-banner successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped`

POWERCOM Raptor RPT-1000AP: UPS is compactible: 2024-02-19_10-41-38

khaisilk1910 commented 9 months ago

i'm too. Can not start

`Add-on: Network UPS Tools Manage battery backup (UPS) devices

Add-on version: 0.13.0 You are running the latest version of this add-on. System: Home Assistant OS 11.5 (amd64 / generic-x86-64) Home Assistant Core: 2024.2.2 Home Assistant Supervisor: 2024.02.0

Please, share the above information when looking for help or support in, e.g., GitHub, forums or the Discord chat.

s6-rc: info: service base-addon-banner successfully started s6-rc: info: service fix-attrs: starting s6-rc: info: service base-addon-timezone: starting s6-rc: info: service base-addon-log-level: starting s6-rc: info: service fix-attrs successfully started [17:14:35] INFO: Configuring timezone (Asia/Bangkok)... s6-rc: info: service base-addon-log-level successfully started s6-rc: info: service base-addon-timezone successfully started s6-rc: info: service legacy-cont-init: starting cont-init: info: running /etc/cont-init.d/nut.sh [17:14:36] INFO: Setting mode to netserver... [17:14:36] INFO: Generating /etc/nut/upsd.users... [17:14:36] INFO: Configuring user: khaisilk1910 [17:14:37] INFO: Password is NOT in the Have I Been Pwned database! Nice! [17:14:38] INFO: Configuring Device named myups... [17:14:38] INFO: Starting the UPS drivers... Network UPS Tools - Generic HID driver 0.47 (2.8.0) USB communication driver (libusb 1.0) 0.43 libusb1: Could not open any HID devices: insufficient permissions on everything No matching HID UPS found Driver failed to start (exit status=1) Network UPS Tools - UPS driver controller 2.8.0 cont-init: info: /etc/cont-init.d/nut.sh exited 1 cont-init: info: running /etc/cont-init.d/nutclient.sh cont-init: info: /etc/cont-init.d/nutclient.sh exited 0 cont-init: warning: some scripts exited nonzero s6-rc: warning: unable to start service legacy-cont-init: command exited 1 /run/s6/basedir/scripts/rc.init: warning: s6-rc failed to properly bring all the services up! Check your logs (in /run/uncaught-logs/current if you have in-container logging) for more information. /run/s6/basedir/scripts/rc.init: fatal: stopping the container. s6-rc: info: service fix-attrs: stopping s6-rc: info: service base-addon-timezone: stopping s6-rc: info: service base-addon-log-level: stopping s6-rc: info: service fix-attrs successfully stopped s6-rc: info: service base-addon-timezone successfully stopped s6-rc: info: service base-addon-log-level successfully stopped s6-rc: info: service base-addon-banner: stopping s6-rc: info: service base-addon-banner successfully stopped s6-rc: info: service s6rc-oneshot-runner: stopping s6-rc: info: service s6rc-oneshot-runner successfully stopped`

cherniavsky94w commented 9 months ago

Hi, I am too

Log level is set to DEBUG
s6-rc: info: service base-addon-log-level successfully started
s6-rc: info: service base-addon-timezone successfully started
s6-rc: info: service legacy-cont-init: starting
cont-init: info: running /etc/cont-init.d/nut.sh
[15:42:12] INFO: Setting mode to netserver...
[15:42:12] INFO: Connected USB devices:
Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 002 Device 003: ID 0d9f:0004 Powercom Co., Ltd HID UPS Battery
Bus 002 Device 002: ID 1a86:7523 QinHeng Electronics CH340 serial converter
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
[15:42:12] INFO: Generating /etc/nut/upsd.users...
[15:42:12] INFO: Configuring user: hassio
[15:42:13] INFO: Configuring Device named powercom...
[15:42:13] INFO: Starting the UPS drivers...
   0.000000 [D1] Starting UPS: powercom
Network UPS Tools - Generic HID driver 0.47 (2.8.0)
USB communication driver (libusb 1.0) 0.43
libusb1: Could not open any HID devices: insufficient permissions on everything
No matching HID UPS found
   0.055768 Driver failed to start (exit status=1)
Network UPS Tools - UPS driver controller 2.8.0
cont-init: info: /etc/cont-init.d/nut.sh exited 1
cont-init: info: running /etc/cont-init.d/nutclient.sh
cont-init: info: /etc/cont-init.d/nutclient.sh exited 0
cont-init: warning: some scripts exited nonzero
s6-rc: warning: unable to start service legacy-cont-init: command exited 1
/run/s6/basedir/scripts/rc.init: warning: s6-rc failed to properly bring all the services up! Check your logs (in /run/uncaught-logs/current if you have in-container logging) for more information.
/run/s6/basedir/scripts/rc.init: fatal: stopping the container.
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service base-addon-timezone: stopping
s6-rc: info: service base-addon-log-level: stopping
s6-rc: info: service base-addon-timezone successfully stopped
s6-rc: info: service base-addon-log-level successfully stopped
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service base-addon-banner: stopping
s6-rc: info: service base-addon-banner successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped

My configuration:

users:
  - username: hassio
    password: hassio
    instcmds:
      - all
    actions: []
devices:
  - name: powercom
    driver: usbhid-ups
    port: auto
    config: []
mode: netserver
shutdown_host: false
list_usb_devices: true
i_like_to_be_pwned: true
log_level: debug
GiacomoTognetti commented 9 months ago

same here. Any suggestion or idea to solve?

lcavalli commented 9 months ago

Me too, but with nutdrv_qx driver. Older add-on versions worked without issues.

wqrwefdgfv commented 9 months ago

same here. Any suggestion or idea to solve?

May be older versions? Del last one and install older

GiacomoTognetti commented 9 months ago

thanx for the tip, I'd like to try. I deleted latest versione (0.13.0) but I have no clue where to find the oldest (0.12.something, maybe). If I search throught the addons I see only 0.13.0, no possibilities to switch to a previous...

lcavalli commented 9 months ago

thanx for the tip, I'd like to try. I deleted latest versione (0.13.0) but I have no clue where to find the oldest (0.12.something, maybe). If I search throught the addons I see only 0.13.0, no possibilities to switch to a previous...

The only safe way is to have a previous backup and selectively restore the old NUT add-on.

wqrwefdgfv commented 9 months ago

https://github.com/hassio-addons/addon-nut/releases

what about this? download and install manually. what version really works?

https://github.com/hassio-addons/addon-nut/compare/v0.11.1...v0.13.0

GiacomoTognetti commented 9 months ago

well yours is good tip! but the point is how I manually install it? I tried settings--->the three dots button---->digital archives----->I pasted the github (0.12.2 but even the others) and this is what I get

Cmd('git') failed due to: exit code(128) cmdline: git clone -v --recursive --depth=1 --shallow-submodules -- https://github.com/hassio-addons/addon-nut/releases/tag/v0.12.2 /data/addons/git/ac2c5170 stderr: 'Cloning into '/data/addons/git/ac2c5170'... fatal: https://github.com/hassio-addons/addon-nut/releases/tag/v0.12.2/info/refs not valid: is this a git repository? '

Screenshot 2024-02-27 alle 22 31 12
wqrwefdgfv commented 9 months ago

well yours is good tip! but the point is how I manually install it? I tried settings--->the three dots button---->digital archives----->I pasted the github (0.12.2 but even the others) and this is what I get

Cmd('git') failed due to: exit code(128) cmdline: git clone -v --recursive --depth=1 --shallow-submodules -- https://github.com/hassio-addons/addon-nut/releases/tag/v0.12.2 /data/addons/git/ac2c5170 stderr: 'Cloning into '/data/addons/git/ac2c5170'... fatal: https://github.com/hassio-addons/addon-nut/releases/tag/v0.12.2/info/refs not valid: is this a git repository? '

Screenshot 2024-02-27 alle 22 31 12

same error (((

GiacomoTognetti commented 9 months ago

I wrote directly to NUT support for help, but because I'm a total kook I'm unable to understand what they suggest to do. Any idea?

To me, this line is suspect:

libusb1: Could not open any HID devices: insufficient permissions on everything

it seems like USB permissions on the host do not allow the NUT run-time user (nutty?) to own the device filesystem node. Check the upower/udev/... settings relevant there.

According to Git, this ID should be known in NUT v2.8.0 or newer (so the rest is about OS integration for this bit):

$ git blame v2.8.0 scripts/upower/95-upower-hid.hwdb | grep usb:v0764p0601 8b72ac9fc2 (Benjamin Berg 2022-03-28 17:19:41 +0200 103) usb:v0764p0601*

wqrwefdgfv commented 9 months ago

I decided this problem.

In my case I have UPS connected to NAS qnap directly by USB. In qnap settings I activated option "network NAS" and set IP of Home Assistant. Then I delete this ADDON NUT and ADD INTEGRATION "NUT". Host: NAS IP Port: 3493 Login/pass EMPTY

that's all!

GiacomoTognetti commented 9 months ago

woah, it worked also with my Synology! Nice and easy, as it should. Thanks again @wqrwefdgfv you made my day!

lcavalli commented 9 months ago

@wqrwefdgfv you closed this issue, but it is still present in the addon. You find a nice workaround but the problem has not been fixed.

wqrwefdgfv commented 9 months ago

@wqrwefdgfv you closed this issue, but it is still present in the addon. You find a nice workaround but the problem has not been fixed.

As you wish)

lcavalli commented 9 months ago

Thank you! I have a NAS as well, but I would really like to have this issue fixed in HA addon.

lcavalli commented 9 months ago

I unplugged and reconnected the UPS and the addon started and connected to the UPS. It may be related to the problem described here: https://github.com/networkupstools/nut/blob/master/scripts/usb_resetter/README.adoc In this case connecting the UPS to the NAS may not solve the issue.

seth586 commented 9 months ago

+1 Same issue, using a Cyber Power 1500PFCLCD, works on my FreeBSD server but not on my HAOS running bare metal on a Udoo Bolt.

Addon logs:

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service base-addon-banner: starting

-----------------------------------------------------------
 Add-on: Network UPS Tools
 Manage battery backup (UPS) devices
-----------------------------------------------------------
 Add-on version: 0.13.0
 You are running the latest version of this add-on.
 System: Home Assistant OS 12.0  (amd64 / generic-x86-64)
 Home Assistant Core: 2024.2.4
 Home Assistant Supervisor: 2024.02.1
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
s6-rc: info: service base-addon-banner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service base-addon-timezone: starting
s6-rc: info: service base-addon-log-level: starting
s6-rc: info: service fix-attrs successfully started
[20:26:59] INFO: Configuring timezone (America/Chicago)...
s6-rc: info: service base-addon-log-level successfully started
s6-rc: info: service base-addon-timezone successfully started
s6-rc: info: service legacy-cont-init: starting
cont-init: info: running /etc/cont-init.d/nut.sh
[20:27:00] INFO: Setting mode to netserver...
[20:27:00] INFO: Connected USB devices:
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 003: ID 2341:8036 Arduino SA Leonardo (CDC ACM, HID)
Bus 003 Device 002: ID 8087:0aa7 Intel Corp. Wireless-AC 3168 Bluetooth
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 005: ID 0764:0501 Cyber Power System, Inc. CP1500 AVR UPS
Bus 001 Device 006: ID 1a86:55d4 QinHeng Electronics 800 Z-Wave Stick
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
[20:27:00] INFO: Generating /etc/nut/upsd.users...
[20:27:00] INFO: Configuring user: admin
[20:27:00] INFO: Password is NOT in the Have I Been Pwned database! Nice!
[20:27:01] INFO: Configuring Device named myups...
[20:27:01] INFO: Starting the UPS drivers...
Network UPS Tools - Generic HID driver 0.47 (2.8.0)
USB communication driver (libusb 1.0) 0.43
Can't claim USB device [0764:0501]@2/0: Invalid parameter
Network UPS Tools - UPS driver controller 2.8.0
Driver failed to start (exit status=1)
cont-init: info: /etc/cont-init.d/nut.sh exited 1
cont-init: info: running /etc/cont-init.d/nutclient.sh
cont-init: info: /etc/cont-init.d/nutclient.sh exited 0
cont-init: warning: some scripts exited nonzero
s6-rc: warning: unable to start service legacy-cont-init: command exited 1
/run/s6/basedir/scripts/rc.init: warning: s6-rc failed to properly bring all the services up! Check your logs (in /run/uncaught-logs/current if you have in-container logging) for more information.
/run/s6/basedir/scripts/rc.init: fatal: stopping the container.
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service base-addon-timezone: stopping
s6-rc: info: service base-addon-log-level: stopping
s6-rc: info: service base-addon-timezone successfully stopped
s6-rc: info: service base-addon-log-level successfully stopped
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service base-addon-banner: stopping
s6-rc: info: service base-addon-banner successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped
MiguelAngelLV commented 8 months ago

Same problem here. I get libusb1: Could not open any HID devices: insufficient permissions on everything in a Raspberry Pi and a Virtual Machine.

In ssh addon I can get the UPS with lsusb and with dmesg, but nut addon fail.

amasolov commented 8 months ago

Same here. Exactly the same problem

github-actions[bot] commented 7 months ago

There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!