{"record":{"id":"8ab5e63df6ae10ed","repo":"juanfont/headscale","slug":"tagowners-q-w","errorCode":null,"errorMessage":"tagOwners[%q]: %w","messagePattern":"tagOwners\\[%q\\]: %w","errorType":"validation","errorClass":"ErrTagNameMustStartWithLetter","httpStatus":null,"severity":"error","filePath":"hscontrol/policy/v2/types.go","lineNumber":3155,"sourceCode":"\t\t\t\tptr := serr.JSONPointer\n\t\t\t\tname := ptr.LastToken()\n\n\t\t\t\treturn nil, fmt.Errorf(\"%w: %q\", ErrUnknownField, name)\n\t\t\t}\n\n\t\t\t// Non-tag entries in grant.via surface as type errors on\n\t\t\t// []Tag; rephrase to the wire-compatible body.\n\t\t\tif strings.Contains(string(serr.JSONPointer), \"/via/\") {\n\t\t\t\treturn nil, ErrGrantViaNotATag\n\t\t\t}\n\n\t\t\t// Non-ASCII tag-name failures surface from Tag.Validate\n\t\t\t// at unmarshal time. Reshape to `tagOwners[\"tag:X\"]: …`.\n\t\t\tif errors.Is(serr.Err, ErrTagNameMustStartWithLetter) {\n\t\t\t\tptr := serr.JSONPointer\n\t\t\t\tname := ptr.LastToken()\n\n\t\t\t\treturn nil, fmt.Errorf(\"tagOwners[%q]: %w\", name, ErrTagNameMustStartWithLetter)\n\t\t\t}\n\t\t}\n\n\t\treturn nil, fmt.Errorf(\"parsing policy from bytes: %w\", err)\n\t}\n\n\tif err := policy.validate(); err != nil { //nolint:noinlineerr\n\t\treturn nil, err\n\t}\n\n\treturn &policy, nil\n}\n\n// validateProtocolPortCompatibility checks that only TCP, UDP, and SCTP [Protocol]s\n// can have specific ports. All other [Protocol]s should only use wildcard ports.\nfunc validateProtocolPortCompatibility(protocol Protocol, destinations []AliasWithPorts) error {\n\t// Only TCP, UDP, and SCTP support specific ports\n\tsupportsSpecificPorts := protocol == ProtocolNameTCP || protocol == ProtocolNameUDP || protocol == ProtocolNameSCTP || protocol == \"\"","sourceCodeStart":3137,"sourceCodeEnd":3173,"githubUrl":"https://github.com/juanfont/headscale/blob/565fd254d06c4c7f9a8cad1714a43445c79ba420/hscontrol/policy/v2/types.go#L3137-L3173","documentation":"Error \"tagOwners[%q]: %w\" thrown in juanfont/headscale.","triggerScenarios":"Thrown at hscontrol/policy/v2/types.go:3155 when the library encounters an invalid state.","commonSituations":"A tagOwners entry for the named tag failed to parse. Ensure its value is an array of valid users or groups.","solutions":["Inspect the wrapped error for the underlying cause and correct the failing condition (tagOwners[]); retry the operation after fixing the input, configuration, or environment."],"exampleFix":"Inspect the wrapped error for the underlying cause and correct the failing condition (tagOwners[]); 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"}