{"record":{"id":"6a366ccf444c43f0","repo":"hashicorp/nomad","slug":"transparent-proxy-block-has-invalid-excludeuids-fi","errorCode":null,"errorMessage":"transparent proxy block has invalid ExcludeUIDs field: %w","messagePattern":"transparent proxy block has invalid ExcludeUIDs field: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/structs/connect.go","lineNumber":150,"sourceCode":"\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}\n\n\t// note: ExcludeInboundPorts are validated in connect validation hook\n\t// because we need information from the network block\n\n\tif mErr.Len() == 1 {\n\t\treturn mErr.Errors[0]\n\t}\n\treturn mErr.ErrorOrNil()\n}\n\nfunc (tp *ConsulTransparentProxy) Equal(o *ConsulTransparentProxy) bool {\n\tif tp == nil || o == nil {\n\t\treturn tp == o\n\t}\n\tif tp.UID != o.UID {\n\t\treturn false","sourceCodeStart":132,"sourceCodeEnd":168,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/structs/connect.go#L132-L168","documentation":"For each entry in transparent_proxy.exclude_uids, requireUIDisUint validates it as a uint16 decimal; failures are wrapped as 'transparent proxy block has invalid ExcludeUIDs field' and appended to the validation multi-error.","triggerScenarios":"Validate() encounters an exclude_uids element that is not a valid unsigned 16-bit integer string (non-numeric, >65535, malformed).","commonSituations":"Listing usernames in exclude_uids instead of numeric IDs; copy-paste artifacts like trailing commas or spaces; out-of-range UIDs.","solutions":["Ensure every exclude_uids entry is a numeric UID string within 0-65535","Convert usernames with id -u <user> before adding them to the list","Read the wrapped strconv error to identify which entry failed and why"],"exampleFix":"// before\ntransparent_proxy {\n  exclude_uids = [\"root\", \"999999\"]\n}\n// after\ntransparent_proxy {\n  exclude_uids = [\"0\", \"59999\"]\n}","handlingStrategy":"validation","validationCode":"for _, uid := range tp.ExcludeUIDs {\n    if _, err := strconv.ParseUint(uid, 10, 16); err != nil {\n        return fmt.Errorf(\"exclude_uids entry %q must be numeric 0-65535\", uid)\n    }\n}","typeGuard":null,"tryCatchPattern":"if err := job.Validate(); err != nil {\n    if strings.Contains(err.Error(), \"invalid ExcludeUIDs field\") {\n        return fmt.Errorf(\"one or more exclude_uids entries are not valid uint16 strings: %w\", err)\n    }\n    return err\n}","preventionTips":["Convert usernames to numeric UIDs with `id -u` before listing them","Lint exclude_uids entries against ^[0-9]{1,5}$ in CI","Keep exclude lists small and review entries for range validity"],"tags":["validation","connect","transparent-proxy"],"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"}