{"record":{"id":"54bb82176ed1c05c","repo":"juanfont/headscale","slug":"w-use-autogroup-member-for-user-owned-devices","errorCode":null,"errorMessage":"%w; use 'autogroup:member' for user-owned devices, 'autogroup:tagged' for tagged devices, or specific tags/users","messagePattern":"%w; use 'autogroup:member' for user-owned devices, 'autogroup:tagged' for tagged devices, or specific tags/users","errorType":"validation","errorClass":"ErrSSHWildcardDestination","httpStatus":null,"severity":"error","filePath":"hscontrol/policy/v2/types.go","lineNumber":2937,"sourceCode":"\n\treturn nil\n}\n\nfunc (a *SSHDstAliases) UnmarshalJSON(b []byte) error {\n\tvar aliases []AliasEnc\n\n\terr := json.Unmarshal(b, &aliases, policyJSONOpts...)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t*a = make([]Alias, len(aliases))\n\tfor i, alias := range aliases {\n\t\tswitch alias.Alias.(type) {\n\t\tcase *Username, *Tag, *AutoGroup, *Host:\n\t\t\t(*a)[i] = alias.Alias\n\t\tcase Asterix:\n\t\t\treturn fmt.Errorf(\"%w; use 'autogroup:member' for user-owned devices, \"+\n\t\t\t\t\"'autogroup:tagged' for tagged devices, or specific tags/users\",\n\t\t\t\tErrSSHWildcardDestination)\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"%w: %T\", ErrSSHDestAliasNotSupported, alias.Alias)\n\t\t}\n\t}\n\n\treturn nil\n}\n\n// MarshalJSON marshals the [SSHDstAliases] to JSON.\nfunc (a SSHDstAliases) MarshalJSON() ([]byte, error) {\n\tif a == nil {\n\t\treturn []byte(\"[]\"), nil\n\t}\n\n\taliases := make([]string, len(a))\n\tfor i, alias := range a {","sourceCodeStart":2919,"sourceCodeEnd":2955,"githubUrl":"https://github.com/juanfont/headscale/blob/565fd254d06c4c7f9a8cad1714a43445c79ba420/hscontrol/policy/v2/types.go#L2919-L2955","documentation":"Error \"%w; use 'autogroup:member' for user-owned devices, 'autogroup:tagged' for tagged devices, or specific tags/users\" thrown in juanfont/headscale.","triggerScenarios":"Thrown at hscontrol/policy/v2/types.go:2937 when the library encounters an invalid state.","commonSituations":"An overly broad alias was used where a narrower one is required. Use autogroup:member, autogroup:tagged, or specific tags/users as the message suggests.","solutions":["Inspect the wrapped error for the underlying cause and correct the failing condition (; use 'autogroup); retry the operation after fixing the input, configuration, or environment."],"exampleFix":"Inspect the wrapped error for the underlying cause and correct the failing condition (; use 'autogroup); 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"}