Nut crash OSError: [Errno 9] Bad file descriptor

Bonjour,

Cela fait un moment que mon nut ne remonte pas.

Voici l’erreur. Certainement un pb avec une dépendance ou une librairie:

root@jeedom:/var/www/html# /usr/bin/python3 /var/www/html/plugins/nut/resources/nut.py -f getInfos -a 10.0.0.251 -n eaton
--- Logging error ---
Traceback (most recent call last):
  File "/usr/lib/python3.9/logging/handlers.py", line 953, in emit
    self.socket.send(msg)
OSError: [Errno 9] Bad file descriptor

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.9/logging/handlers.py", line 874, in _connect_unixsocket
    self.socket.connect(address)
FileNotFoundError: [Errno 2] No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.9/logging/handlers.py", line 956, in emit
    self._connect_unixsocket(self.address)
  File "/usr/lib/python3.9/logging/handlers.py", line 885, in _connect_unixsocket
    self.socket.connect(address)
FileNotFoundError: [Errno 2] No such file or directory
Call stack:
  File "/var/www/html/plugins/nut/resources/nut.py", line 29, in <module>
    ups = nut3.PyNUT3Client(host=address, login=user, password=password)
  File "/usr/local/lib/python3.9/dist-packages/pynut3/nut3.py", line 117, in __init__
    _LOGGER.debug(f"NUT Class initialization on: {host}:{port}, Login: {login} started.")
Message: 'NUT Class initialization on: 10.0.0.251:3493, Login: None started.'
Arguments: ()
--- Logging error ---
Traceback (most recent call last):
  File "/usr/lib/python3.9/logging/handlers.py", line 953, in emit
    self.socket.send(msg)
OSError: [Errno 9] Bad file descriptor

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.9/logging/handlers.py", line 874, in _connect_unixsocket
    self.socket.connect(address)
FileNotFoundError: [Errno 2] No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.9/logging/handlers.py", line 956, in emit
    self._connect_unixsocket(self.address)
  File "/usr/lib/python3.9/logging/handlers.py", line 885, in _connect_unixsocket
    self.socket.connect(address)
FileNotFoundError: [Errno 2] No such file or directory
Call stack:
  File "/var/www/html/plugins/nut/resources/nut.py", line 29, in <module>
    ups = nut3.PyNUT3Client(host=address, login=user, password=password)
  File "/usr/local/lib/python3.9/dist-packages/pynut3/nut3.py", line 163, in __init__
    _LOGGER.debug(
Message: 'NUT Class initialization finished 2024-03-27 17:38 CET.'
Arguments: ()
Traceback (most recent call last):
  File "/var/www/html/plugins/nut/resources/nut.py", line 33, in <module>
    result = ups.get_dict_vars(ups=device)
AttributeError: 'PyNUT3Client' object has no attribute 'get_dict_vars'

Sur mon docker l’accès à distance fonctionne bien:

[docker@docker: ~]$ upsc eaton@10.0.0.251
Init SSL without certificate database
battery.charge: 100
battery.charge.low: 20
battery.runtime: 2525
battery.type: PbAc
device.mfr: EATON
device.model: Ellipse PRO 1600 
device.serial: G363N26114
device.type: ups
driver.name: usbhid-ups
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 2
driver.parameter.port: auto
driver.parameter.synchronous: auto
driver.version: 2.8.0
driver.version.data: MGE HID 1.46
driver.version.internal: 0.47
driver.version.usb: libusb-1.0.26 (API: 0x1000109)
input.frequency: 50.0
input.transfer.high: 285
input.transfer.low: 165
input.voltage: 229.0
input.voltage.extended: no
outlet.1.desc: PowerShare Outlet 1
outlet.1.id: 2
outlet.1.status: on
outlet.1.switchable: no
outlet.2.desc: PowerShare Outlet 2
outlet.2.id: 3
outlet.2.status: on
outlet.2.switchable: no
outlet.desc: Main Outlet
outlet.id: 1
outlet.switchable: no
output.frequency: 50.0
output.frequency.nominal: 50
output.voltage: 230.0
output.voltage.nominal: 240
ups.beeper.status: enabled
ups.delay.shutdown: 20
ups.delay.start: 30
ups.firmware: 01.18.0022
ups.load: 11
ups.mfr: EATON
ups.model: Ellipse PRO 1600 
ups.power: 139
ups.power.nominal: 1600
ups.productid: ffff
ups.realpower: 120
ups.serial: G363N26114
ups.status: OL
ups.timer.shutdown: -1
ups.timer.start: -1
ups.vendorid: 0463

merci

PS: j’ai essayé avec un login/pwd et memes messages

Bonjour,

Il s’agit du plugin-nut ou plugin-nut_free ?
J’ai l’impression qu’il s’agit plutôt du 1er ?

1 « J'aime »

Oui merci Madcow!

Pb résolu si downgrade. Est ce la solution?

root@jeedom:/var/www/html# pip3 install --force-reinstall --upgrade pynut3==1.6.2
Collecting pynut3==1.6.2
  Downloading pynut3-1.6.2-py3-none-any.whl.metadata (3.3 kB)
Downloading pynut3-1.6.2-py3-none-any.whl (20 kB)
DEPRECATION: gpg 1.14.0-unknown has a non-standard version number. pip 24.1 will enforce this behaviour change. A possible replacement is to upgrade to a newer version of gpg or contact the author to suggest that they release a version with a conforming version number. Discussion can be found at https://github.com/pypa/pip/issues/12063
Installing collected packages: pynut3
  Attempting uninstall: pynut3
    Found existing installation: pynut3 2.2.1
    Uninstalling pynut3-2.2.1:
      Successfully uninstalled pynut3-2.2.1
Successfully installed pynut3-1.6.2
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
2 « J'aime »
2 « J'aime »

Merci, je venais justement de constater le même problème ce matin.
C’est dommage que cette exception ne soit pas tagué en Erreur car ça ne remonte pas dans la log par défaut. C’est en constatant que j’avais la même valeur depuis février que je me suis dis il y a certainement un problème et je suis passé en debug.

WARNING : Exception occured: 'PyNUT3Client' object has no attribute 'get_dict_vars'

Ce sujet a été automatiquement fermé après 24 heures suivant le dernier commentaire. Aucune réponse n’est permise dorénavant.