juanfont/headscale · error
updating policy manager after node deletion: %w
Error message
updating policy manager after node deletion: %w
What it means
Error "updating policy manager after node deletion: %w" thrown in juanfont/headscale.
Source
Thrown at hscontrol/state/state.go:611
// DeleteNode permanently removes a node and cleans up associated resources.
// Returns whether policies changed and any error. This operation is irreversible.
func (s *State) DeleteNode(node types.NodeView) (change.Change, error) {
s.nodeStore.DeleteNode(node.ID())
err := s.db.DeleteNode(node.AsStruct())
if err != nil {
return change.Change{}, err
}
s.ipAlloc.FreeIPs(node.IPs())
c := change.NodeRemoved(node.ID())
// Check if policy manager needs updating after node deletion
policyChange, err := s.updatePolicyManagerNodes()
if err != nil {
return change.Change{}, fmt.Errorf("updating policy manager after node deletion: %w", err)
}
if !policyChange.IsEmpty() {
// Merge policy change with NodeRemoved to preserve PeersRemoved info
// This ensures the batcher cleans up the deleted node from its state
c = c.Merge(policyChange)
}
return c, nil
}
// Connect marks a node connected and returns the resulting changes
// plus a session epoch identifying this poll session. Every Connect
// acquires one live session; the caller must release it with exactly
// one [State.Disconnect] call once the session ends (see poll.go).
func (s *State) Connect(id types.NodeID) ([]change.Change, uint64) {
prevRoutes := s.nodeStore.PrimaryRoutes()
View on GitHub (pinned to 565fd254d0)
Solutions
- Inspect the wrapped error for the underlying cause and correct the failing condition (updating policy manager after node deletion); 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 (updating policy manager after node deletion); retry the operation after fixing the input, configuration, or environment.
When it happens
Trigger: Thrown at hscontrol/state/state.go:611 when the library encounters an invalid state.
Common situations: Refreshing the policy manager after deleting a node failed. Check the policy for references to the deleted node's tags.
AI-assisted analysis of juanfont/headscale@565fd254d0 (2026-08-15).
Data as JSON: /api/errors/33eaeedf65e5f542.
Report an issue: GitHub.