{"record":{"id":"e985f6b372688b4b","repo":"juanfont/headscale","slug":"test-d-accept-q-w","errorCode":null,"errorMessage":"test %d, accept %q: %w","messagePattern":"test (.+?), accept %q: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"hscontrol/policy/v2/types.go","lineNumber":3215,"sourceCode":"func validateTests(pol *Policy, tests []PolicyTest) error {\n\tvar errs []error\n\n\tfor i, t := range tests {\n\t\tif len(t.Accept) == 0 && len(t.Deny) == 0 {\n\t\t\terrs = append(errs, fmt.Errorf(\"test %d: %w\", i, ErrTestEmptyAssertions))\n\t\t}\n\n\t\tif t.Proto != \"\" &&\n\t\t\tt.Proto != ProtocolNameTCP &&\n\t\t\tt.Proto != ProtocolNameUDP &&\n\t\t\tt.Proto != ProtocolNameSCTP {\n\t\t\terrs = append(errs, fmt.Errorf(\"test %d: %w: %q\", i, ErrTestProtocolNotAllowed, t.Proto))\n\t\t}\n\n\t\tfor _, dst := range t.Accept {\n\t\t\terr := validateTestDestination(pol, dst)\n\t\t\tif err != nil {\n\t\t\t\terrs = append(errs, fmt.Errorf(\"test %d, accept %q: %w\", i, dst, err))\n\t\t\t}\n\t\t}\n\n\t\tfor _, dst := range t.Deny {\n\t\t\terr := validateTestDestination(pol, dst)\n\t\t\tif err != nil {\n\t\t\t\terrs = append(errs, fmt.Errorf(\"test %d, deny %q: %w\", i, dst, err))\n\t\t\t}\n\t\t}\n\t}\n\n\tif len(errs) > 0 {\n\t\treturn fmt.Errorf(\"%w:\\n%w\", errPolicyTestsFailed, multierr.New(errs...))\n\t}\n\n\treturn nil\n}\n","sourceCodeStart":3197,"sourceCodeEnd":3233,"githubUrl":"https://github.com/juanfont/headscale/blob/565fd254d06c4c7f9a8cad1714a43445c79ba420/hscontrol/policy/v2/types.go#L3197-L3233","documentation":"Error \"test %d, accept %q: %w\" thrown in juanfont/headscale.","triggerScenarios":"Thrown at hscontrol/policy/v2/types.go:3215 when the library encounters an invalid state.","commonSituations":"An accept entry in a policy test failed to resolve. Ensure the accept destination is a single valid host.","solutions":["Inspect the wrapped error for the underlying cause and correct the failing condition (test , accept); retry the operation after fixing the input, configuration, or environment."],"exampleFix":"Inspect the wrapped error for the underlying cause and correct the failing condition (test , accept); 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"}