{"record":{"id":"555ac46326ee297c","repo":"hashicorp/nomad","slug":"client-introduction-enforcement-must-be-one-of-v","errorCode":null,"errorMessage":"client_introduction.enforcement must be one of %v","messagePattern":"client_introduction\\.enforcement must be one of (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"command/agent/config.go","lineNumber":1264,"sourceCode":"\t\tresult.ExtraKeysHCL = append(result.ExtraKeysHCL, z.ExtraKeysHCL...)\n\t}\n\n\treturn &result\n}\n\n// Validate performs validation on the ClientIntroduction configuration block to\n// ensure the values are set correctly for use by the server.\nfunc (c *ClientIntroduction) Validate() error {\n\n\tif c == nil {\n\t\treturn nil\n\t}\n\n\tif c.Enforcement == \"\" {\n\t\treturn errors.New(\"client_introduction.enforcement must be set\")\n\t}\n\tif !slices.Contains(ClientIntroductionEnforcementValues, c.Enforcement) {\n\t\treturn fmt.Errorf(\"client_introduction.enforcement must be one of %v\",\n\t\t\tClientIntroductionEnforcementValues)\n\t}\n\n\tif c.DefaultIdentityTTL < 1 {\n\t\treturn errors.New(\"client_introduction.default_identity_ttl must be greater one\")\n\t}\n\tif c.MaxIdentityTTL < 1 {\n\t\treturn errors.New(\"client_introduction.max_identity_ttl must be greater one\")\n\t}\n\tif c.MaxIdentityTTL < c.DefaultIdentityTTL {\n\t\treturn errors.New(\"client_introduction.max_identity_ttl must be greater than default_identity_ttl\")\n\t}\n\n\treturn nil\n}\n\n// ServerJoin is used in both clients and servers to bootstrap connections to\n// servers","sourceCodeStart":1246,"sourceCodeEnd":1282,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/command/agent/config.go#L1246-L1282","documentation":"The `client_introduction` block's `enforcement` field must be set and must be one of the allowed values in ClientIntroductionEnforcementValues. Nomad validates this when parsing agent config and rejects unknown or empty values.","triggerScenarios":"Config contains `client_introduction { enforcement = \"...\" }` with a value not in the allowed set (typo, wrong case) or enforcement omitted entirely (caught by the adjacent \"must be set\" error).","commonSituations":"Typos in the enforcement value; copying docs from a different Nomad version where allowed values differ; leaving the field blank while enabling client_introduction.","solutions":["Set enforcement to one of the values listed in ClientIntroductionEnforcementValues (check the docs for your Nomad version).","Fix casing/typos in the enforcement value.","If you don't need client introduction, remove the block entirely."],"exampleFix":"// before\nclient_introduction {\n  enforcement = \"permisive\"\n}\n// after\nclient_introduction {\n  enforcement = \"permissive\" // must be one of the documented values\n}","handlingStrategy":"validation","validationCode":"allowed := ClientIntroductionEnforcementValues\nif !slices.Contains(allowed, cfg.ClientIntroduction.Enforcement) {\n  return fmt.Errorf(\"enforcement must be one of %v\", allowed)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Copy allowed values from the docs matching your Nomad version","Lint HCL configs before deploy","Keep client_introduction blocks minimal and reviewed"],"tags":["config","validation","nomad"],"backgroundTag":"invalid-enum-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"}