Repository navigation
Smart plugin: a USB-bridged disk (e.g. -d usbsunplus) crashes the web server at startup #3806
Description
Check the bug
I searched the issues for "Unknown interface" and found no match. #2916 is related to the smart plugin but is a different problem.
Describe the bug
When the smart plugin is enabled and smartctl --scan reports a device type that pySMART does not accept, Glances exits during the first stats update. The web server never comes up, and under Docker restart: unless-stopped the container restart-loops.
Here the trigger is a USB disk behind a Sunplus SPIF30x SATA bridge (1bcf:0c31). smartctl 7.5 reports it as:
/dev/sda -d usbsunplus # /dev/sda [USB Sunplus], ATA device
/dev/nvme0 -d nvme # /dev/nvme0, NVMe device
pySMART 1.4.3's Device.__init__ accepts only the types in smartctl_type_dict (ata, csmi, nvme, sas, sat, sata, scsi, atacam, sntasmedia, plus megaraid,N). Any other type smartctl emits for a USB bridge raises ValueError, including usbsunplus, usbjmicron, usbcypress and usbprolific:
File "/app/glances/plugins/smart/__init__.py", line 171, in get_smart_data
devlist = DeviceList()
File "/venv/lib/python3.14/site-packages/pySMART/device_list.py", line 50, in __init__
self.initialize(catch_errors)
File "/venv/lib/python3.14/site-packages/pySMART/device_list.py", line 125, in initialize
raise e
File "/venv/lib/python3.14/site-packages/pySMART/device_list.py", line 114, in initialize
Device(name, interface=interface, smartctl=self.smartctl))
File "/venv/lib/python3.14/site-packages/pySMART/device.py", line 79, in __init__
raise ValueError(
'Unknown interface: {0} specified for {1}'.format(interface, name))
ValueError: Unknown interface: usbsunplus specified for /dev/sda
get_smart_data() catches only (TypeError, FileNotFoundError), so the ValueError reaches GlancesMode.__init__ -> stats.update() and kills the process. The [smart] show/hide options cannot help, because they filter after DeviceList() has already raised. The same code is still on develop in glances/plugins/smart/data.py (get_smart_data). 8b458ff fixed the FileNotFoundError variant of this crash.
To Reproduce
- Attach a disk whose
smartctl --scanline uses a USB bridge type, such as-d usbsunplus. - Start Glances with
-w --enable-plugin smartas root (for example, innicolargo/glances:latest-fullwithpid: hostandprivileged: true). - Glances exits with the traceback above.
Expected behavior
An unsupported device is skipped, and SMART data for the other devices is still shown. The web server starts either way.
Suggested fix
Call DeviceList(catch_errors=True). pySMART then logs the failing device and continues with the rest. The narrow except would still turn on import_error_tag for the remaining whole-list failures, which disables the plugin for every device. Alternatively, add ValueError to the caught exceptions, but that loses the healthy devices too.
Environement
- Operating System: Ubuntu 26.04.1 LTS (host), kernel 7.0.0-38-generic
- Glances & psutil versions: Glances 4.5.8, API 4, psutil 7.2.2; pySMART 1.4.3; smartmontools 7.5
- How do you install Glances: Docker image
nicolargo/glances:latest-full(built 2026-10-11) - Glances test: not run; the process exits before it can report
Additional context
As a workaround, I disabled the smart plugin ([smart] disable=True and no --enable-plugin smart).
Activity
github-actions commentedon Oct 21, 2026
This issue is available for anyone to work on. Make sure to reference this issue in your pull request. ✨ Thank you for your contribution ! ✨
fix(smart): keep healthy disks when pySMART rejects a device type