Skip to content

fix(zfs): skip zpool list when /dev/zfs unavailable inside the container - #2325

Merged
henrygd merged 2 commits into
henrygd:mainfrom
santhiprakash:fix/zfs-skip-no-dev
Sep 16, 2026
Merged

henrygd merged 2 commits into
henrygd:mainfrom
santhiprakash:fix/zfs-skip-no-dev

Conversation

@santhiprakash

Copy link
Copy Markdown
Contributor

📃 Description

On a Linux host without ZFS pools, the Alpine agent image still ships the zpool binary. If /dev/zfs is not mapped into the container, zpool list blocks for the full 10-second command timeout and then PoolStats() returns a wrapped context deadline exceeded error. Because optionalPoolSource() does not treat that as an absent backend, the agent retries every minute (each poolStatsRefreshInterval tick) and logs:

DEBUG Storage pool stats unavailable backend=zfs err="zpool list: zpool timed out after 10s: context deadline exceeded"

This mirrors the existing PoolKernelStats() pattern: on Linux, probe the kernel interface (/dev/zfs) first. If the device node is missing, return ErrNoZfs, which optionalPoolSource() already converts to a silent no-op backend. This removes both the 10-second hang and the repeating debug log.

Changes:

  • agent/zfs/zfs.go: rename the cross-platform PoolStats() to private poolStats().
  • agent/zfs/zfs_linux.go: add PoolStats() with a fast os.Stat("/dev/zfs") probe; if absent, return nil, ErrNoZfs; otherwise delegate to poolStats().
  • agent/zfs/zfs_freebsd.go: add PoolStats() delegating directly to poolStats().
  • agent/zfs/zfs_unsupported.go: add PoolStats() returning errors.ErrUnsupported.
  • agent/zfs/zfs_linux_test.go: add sabotage-first regression tests proving PoolStats() does not invoke zpool list when /dev/zfs is missing and does delegate when it is present.

Fixes #2324

📖 Documentation

No documentation changes needed.

🪵 Changelog

🔧 Fixed

  • Skip zpool list when /dev/zfs is not available inside the container, preventing the 10-second timeout and once-per-minute debug log on hosts without ZFS pools.

📷 Screenshots

No UI changes.

AI-assisted. I wrote and verified this change.

PoolStats now probes /dev/zfs on Linux before invoking zpool list. If the device node is missing (e.g. the Alpine agent container running without --device /dev/zfs), it returns ErrNoZfs immediately, which optionalPoolSource already treats as an absent backend. This removes the once-per-minute 10-second timeout and the repeating debug log on Proxmox hosts without ZFS pools.

Fixes henrygd#2324
Extend the /dev/zfs guard to Datasets() and wrap the dataset source
with optionalPoolSource to suppress missing-backend errors.

Undo the unconditional ErrUnsupported return for non-Linux,
non-FreeBSD pool collection so those platforms still use zpool.

Add regression tests for dataset guards and non-Linux collection.

@henrygd henrygd left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! 👍

@henrygd
henrygd merged commit 9821017 into henrygd:main Sep 16, 2026
JuliusFreudenberger pushed a commit to JuliusFreudenberger/nix-config that referenced this pull request Sep 20, 2026
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [henrygd/beszel](https://github.com/henrygd/beszel) | minor | `0.19.0` → `0.20.0` |

---

> ⚠️ **Warning**
>
> Some dependencies could not be looked up. Check the [Dependency Dashboard](issues/12) for more information.

---

### Release Notes

<details>
<summary>henrygd/beszel (henrygd/beszel)</summary>

### [`v0.20.0`](https://github.com/henrygd/beszel/releases/tag/v0.20.0)

[Compare Source](henrygd/beszel@v0.19.0...v0.20.0)

#### What's Changed

- Add network monitoring from agents ([#&#8203;2266](henrygd/beszel#2266), [#&#8203;1911](henrygd/beszel#1911))
- Add container image update available flag ([#&#8203;2211](henrygd/beszel#2211))
- Add btrfs filesystem reporting as storage pools ([#&#8203;2315](henrygd/beszel#2315))
- Add persistence of view preferences and language to user settings ([#&#8203;1831](henrygd/beszel#1831))
- Add `TRUSTED_PROXY_IPS` allowlist for `TRUSTED_AUTH_HEADER` ([#&#8203;2327](henrygd/beszel#2327))
- Add ZFS utilities to Intel and NVIDIA agent images ([#&#8203;2288](henrygd/beszel#2288), [#&#8203;2311](henrygd/beszel#2311))
- Revert SMART warnings for certain attributes ([#&#8203;2296](henrygd/beszel#2296), [#&#8203;2308](henrygd/beszel#2308), [#&#8203;2347](henrygd/beszel#2347))
- Improve NVMe data units display as human-readable GB/TB ([#&#8203;2303](henrygd/beszel#2303))
- Fix agent disconnects during slow collections by extending WebSocket deadline ([#&#8203;2294](henrygd/beszel#2294))
- Fix missing root CA certificates in base agent image ([#&#8203;2291](henrygd/beszel#2291))
- Fix false RAID health warnings during healthy data scrubbing ([#&#8203;2109](henrygd/beszel#2109))
- Fix ZFS monitoring when /dev/zfs is unavailable ([#&#8203;2325](henrygd/beszel#2325))
- Fix spurious `HUB_URL` warning in SSH-only mode ([#&#8203;2316](henrygd/beszel#2316))
- Fix idle GPU utilization display in systems table ([#&#8203;2312](henrygd/beszel#2312))
- Fix session handling to clear auth store after token expiry ([#&#8203;2310](henrygd/beszel#2310))
- Fix chart history handling when switching to live charts ([#&#8203;2333](henrygd/beszel#2333))
- Update Go dependencies

#### New Contributors

- [@&#8203;arnolicious](https://github.com/arnolicious) made their first contribution in [#&#8203;2288](henrygd/beszel#2288)
- [@&#8203;matth3wdsouza](https://github.com/matth3wdsouza) made their first contribution in [#&#8203;2303](henrygd/beszel#2303)
- [@&#8203;anaisbetts](https://github.com/anaisbetts) made their first contribution in [#&#8203;2315](henrygd/beszel#2315)
- [@&#8203;brunob45](https://github.com/brunob45) made their first contribution in [#&#8203;2211](henrygd/beszel#2211)
- [@&#8203;ChangkeunJ](https://github.com/ChangkeunJ) made their first contribution in [#&#8203;2333](henrygd/beszel#2333)
- [@&#8203;rajtslegr](https://github.com/rajtslegr) made their first contribution in [#&#8203;2328](henrygd/beszel#2328)
- [@&#8203;jmrplens](https://github.com/jmrplens) made their first contribution in [#&#8203;2327](henrygd/beszel#2327)

**Full Changelog**: <henrygd/beszel@v0.19.0...v0.20.0>

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xNTAuMSIsInVwZGF0ZWRJblZlciI6IjQzLjE1MC4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Reviewed-on: https://git.jfreudenberger.de/JuliusFreudenberger/nix-config/pulls/49
ivanch added a commit to ivanch/haven that referenced this pull request Sep 20, 2026
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [henrygd/beszel-agent](https://github.com/henrygd/beszel) | minor | `0.19.0` → `0.20.0` |

---

### Release Notes

<details>
<summary>henrygd/beszel (henrygd/beszel-agent)</summary>

### [`v0.20.0`](https://github.com/henrygd/beszel/releases/tag/v0.20.0)

[Compare Source](henrygd/beszel@v0.19.0...v0.20.0)

#### What's Changed

- Add network monitoring from agents ([#&#8203;2266](henrygd/beszel#2266), [#&#8203;1911](henrygd/beszel#1911))
- Add container image update available flag ([#&#8203;2211](henrygd/beszel#2211))
- Add btrfs filesystem reporting as storage pools ([#&#8203;2315](henrygd/beszel#2315))
- Add persistence of view preferences and language to user settings ([#&#8203;1831](henrygd/beszel#1831))
- Add `TRUSTED_PROXY_IPS` allowlist for `TRUSTED_AUTH_HEADER` ([#&#8203;2327](henrygd/beszel#2327))
- Add ZFS utilities to Intel and NVIDIA agent images ([#&#8203;2288](henrygd/beszel#2288), [#&#8203;2311](henrygd/beszel#2311))
- Revert SMART warnings for certain attributes ([#&#8203;2296](henrygd/beszel#2296), [#&#8203;2308](henrygd/beszel#2308), [#&#8203;2347](henrygd/beszel#2347))
- Improve NVMe data units display as human-readable GB/TB ([#&#8203;2303](henrygd/beszel#2303))
- Fix agent disconnects during slow collections by extending WebSocket deadline ([#&#8203;2294](henrygd/beszel#2294))
- Fix missing root CA certificates in base agent image ([#&#8203;2291](henrygd/beszel#2291))
- Fix false RAID health warnings during healthy data scrubbing ([#&#8203;2109](henrygd/beszel#2109))
- Fix ZFS monitoring when /dev/zfs is unavailable ([#&#8203;2325](henrygd/beszel#2325))
- Fix spurious `HUB_URL` warning in SSH-only mode ([#&#8203;2316](henrygd/beszel#2316))
- Fix idle GPU utilization display in systems table ([#&#8203;2312](henrygd/beszel#2312))
- Fix session handling to clear auth store after token expiry ([#&#8203;2310](henrygd/beszel#2310))
- Fix chart history handling when switching to live charts ([#&#8203;2333](henrygd/beszel#2333))
- Update Go dependencies

#### New Contributors

- [@&#8203;arnolicious](https://github.com/arnolicious) made their first contribution in [#&#8203;2288](henrygd/beszel#2288)
- [@&#8203;matth3wdsouza](https://github.com/matth3wdsouza) made their first contribution in [#&#8203;2303](henrygd/beszel#2303)
- [@&#8203;anaisbetts](https://github.com/anaisbetts) made their first contribution in [#&#8203;2315](henrygd/beszel#2315)
- [@&#8203;brunob45](https://github.com/brunob45) made their first contribution in [#&#8203;2211](henrygd/beszel#2211)
- [@&#8203;ChangkeunJ](https://github.com/ChangkeunJ) made their first contribution in [#&#8203;2333](henrygd/beszel#2333)
- [@&#8203;rajtslegr](https://github.com/rajtslegr) made their first contribution in [#&#8203;2328](henrygd/beszel#2328)
- [@&#8203;jmrplens](https://github.com/jmrplens) made their first contribution in [#&#8203;2327](henrygd/beszel#2327)

**Full Changelog**: <henrygd/beszel@v0.19.0...v0.20.0>

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC44My4wIiwidXBkYXRlZEluVmVyIjoiNDQuODMuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

---------

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Reviewed-on: https://git.ivanch.me/ivanch/haven/pulls/15
ivanch added a commit to ivanch/haven that referenced this pull request Sep 20, 2026
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [ghcr.io/henrygd/beszel/beszel](https://github.com/henrygd/beszel) | minor | `0.19.0` → `0.20.0` |

---

### Release Notes

<details>
<summary>henrygd/beszel (ghcr.io/henrygd/beszel/beszel)</summary>

### [`v0.20.0`](https://github.com/henrygd/beszel/releases/tag/v0.20.0)

[Compare Source](henrygd/beszel@v0.19.0...v0.20.0)

#### What's Changed

- Add network monitoring from agents ([#&#8203;2266](henrygd/beszel#2266), [#&#8203;1911](henrygd/beszel#1911))
- Add container image update available flag ([#&#8203;2211](henrygd/beszel#2211))
- Add btrfs filesystem reporting as storage pools ([#&#8203;2315](henrygd/beszel#2315))
- Add persistence of view preferences and language to user settings ([#&#8203;1831](henrygd/beszel#1831))
- Add `TRUSTED_PROXY_IPS` allowlist for `TRUSTED_AUTH_HEADER` ([#&#8203;2327](henrygd/beszel#2327))
- Add ZFS utilities to Intel and NVIDIA agent images ([#&#8203;2288](henrygd/beszel#2288), [#&#8203;2311](henrygd/beszel#2311))
- Revert SMART warnings for certain attributes ([#&#8203;2296](henrygd/beszel#2296), [#&#8203;2308](henrygd/beszel#2308), [#&#8203;2347](henrygd/beszel#2347))
- Improve NVMe data units display as human-readable GB/TB ([#&#8203;2303](henrygd/beszel#2303))
- Fix agent disconnects during slow collections by extending WebSocket deadline ([#&#8203;2294](henrygd/beszel#2294))
- Fix missing root CA certificates in base agent image ([#&#8203;2291](henrygd/beszel#2291))
- Fix false RAID health warnings during healthy data scrubbing ([#&#8203;2109](henrygd/beszel#2109))
- Fix ZFS monitoring when /dev/zfs is unavailable ([#&#8203;2325](henrygd/beszel#2325))
- Fix spurious `HUB_URL` warning in SSH-only mode ([#&#8203;2316](henrygd/beszel#2316))
- Fix idle GPU utilization display in systems table ([#&#8203;2312](henrygd/beszel#2312))
- Fix session handling to clear auth store after token expiry ([#&#8203;2310](henrygd/beszel#2310))
- Fix chart history handling when switching to live charts ([#&#8203;2333](henrygd/beszel#2333))
- Update Go dependencies

#### New Contributors

- [@&#8203;arnolicious](https://github.com/arnolicious) made their first contribution in [#&#8203;2288](henrygd/beszel#2288)
- [@&#8203;matth3wdsouza](https://github.com/matth3wdsouza) made their first contribution in [#&#8203;2303](henrygd/beszel#2303)
- [@&#8203;anaisbetts](https://github.com/anaisbetts) made their first contribution in [#&#8203;2315](henrygd/beszel#2315)
- [@&#8203;brunob45](https://github.com/brunob45) made their first contribution in [#&#8203;2211](henrygd/beszel#2211)
- [@&#8203;ChangkeunJ](https://github.com/ChangkeunJ) made their first contribution in [#&#8203;2333](henrygd/beszel#2333)
- [@&#8203;rajtslegr](https://github.com/rajtslegr) made their first contribution in [#&#8203;2328](henrygd/beszel#2328)
- [@&#8203;jmrplens](https://github.com/jmrplens) made their first contribution in [#&#8203;2327](henrygd/beszel#2327)

**Full Changelog**: <henrygd/beszel@v0.19.0...v0.20.0>

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC44My4wIiwidXBkYXRlZEluVmVyIjoiNDQuODMuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

---------

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Reviewed-on: https://git.ivanch.me/ivanch/haven/pulls/14
xiaoran7 pushed a commit to xiaoran7/beszel that referenced this pull request Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Alpine agent repeatedly logs zpool timeouts when /dev/zfs is not mapped

2 participants