From 2765031898ee987eac14433d1cbd5ac120bdcd69 Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Sun, 8 Nov 2026 23:19:39 +0000 Subject: [PATCH] hscontrol: log refused registrations The client only retries, so the log is the operator's one sign. --- hscontrol/noise.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/hscontrol/noise.go b/hscontrol/noise.go index b28ee0db3..24dee782a 100644 --- a/hscontrol/noise.go +++ b/hscontrol/noise.go @@ -1060,6 +1060,16 @@ func (ns *noiseServer) RegistrationHandler( resp, err := ns.headscale.handleRegister(req.Context(), registerRequest, ns.machineKey) if err != nil { + // The client only retries, so this is the operator's one sign of a refused node. + e := log.Warn().Err(err). + Str(zf.MachineKey, ns.machineKey.ShortString()). + Str(zf.NodeKey, registerRequest.NodeKey.ShortString()) + if registerRequest.Hostinfo != nil { + e = e.Str(zf.Hostname, registerRequest.Hostinfo.Hostname) + } + + e.Msg("registration refused") + if httpErr, ok := errors.AsType[HTTPError](err); ok { // Keep permanent errors in HTTP 200 so controlclient surfaces RegisterResponse.Error. if httpErr.Code == http.StatusServiceUnavailable {