Skip to content

[Bug]: NVMe controller path auto-detected instead of namespace #1504

@ggfevans

Description

@ggfevans

Component

Agent

Description

Agent auto-detects /dev/nvme0 (controller) instead of /dev/nvme0n1 (namespace), causing repeated errors in logs. The controller path doesn't support SMART queries — only the namespace does.

Environment

  • Beszel Agent 0.17.0
  • Proxmox VE 9.0.11 (Debian, kernel 6.17.2-1-pve)
  • Seagate FireCuda 520 NVMe 1TB

Problem

Agent auto-detects /dev/nvme0 (controller) instead of /dev/nvme0n1 (namespace), causing repeated errors:

INFO smartctl failed device=/dev/nvme0 err="exit status 2"

The controller path doesn't support SMART queries — only the namespace (nvme0n1) does.

Workaround

Exclude controller and explicitly specify namespace:

Environment="SMART_DEVICES=/dev/nvme0n1"
Environment="EXCLUDE_SMART=/dev/nvme0"

Suggested fix

When scanning NVMe devices, prefer /dev/nvmeXn1 (namespace) over /dev/nvmeX (controller), or auto-exclude controller paths since they don't return valid SMART data.


Separately, NVMe SMART also requires cap_sys_admin in addition to cap_sys_rawio — happy to open a docs PR for that if helpful.

Expected Behavior

Agent should detect and query /dev/nvme0n1 (namespace) rather than /dev/nvme0 (controller), or auto-exclude controller paths since they never return valid SMART data.

Steps to Reproduce

  1. Install agent on system with NVMe drive
  2. Start agent without SMART_DEVICES or EXCLUDE_SMART configured
  3. Observe repeated "smartctl failed device=/dev/nvme0 err=exit status 2" in logs
  4. SMART data for NVMe shows "unknown" in dashboard

Category

Metrics

Affected Metrics

Sensors

OS / Architecture

Proxmox linux/amd64 (agent)

Beszel version

0.17.0

Installation method

Binary

Configuration

# Workaround that resolves the issue:
Environment="SMART_DEVICES=/dev/nvme0n1,/dev/sda,/dev/sdb,/dev/sdc,/dev/sdd,/dev/sde,/dev/sdf,/dev/sdg"
Environment="EXCLUDE_SMART=/dev/nvme0"

Hub Logs

Agent Logs

Dec 06 02:30:05 pve-prod beszel-agent[2639696]: 2025/12/06 02:30:05 INFO smartctl failed device=/dev/nvme0 err="exit status 2"
# Repeats continuously until EXCLUDE_SMART configured

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions