{"record":{"id":"0a2d7d0496878ea2","repo":"hashicorp/nomad","slug":"invalid-consul-configuration-v","errorCode":null,"errorMessage":"invalid consul configuration: %v","messagePattern":"invalid consul configuration: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/structs/structs.go","lineNumber":5691,"sourceCode":"\tcase error:\n\t\tmErr.Errors = append(mErr.Errors, fmt.Errorf(\"invalid node pool configuration: %v\", e))\n\t}\n\n\terr = n.VaultConfiguration.Validate()\n\tswitch e := err.(type) {\n\tcase *multierror.Error:\n\t\tfor _, vErr := range e.Errors {\n\t\t\tmErr.Errors = append(mErr.Errors, fmt.Errorf(\"invalid vault configuration: %v\", vErr))\n\t\t}\n\tcase error:\n\t\tmErr.Errors = append(mErr.Errors, fmt.Errorf(\"invalid vault configuration: %v\", e))\n\t}\n\n\terr = n.ConsulConfiguration.Validate()\n\tswitch e := err.(type) {\n\tcase *multierror.Error:\n\t\tfor _, cErr := range e.Errors {\n\t\t\tmErr.Errors = append(mErr.Errors, fmt.Errorf(\"invalid consul configuration: %v\", cErr))\n\t\t}\n\tcase error:\n\t\tmErr.Errors = append(mErr.Errors, fmt.Errorf(\"invalid consul configuration: %v\", e))\n\t}\n\n\treturn mErr.ErrorOrNil()\n}\n\n// SetHash is used to compute and set the hash of the namespace\nfunc (n *Namespace) SetHash() []byte {\n\t// Initialize a 256bit Blake2 hash (32 bytes)\n\thash, err := blake2b.New256(nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Write all the user set fields\n\t_, _ = hash.Write([]byte(n.Name))","sourceCodeStart":5673,"sourceCodeEnd":5709,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/structs/structs.go#L5673-L5709","documentation":"Wrapper error from Namespace.Validate() for the multierror branch of ConsulConfiguration.Validate(): each sub-error is re-wrapped as 'invalid consul configuration: %v' and appended to the namespace's multierror.","triggerScenarios":"Namespace create/update where the namespace's Consul configuration (e.g. DefaultCluster) fails validation, via `nomad namespace apply` or the namespace HTTP API.","commonSituations":"Invalid Consul cluster name in a namespace (Nomad 1.7+ consul namespace support); wrong field name in JSON/HCL; enabling Consul config on OSS where fields are ignored/rejected.","solutions":["Read the inner message after the prefix to find the failing field","Fix the ConsulConfiguration value (e.g. valid DefaultCluster matching the allowed regex)","Validate the Consul configuration standalone before submitting","Confirm the field is supported in your Nomad version"],"exampleFix":"// before\nns.ConsulConfiguration = &structs.ConsulConfiguration{DefaultCluster: \"consul.prod!\"}\n// after\nns.ConsulConfiguration = &structs.ConsulConfiguration{DefaultCluster: \"default\"}","handlingStrategy":"validation","validationCode":"if err := ns.ConsulConfiguration.Validate(); err != nil {\n    return fmt.Errorf(\"namespace consul config invalid: %w\", err)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check Consul cluster name format before submitting","Confirm the fields exist in your Nomad version (Consul namespaces require Nomad 1.7+ / Enterprise for some features)","Lint HCL/JSON namespace blocks against the schema","Keep Consul and Nomad configuration reviewed together"],"tags":["nomad","validation","consul"],"backgroundTag":"nested-config-validation-failed","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"}