{"record":{"id":"263bbcebf49b89f7","repo":"juanfont/headscale","slug":"resolving-w","errorCode":null,"errorMessage":"resolving: %w","messagePattern":"resolving: %w","errorType":"validation","errorClass":null,"httpStatus":400,"severity":"error","filePath":"hscontrol/policy/v2/sshtest.go","lineNumber":384,"sourceCode":"\treturn m\n}\n\n// resolveSSHTestSource returns the src's principal addresses and, for\n// user-shaped sources, the user ID (so autogroup:self can scope to it).\n// [Tag], [Host], and IP sources return userID 0.\nfunc resolveSSHTestSource(\n\tsrc Alias,\n\tpol *Policy,\n\tusers []types.User,\n\tnodes views.Slice[types.NodeView],\n) ([]netip.Addr, uint, error) {\n\tif src == nil {\n\t\treturn nil, 0, nil\n\t}\n\n\taddrs, err := src.Resolve(pol, users, nodes)\n\tif err != nil {\n\t\treturn nil, 0, fmt.Errorf(\"resolving: %w\", err)\n\t}\n\n\tif addrs == nil || addrs.Empty() {\n\t\treturn nil, 0, nil\n\t}\n\n\tout := slices.Collect(addrs.Iter())\n\n\tvar userID uint\n\n\tu, ok := src.(*Username)\n\tif ok {\n\t\tresolved, rErr := u.resolveUser(users)\n\t\tif rErr == nil {\n\t\t\tuserID = resolved.ID\n\t\t}\n\t}\n","sourceCodeStart":366,"sourceCodeEnd":402,"githubUrl":"https://github.com/juanfont/headscale/blob/565fd254d06c4c7f9a8cad1714a43445c79ba420/hscontrol/policy/v2/sshtest.go#L366-L402","documentation":"Error \"resolving: %w\" thrown in juanfont/headscale.","triggerScenarios":"Thrown at hscontrol/policy/v2/sshtest.go:384 when the library encounters an invalid state.","commonSituations":"Resolving a source or destination while evaluating an SSH test failed. Ensure the test's src/dst entries resolve under the policy.","solutions":["Inspect the wrapped error for the underlying cause and correct the failing condition (resolving); retry the operation after fixing the input, configuration, or environment."],"exampleFix":"Inspect the wrapped error for the underlying cause and correct the failing condition (resolving); 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"}