{"record":{"id":"9c67f083f3cb656b","repo":"juanfont/headscale","slug":"pre-barrier-w","errorCode":null,"errorMessage":"pre-barrier: %w","messagePattern":"pre-barrier: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"integration/scenario.go","lineNumber":839,"sourceCode":"\n// WaitForTailscaleSyncPerUser blocks until each [TailscaleClient] has\n// the expected per-user peer count (necessary for policies like\n// autogroup:self where cross-user peers are invisible).\nfunc (s *Scenario) WaitForTailscaleSyncPerUser(timeout, retryInterval time.Duration, opts ...SyncOption) error {\n\toptions := syncOptions{}\n\tfor _, opt := range opts {\n\t\topt(&options)\n\t}\n\n\tif options.preBarrier != nil {\n\t\tbarrierCtx, cancel := context.WithTimeout(context.Background(), timeout)\n\n\t\terr := options.preBarrier(barrierCtx)\n\n\t\tcancel()\n\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"pre-barrier: %w\", err)\n\t\t}\n\t}\n\n\t// Calculate expected peer count: number of nodes in this user minus 1 (self)\n\treturn s.waitPeers(func(u *User) int { return len(u.Clients) - 1 }, timeout, retryInterval)\n}\n\n// WaitForTailscaleSyncWithPeerCount blocks execution until all the [TailscaleClient] reports\n// to have all other [TailscaleClient]s present in their [netmap.NetworkMap].\nfunc (s *Scenario) WaitForTailscaleSyncWithPeerCount(peerCount int, timeout, retryInterval time.Duration) error {\n\treturn s.waitPeers(func(*User) int { return peerCount }, timeout, retryInterval)\n}\n\n// waitPeers blocks until every [TailscaleClient] reports the expected peer\n// count returned by perUser for its owning user, fanning out per user.\nfunc (s *Scenario) waitPeers(perUser func(*User) int, timeout, retryInterval time.Duration) error {\n\tvar allErrors []error\n","sourceCodeStart":821,"sourceCodeEnd":857,"githubUrl":"https://github.com/juanfont/headscale/blob/565fd254d06c4c7f9a8cad1714a43445c79ba420/integration/scenario.go#L821-L857","documentation":"Error \"pre-barrier: %w\" thrown in juanfont/headscale.","triggerScenarios":"Thrown at integration/scenario.go:839 when the library encounters an invalid state.","commonSituations":"A pre-barrier step in the scenario failed. Check the wrapped error for which synchronization step did not complete.","solutions":["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."],"exampleFix":"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.","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"565fd254d06c4c7f9a8cad1714a43445c79ba420","analyzedAt":"2026-08-15T13:12:30.133Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}