{"record":{"id":"c6797649ce99c418","repo":"juanfont/headscale","slug":"resolving-tag-owners-map-w","errorCode":null,"errorMessage":"resolving tag owners map: %w","messagePattern":"resolving tag owners map: %w","errorType":"validation","errorClass":null,"httpStatus":400,"severity":"error","filePath":"hscontrol/policy/v2/policy.go","lineNumber":286,"sourceCode":"\t\t\tStr(\"filter.hash.new\", filterHash.String()[:8]).\n\t\t\tInt(\"filter.rules\", len(pm.filter)).\n\t\t\tInt(\"filter.rules.new\", len(filter)).\n\t\t\tMsg(\"Policy filter hash changed\")\n\t}\n\n\tpm.filter = filter\n\n\tpm.filterHash = filterHash\n\tif filterChanged {\n\t\tpm.matchers = matcher.MatchesFromFilterRules(pm.filter)\n\t}\n\n\t// Order matters, tags might be used in autoapprovers, so we need to ensure\n\t// that the map for tag owners is resolved before resolving autoapprovers.\n\t// TODO(kradalby): Order might not matter after #2417\n\ttagMap, err := resolveTagOwners(pm.pol, pm.users, pm.nodes)\n\tif err != nil {\n\t\treturn false, fmt.Errorf(\"resolving tag owners map: %w\", err)\n\t}\n\n\ttagOwnerMapHash := deephash.Hash(&tagMap)\n\n\ttagOwnerChanged := tagOwnerMapHash != pm.tagOwnerMapHash\n\tif tagOwnerChanged {\n\t\tlog.Debug().\n\t\t\tStr(\"tagOwner.hash.old\", pm.tagOwnerMapHash.String()[:8]).\n\t\t\tStr(\"tagOwner.hash.new\", tagOwnerMapHash.String()[:8]).\n\t\t\tInt(\"tagOwners.old\", len(pm.tagOwnerMap)).\n\t\t\tInt(\"tagOwners.new\", len(tagMap)).\n\t\t\tMsg(\"Tag owner hash changed\")\n\t}\n\n\tpm.tagOwnerMap = tagMap\n\tpm.tagOwnerMapHash = tagOwnerMapHash\n\n\tautoMap, exitSet, err := resolveAutoApprovers(pm.pol, pm.users, pm.nodes)","sourceCodeStart":268,"sourceCodeEnd":304,"githubUrl":"https://github.com/juanfont/headscale/blob/565fd254d06c4c7f9a8cad1714a43445c79ba420/hscontrol/policy/v2/policy.go#L268-L304","documentation":"Error \"resolving tag owners map: %w\" thrown in juanfont/headscale.","triggerScenarios":"Thrown at hscontrol/policy/v2/policy.go:286 when the library encounters an invalid state.","commonSituations":"A tagOwners entry could not be resolved to an alias. Ensure every tagOwners value is a valid user, group, or tag alias defined in the policy.","solutions":["Inspect the wrapped error for the underlying cause and correct the failing condition (resolving tag owners map); 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 tag owners map); 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-15T17:31:12.345Z"}