Agent panics (nil pointer) on every forget job — jobs hang at status=running and never alert #37
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
The agent panics with a nil pointer dereference on every forget job, fleet-wide, ~1s after accepting it. systemd restarts the agent, but the job is never reported as finished — so it sits at
status: runningforever with 0 log lines, and no alert is raised (onlyfailedalerts; a hung job does not).restic's forget itself appears to complete — hosts with correct config still thin properly — so the crash is on the result-reporting path, after the useful work. That is what makes it so quiet: retention silently works on some hosts and silently doesn't on others, and the dashboard shows neither.
Stack trace
Likely cause
client.go:114is the deferred close of the dial response:With
github.com/coder/websocket v1.8.14, the*http.Responsereturned byDialis not guaranteed non-nil even whenerr == nil, andres.Bodymay itself be nil. The deferred closure dereferences it unconditionally, andaddr=0x18is consistent with a nil-struct field offset rather than a nil interface.Note the panic is in the deferred call, so it fires when
connectOncereturns — i.e. when the connection is torn down after handling the forget — which matches the observed ~1s delay afteraccepting forget job.Suggested fix:
Impact
High, mostly because it is silent:
runningindefinitely. Onhost-Athe jobs from 2026-08-20, 08-21 and 08-22 are all stillrunningwith 0 log lines.failedraises an alert, a hung forget produces no alert at all.OpenAlerts: 0while retention has not run for months.restart counter is at 33on host-B), so any other in-flight work on that agent dies too.Scope — fleet-wide, all on v1.1.0
In every case the panic timestamp is exactly 1–2s after the
accepting forget joblog line.Not related to source-group config
Worth stating explicitly, since the two were initially conflated: re-saving a host's source group changes whether retention is applied, but has no effect on the panic.
host-Bhad its source group re-saved at 2026-08-21T18:21 and still panicked at 2026-08-21 18:21:57 and again at 2026-08-22 03:00:57.Environment
v1.1.0(commit0f5110f3d9b91b269684453e6b8d14dbcffb93c6, built 2026-06-16T06:32:52Z)0.18.1, protocol_version 1github.com/coder/websocket v1.8.14