juanfont/headscale · error

pre-barrier: %w

Error message

pre-barrier: %w

What it means

Error "pre-barrier: %w" thrown in juanfont/headscale.

Source

Thrown at integration/scenario.go:839

// WaitForTailscaleSyncPerUser blocks until each [TailscaleClient] has
// the expected per-user peer count (necessary for policies like
// autogroup:self where cross-user peers are invisible).
func (s *Scenario) WaitForTailscaleSyncPerUser(timeout, retryInterval time.Duration, opts ...SyncOption) error {
	options := syncOptions{}
	for _, opt := range opts {
		opt(&options)
	}

	if options.preBarrier != nil {
		barrierCtx, cancel := context.WithTimeout(context.Background(), timeout)

		err := options.preBarrier(barrierCtx)

		cancel()

		if err != nil {
			return fmt.Errorf("pre-barrier: %w", err)
		}
	}

	// Calculate expected peer count: number of nodes in this user minus 1 (self)
	return s.waitPeers(func(u *User) int { return len(u.Clients) - 1 }, timeout, retryInterval)
}

// WaitForTailscaleSyncWithPeerCount blocks execution until all the [TailscaleClient] reports
// to have all other [TailscaleClient]s present in their [netmap.NetworkMap].
func (s *Scenario) WaitForTailscaleSyncWithPeerCount(peerCount int, timeout, retryInterval time.Duration) error {
	return s.waitPeers(func(*User) int { return peerCount }, timeout, retryInterval)
}

// waitPeers blocks until every [TailscaleClient] reports the expected peer
// count returned by perUser for its owning user, fanning out per user.
func (s *Scenario) waitPeers(perUser func(*User) int, timeout, retryInterval time.Duration) error {
	var allErrors []error

View on GitHub (pinned to 565fd254d0)

Solutions

  1. Inspect the wrapped error for the underlying cause and correct the failing condition (pre-barrier); 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 (pre-barrier); retry the operation after fixing the input, configuration, or environment.

When it happens

Trigger: Thrown at integration/scenario.go:839 when the library encounters an invalid state.

Common situations: A pre-barrier step in the scenario failed. Check the wrapped error for which synchronization step did not complete.


AI-assisted analysis of juanfont/headscale@565fd254d0 (2026-08-15). Data as JSON: /api/errors/9c67f083f3cb656b. Report an issue: GitHub.