#2280·beszel

[Bug]: macOS agent hangs permanently after temperature-sensor timeout, no crash, no reconnect

Author: DzhuneytCreated Aug 31, 2026Updated Sep 12, 2026
Labelsbugfixed-pending-release

Welcome!

  • I have read the Documentation
  • I have checked the Common Issues Guide and my problem was not mentioned there.
  • I have searched open and closed issues and my problem was not mentioned before.
  • I have verified I am using the latest version available. You can check the latest release here.

Component

Agent

Problem Description

The agent runs on macOS with Homebrew, connected to the hub over WebSocket-push (agent dials out to the hub over Tailscale). Every few hours, the log shows Error updating temperatures err="temperature collection timed out". The agent disconnects and usually reconnects on its own. Sometimes, right after a successful reconnect, the agent goes silent forever: the process stays alive (same PID, no crash, no exit code in launchctl), but it never writes another log line and never sends data to the hub again. Only brew services restart beszel-agent recovers it.

This happened 3 times in about 24 hours. In the 2 cases with full log detail, the very last line before the freeze is INFO Stopping SSH server, right after INFO WebSocket connected. That points to the code path that stops the fallback SSH server after a WebSocket reconnect.

Related issues:

  • #796 — crash inside gopsutil sensors.TemperaturesWithContext on macOS. Same sensor call, but a hard crash. This report has no crash and no log after the freeze.
  • #531 — older, different symptom (malformed JSON) from the same macOS temperature-sensor code path.
  • #2041 — a different hang, on the hub's SSH-pull dial scheduler. That report explicitly rules out the temperature sensor. This report uses WebSocket-push, and the temperature-sensor message is present in every freeze.

Expected Behavior

The agent should recover from a temperature-collection timeout on its own, either by reconnecting or by exiting so launchd restarts it. It should not reach a state where the process is alive but permanently stops communicating with the hub.

Steps to Reproduce

  1. Install the agent on a macOS host with Homebrew.
  2. Start it as a background service: brew services start beszel-agent.
  3. Leave it running for several hours.
  4. Watch ~/.cache/beszel/beszel-agent.log.
  5. Wait for a "temperature collection timed out" warning, then check whether the agent reconnects and keeps logging, or goes silent.

We could not trigger the freeze on demand. It occurred 3 times in about 24 hours, at different times of day, with no correlation to system restarts or software updates.

OS / Architecture

darwin/arm64 (agent), macOS 26.6.2, Apple M1 Pro

Beszel version

0.18.8 (also seen on 0.18.7 before upgrading)

Installation method

Binary

Configuration

yaml
No overrides  default SENSORS and FILESYSTEM settings

Hub Logs

json

Agent Logs

bash
2026/08/30 19:56:44 WARN Error updating temperatures err="temperature collection timed out"
2026/08/30 19:56:44 WARN Connection closed err="connection closed, code=1000, reason="
2026/08/30 19:56:44 WARN Disconnected from hub
2026/08/30 19:56:57 WARN WebSocket connection failed err="context deadline exceeded"
2026/08/30 19:56:57 INFO Starting SSH server addr=:45876 network=tcp
2026/08/30 19:57:34 ERROR Error handling message err="use of closed network connection"
2026/08/30 19:57:36 WARN Connection closed err="close normal"
2026/08/30 19:57:45 WARN WebSocket connection failed err="read tcp <redacted>:64587-><redacted>:443: i/o timeout"
2026/08/30 19:57:45 INFO WebSocket connected host=<redacted>
2026/08/30 19:57:45 INFO Stopping SSH server
[no further log lines for 1h34m, until manual restart]

--- second occurrence, ~10 hours later ---
2026/08/31 05:22:55 WARN Error updating temperatures err="temperature collection timed out"
2026/08/31 05:22:56 WARN Connection closed err="connection closed, code=1000, reason="
2026/08/31 05:22:56 WARN Disconnected from hub
2026/08/31 05:23:10 WARN WebSocket connection failed err="read tcp <redacted>:60681-><redacted>:443: i/o timeout"
2026/08/31 05:23:10 INFO Starting SSH server addr=:45876 network=tcp
2026/08/31 05:23:34 ERROR Error handling message err="use of closed network connection"
2026/08/31 05:23:36 WARN Connection closed err="close normal"
2026/08/31 05:23:42 INFO WebSocket connected host=<redacted>
2026/08/31 05:23:42 INFO Stopping SSH server
[no further log lines for 4h6m, until manual restart]