{"record":{"id":"d8500c87ffad53ba","repo":"hashicorp/nomad","slug":"invalid-user-id-q-w","errorCode":null,"errorMessage":"invalid user ID %q: %w","messagePattern":"invalid user ID %q: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/structs/connect.go","lineNumber":134,"sourceCode":"\nfunc (tp *ConsulTransparentProxy) Validate() error {\n\tvar mErr multierror.Error\n\n\tfor _, rawCidr := range tp.ExcludeOutboundCIDRs {\n\t\t_, err := netip.ParsePrefix(rawCidr)\n\t\tif err != nil {\n\t\t\t// note: error returned always include parsed string\n\t\t\tmErr.Errors = append(mErr.Errors,\n\t\t\t\tfmt.Errorf(\"could not parse transparent proxy excluded outbound CIDR as network prefix: %w\", err))\n\t\t}\n\t}\n\n\trequireUIDisUint := func(uidRaw string) error {\n\t\t_, err := strconv.ParseUint(uidRaw, 10, 16)\n\t\tif err != nil {\n\t\t\te, ok := err.(*strconv.NumError)\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"invalid user ID %q: %w\", uidRaw, err)\n\t\t\t}\n\t\t\treturn fmt.Errorf(\"invalid user ID %q: %w\", uidRaw, e.Err)\n\t\t}\n\t\treturn nil\n\t}\n\n\tif tp.UID != \"\" {\n\t\tif err := requireUIDisUint(tp.UID); err != nil {\n\t\t\tmErr.Errors = append(mErr.Errors,\n\t\t\t\tfmt.Errorf(\"transparent proxy block has invalid UID field: %w\", err))\n\t\t}\n\t}\n\tfor _, uid := range tp.ExcludeUIDs {\n\t\tif err := requireUIDisUint(uid); err != nil {\n\t\t\tmErr.Errors = append(mErr.Errors,\n\t\t\t\tfmt.Errorf(\"transparent proxy block has invalid ExcludeUIDs field: %w\", err))\n\t\t}\n\t}","sourceCodeStart":116,"sourceCodeEnd":152,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/structs/connect.go#L116-L152","documentation":"The requireUIDisUint helper parses transparent-proxy UIDs with strconv.ParseUint(uid, 10, 16). If the value fails to parse as an unsigned 16-bit integer and the error is not a recognized *strconv.NumError, it is wrapped generically as 'invalid user ID'.","triggerScenarios":"requireUIDisUint receives a UID string with non-numeric characters, leading '+' signs, or is empty-spaced, and the returned error is not a NumError (uncommon parse failures).","commonSituations":"Passing usernames instead of numeric UIDs; whitespace or BOM characters in the config value; values exceeding uint16 range in variant paths.","solutions":["Set the UID field to a plain numeric string between 0 and 65535","Trim whitespace and remove any non-digit characters from the value","Look up the numeric UID on the host (id -u <user>) and use that"],"exampleFix":"// before\ntransparent_proxy {\n  uid = \"nomad\"\n}\n// after\ntransparent_proxy {\n  uid = \"1000\"\n}","handlingStrategy":"validation","validationCode":"func validUID(s string) bool {\n    _, err := strconv.ParseUint(strings.TrimSpace(s), 10, 16)\n    return err == nil\n}","typeGuard":null,"tryCatchPattern":"if err := requireUIDisUint(tp.UID); err != nil {\n    return fmt.Errorf(\"rejecting job: %w\", err)\n}","preventionTips":["Store numeric UIDs, never usernames, in transparent proxy config","Trim whitespace and strip quotes from templated values","Constrain UIDs to 0-65535"],"tags":["validation","connect","uid"],"backgroundTag":"invalid-uid-value","analyzedSha":"482b49bf1aec006f089bcfc7e632d8f6ac303e5e","analyzedAt":"2026-09-04T07:54:14.808Z","contentChangedAt":"2026-09-04T07:54:14.808Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}