juanfont/headscale · error
debug access denied
Error message
debug access denied
What it means
Error "debug access denied" thrown in juanfont/headscale.
Source
Thrown at hscontrol/debug.go:49
h.ServeHTTP(w, r)
return
}
// [tsweb.AllowDebugAccess] rejects X-Forwarded-For and non-TS IPs.
// Additionally allow private/LAN addresses so operators can reach
// debug endpoints from their local network without tailscaled.
ipStr, _, err := net.SplitHostPort(r.RemoteAddr)
if err == nil {
ip, parseErr := netip.ParseAddr(ipStr)
if parseErr == nil && ip.IsPrivate() {
h.ServeHTTP(w, r)
return
}
}
http.Error(w, "debug access denied", http.StatusForbidden)
})
}
// writeJSON marshals v with indentation and writes it as a 200 JSON response.
func writeJSON(w http.ResponseWriter, v any) {
b, err := json.MarshalIndent(v, "", " ")
if err != nil {
httpError(w, err)
return
}
w.Header().Set("Content-Type", "application/json")
w.WriteHeader(http.StatusOK)
_, _ = w.Write(b)
}
// writeDebug renders a debug endpoint as JSON or text/plain depending on the
// request's Accept header. JSON is produced only when explicitly requested;View on GitHub (pinned to 565fd254d0)
Solutions
- Inspect the wrapped error for the underlying cause and correct the failing condition (debug access denied); retry the operation after fixing the input, configuration, or environment.
Example fix
Inspect the wrapped error for the underlying cause and correct the failing condition (debug access denied); retry the operation after fixing the input, configuration, or environment.
When it happens
Trigger: Thrown at hscontrol/debug.go:49 when the library encounters an invalid state.
Common situations: Access to a debug endpoint was denied. Debug endpoints require the requesting identity to be authorized; use the CLI or an authorized local caller.
Understand the failure class
- Authentication and authorization failures — expired tokens, bad credentials, and missing scopes.
AI-assisted analysis of juanfont/headscale@565fd254d0 (2026-08-15).
Data as JSON: /api/errors/d20dc14495b10066.
Report an issue: GitHub.