Issue Summary
I recently encountered an issue where the Proxmox GUI would hang indefinitely when navigating toMy Node > Disks
, eventually displaying a "Communication Failure" error. However, the disk in question was fully recognized in the CLI (lsblk
, fdisk
), and I was even able to manually mount it. After debugging, I found that the issue was related to SMART data retrieval in Proxmox’s API. Disabling SMART queries resolved the problem, which suggests that smartctl
(or another related command) was hanging during execution.System Details:
- Hardware: Dell laptop (Intel i7 8th Gen, 500GB HDD, 32GB RAM)
- Proxmox Version: 8.3.2
- Storage Setup:
- Internal 500GB HDD (Proxmox installed)
- 128GB USB drive (previously tested, no issues)
- Newly added 250GB SSD connected via USB-to-SATA adapter (caused the issue)
Steps to Reproduce:
- Connect a 2.5" SSD via USB-to-SATA adapter to the Proxmox server.
- Navigate to
My Node > Disks
in the GUI. - The page fails to load, eventually showing "Communication Failure."
- Running
lsblk
,fdisk
, and mounting the disk manually all work fine, meaning the disk is recognized at the system level. - Checking logs (
journalctl -xe
,syslog
,pvedaemon logs
) did not provide any immediate clues.
Debugging Process & Findings:
Based on a suggestion from a Reddit discussion, I investigated how Proxmox handles disk detection. Since the PVE API is primarily written in Perl, I checked the following files:- Disk listing API call: PVE/API2/Disks.pm#L81
- Internal subroutine call: PVE/API2/Disks.pm#L152
- Actual disk query logic: PVE/Diskmanage.pm#L478
get_smart_data()
was responsible for retrieving SMART attributes using smartctl
. The relevant code inside /usr/share/perl5/PVE/Diskmanage.pm
looked like this:
Perl:
if (!$nosmart) {
eval {
my $smartdata = get_smart_data($devpath, !is_ssdlike($type));
$health = $smartdata->{health} if $smartdata->{health};
if (is_ssdlike($type)) { # if we have an SSD, try to get the wearout indicator
my $wear_level = get_wear_leveling_info($smartdata);
$wearout = $wear_level if defined($wear_level);
}
};
}
Since
get_smart_data()
calls smartctl
without any timeout handling, it appeared that the process was hanging indefinitely when querying my SSD over USB.Workaround / Temporary Fix:
To test if SMART queries were the cause, I removed the SMART-related logic, leaving this instead:
Perl:
if (!$nosmart) {
}
After restarting pvedaemon with:
systemctl restart pvedaemon
…the GUI immediately started working again, confirming that the issue was due to SMART queries failing or taking too long to respond.
Potential Root Cause & Bug Report Considerations
- Proxmox uses run_command to execute system utilities like smartctl, but does not enforce any timeouts.
- If smartctl hangs (especially with USB-connected drives), the entire API request stalls, causing the GUI to hang indefinitely.
- This is likely a framework-wide issue, as any Proxmox API call relying on long-running system commands could exhibit the same behavior.
- Implementing a timeout using Perl’s alarm]() function could prevent this from happening.
Next Steps & Questions for the Community
- Has anyone else encountered this issue with USB-attached SSDs?
- Is there a recommended way to disable SMART queries for specific devices without modifying core Proxmox files?
- Would implementing a timeout mechanism in Proxmox’s API be a viable long-term fix?
Last edited: