{"record":{"id":"97be0fcc428e1f16","repo":"hashicorp/nomad","slug":"invalid-enforcement-q","errorCode":null,"errorMessage":"invalid enforcement %q","messagePattern":"invalid enforcement %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/structs/node.go","lineNumber":931,"sourceCode":"\tnewCI := *n\n\treturn &newCI\n}\n\n// Validate checks that the node introduction configuration is valid.\nfunc (n *NodeIntroductionConfig) Validate() error {\n\n\tif n == nil {\n\t\treturn fmt.Errorf(\"cannot be empty\")\n\t}\n\n\tvar mErr *multierror.Error\n\n\tswitch n.Enforcement {\n\tcase NodeIntroductionEnforcementNone,\n\t\tNodeIntroductionEnforcementWarn,\n\t\tNodeIntroductionEnforcementStrict:\n\tdefault:\n\t\tmErr = multierror.Append(mErr, fmt.Errorf(\"invalid enforcement %q\", n.Enforcement))\n\t}\n\n\tif n.DefaultIdentityTTL < 1 {\n\t\tmErr = multierror.Append(mErr, errors.New(\"default_identity_ttl must be greater than 0\"))\n\t}\n\n\tif n.MaxIdentityTTL < 1 {\n\t\tmErr = multierror.Append(mErr, errors.New(\"max_identity_ttl must be greater than 0\"))\n\t}\n\n\tif n.MaxIdentityTTL < n.DefaultIdentityTTL {\n\t\tmErr = multierror.Append(mErr, errors.New(\n\t\t\t\"max_identity_ttl must be greater than or equal to default_identity_ttl\",\n\t\t))\n\t}\n\n\treturn mErr.ErrorOrNil()\n}","sourceCodeStart":913,"sourceCodeEnd":949,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/structs/node.go#L913-L949","documentation":"NodeIntroductionConfig.Validate found an Enforcement value outside the allowed set (none, warn, strict); the multierror records the invalid enum value.","triggerScenarios":"Thrown at nomad/structs/node.go:931 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set enforcement to one of \"none\", \"warn\", or \"strict\"","Remove the invalid value to use the default"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}